git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Documentation: improve description of --glob=pattern and friends

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 22, 2010, 00:21 UTC
Message-ID
<e2e992cfb93335b400fd9ec67c6d38cb0157b006.1264119524.git.trast@student.ethz.ch>
In-Reply-To
<7vbpgnp6d5.fsf@alter.siamese.dyndns.org>

Consolidate the descriptions of --branches, --tags and --remotes a bit, to make it less repetitive. Improve the grammar a bit, and spell out the meaning of the 'append /*' rule.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---

Compared to the earlier draft, I changed "it is anchored" (by appending '/*') to "it is turned into a prefix match", since this is not anchoring in the ^regex$ sense. (I guess 'leading-component match' would be even more accurate, but that makes the sentence unwieldy in my ears.)

 Documentation/git-rev-parse.txt |   32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index e2cb913..e7845d4 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -104,25 +104,23 @@ OPTIONS
 	Show all refs found in `$GIT_DIR/refs`.
 
 --branches[=pattern]::
-	Show branch refs found in `$GIT_DIR/refs/heads`. If `pattern`
-	is given, only branches matching given shell glob are shown.
-	If pattern lacks '?', '*', or '[', '/*' at the end is impiled.
-
 --tags[=pattern]::
-	Show tag refs found in `$GIT_DIR/refs/tags`. If `pattern`
-	is given, only tags matching given shell glob are shown.
-	If pattern lacks '?', '*', or '[', '/*' at the end is impiled.
-
 --remotes[=pattern]::
-	Show tag refs found in `$GIT_DIR/refs/remotes`. If `pattern`
-	is given, only remote tracking branches matching given shell glob
-	are shown. If pattern lacks '?', '*', or '[', '/*' at the end is
-	impiled.
-
---glob=glob-pattern::
-	Show refs matching shell glob pattern `glob-pattern`. If pattern
-	specified lacks leading 'refs/', it is automatically prepended.
-	If pattern lacks '?', '*', or '[', '/*' at the end is impiled.
+	Show all branches, tags, or remote-tracking branches,
+	respectively (i.e., refs found in `$GIT_DIR/refs/heads`,
+	`$GIT_DIR/refs/tags`, or `$GIT_DIR/refs/remotes`,
+	respectively).
++
+If a `pattern` is given, only refs matching the given shell glob are
+shown.  If the pattern does not contain a globbing character (`?`,
+`\*`, or `[`), it is turned into a prefix match by appending `/\*`.
+
+--glob=pattern::
+	Show all refs matching the shell glob pattern `pattern`. If
+	the pattern does not start with `refs/`, this is automatically
+	prepended.  If the pattern does not contain a globbing
+	character (`?`, `\*`, or `[`), it is turned into a prefix
+	match by appending `/\*`.
 
 --show-toplevel::
 	Show the absolute path of the top-level directory.
-- 
1.6.6.1.534.gf034a
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 12 in “rev-parse --glob”
  1. 1/2 rev-parse --globIlari Liusvaara, Jan 20, 2010
  2. 2/2 rev-parse --branches/--tags/--remotes=patternIlari Liusvaara, Jan 20, 2010
  3. Junio C HamanoJan 20, 2010
  4. Johannes SixtJan 21, 2010
  5. Michael J GruberJan 21, 2010
  6. Thomas RastJan 21, 2010
  7. Junio C HamanoJan 21, 2010
  8. Documentation: improve description of --glob=pattern and friendsThomas Rast, Jan 22, 2010
  9. Junio C HamanoJan 22, 2010
  10. Junio C HamanoJan 21, 2010
  11. Junio C HamanoJan 20, 2010
  12. Ilari LiusvaaraJan 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.