Skip to content

Commit d9ec3b0

Browse files
peffgitster
authored andcommitted
doc/ls-remote: clarify pattern format
We document that you can specify "refs" to ls-remote, but we don't explain any further than that they are "matched" as patterns. Since this can be interpreted in a lot of ways, let's clarify that they are tail-matched globs. Likewise, let's use the word "patterns" to refer to them consistently, rather than "refs" (both here and in the quick "-h" help), and mention more explicitly that only one pattern needs to be matched (though there is also an example already that shows this in action). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent baebde7 commit d9ec3b0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Documentation/git-ls-remote.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SYNOPSIS
1111
[verse]
1212
'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>]
1313
[-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]
14-
[--symref] [<repository> [<refs>...]]
14+
[--symref] [<repository> [<patterns>...]]
1515

1616
DESCRIPTION
1717
-----------
@@ -85,11 +85,16 @@ OPTIONS
8585
either a URL or the name of a remote (see the GIT URLS and
8686
REMOTES sections of linkgit:git-fetch[1]).
8787

88-
<refs>...::
88+
<patterns>...::
8989
When unspecified, all references, after filtering done
90-
with --heads and --tags, are shown. When <refs>... are
91-
specified, only references matching the given patterns
92-
are displayed.
90+
with --heads and --tags, are shown. When <patterns>... are
91+
specified, only references matching one or more of the given
92+
patterns are displayed. Each pattern is interpreted as a glob
93+
(see `glob` in linkgit:gitglossary[7]) which is matched against
94+
the "tail" of a ref, starting either from the start of the ref
95+
(so a full name like `refs/heads/foo` matches) or from a slash
96+
separator (so `bar` matches `refs/heads/bar` but not
97+
`refs/heads/foobar`).
9398

9499
EXAMPLES
95100
--------

builtin/ls-remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
static const char * const ls_remote_usage[] = {
99
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
1010
" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
11-
" [--symref] [<repository> [<refs>...]]"),
11+
" [--symref] [<repository> [<patterns>...]]"),
1212
NULL
1313
};
1414

0 commit comments

Comments
 (0)