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

[PATCH 2/3] git-merge-base/git-show-branch: Cleanup documentation and usage

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Aug 5, 2009, 07:59 UTC
Message-ID
<1249459160-3931-3-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<1249459160-3931-2-git-send-email-git@drmicha.warpmail.net>

Make sure that usage strings and documentation coincide with each other and with the actual code.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Also does one 's/git-/git /'.
 Documentation/git-merge-base.txt  |    5 +++--
 Documentation/git-show-branch.txt |    5 +++--
 builtin-merge-base.c              |    2 +-
 builtin-show-branch.c             |    4 ++--
 4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-merge-base.txt b/Documentation/git-merge-base.txt
index 767486c..00e4003 100644
--- a/Documentation/git-merge-base.txt
+++ b/Documentation/git-merge-base.txt
@@ -8,12 +8,12 @@ git-merge-base - Find as good common ancestors as possible for a merge
 
 SYNOPSIS
 --------
-'git merge-base' [--all] <commit> <commit>...
+'git merge-base' [-a|--all] <commit> <commit>...
 
 DESCRIPTION
 -----------
 
-'git-merge-base' finds best common ancestor(s) between two commits to use
+'git merge-base' finds best common ancestor(s) between two commits to use
 in a three-way merge.  One common ancestor is 'better' than another common
 ancestor if the latter is an ancestor of the former.  A common ancestor
 that does not have any better common ancestor is a 'best common
@@ -29,6 +29,7 @@ the given two commits.
 
 OPTIONS
 -------
+-a::
 --all::
 	Output all merge bases for the commits, instead of just one.
 
diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index 89ec536..2c78c25 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -8,11 +8,12 @@ git-show-branch - Show branches and their commits
 SYNOPSIS
 --------
 [verse]
-'git show-branch' [--all] [--remotes] [--topo-order | --date-order]
-		[--current] [--color | --no-color]
+'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
+		[--current] [--color | --no-color] [--sparse]
 		[--more=<n> | --list | --independent | --merge-base]
 		[--no-name | --sha1-name] [--topics]
 		[<rev> | <glob>]...
+
 'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
 
 DESCRIPTION
diff --git a/builtin-merge-base.c b/builtin-merge-base.c
index a6ec2f7..54e7ec2 100644
--- a/builtin-merge-base.c
+++ b/builtin-merge-base.c
@@ -23,7 +23,7 @@ static int show_merge_base(struct commit **rev, int rev_nr, int show_all)
 }
 
 static const char * const merge_base_usage[] = {
-	"git merge-base [--all] <commit-id> <commit-id>...",
+	"git merge-base [-a|--all] <commit> <commit>...",
 	NULL
 };
 
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 01bea3b..03bdea6 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -6,8 +6,8 @@
 #include "parse-options.h"
 
 static const char* show_branch_usage[] = {
-    "git show-branch [--sparse] [--current] [--all] [--remotes] [--topo-order] [--more=count | --list | --independent | --merge-base] [--topics] [--color] [<refs>...]",
-    "--reflog[=n[,b]] [--list] [--color] <branch>",
+    "git show-branch [-a|--all] [-r|--remotes] [--topo-order | --date-order] [--current] [--color | --no-color] [--sparse] [--more=<n> | --list | --independent | --merge-base] [--no-name | --sha1-name] [--topics] [<rev> | <glob>]...",
+    "git show-branch (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]",
     NULL
 };
 
-- 
1.6.4.70.g9c084
Previous: Michael J GruberNext: Michael J Gruber
Message 3 of 4 in “git-merge-base -a vs. git-show-branch --merge-base”
  1. 0/3 git-merge-base -a vs. git-show-branch --merge-baseMichael J Gruber, Aug 5, 2009
  2. 1/3 t6010-merge-base.sh: Depict the octopus test graphMichael J Gruber, Aug 5, 2009
  3. 2/3 git-merge-base/git-show-branch: Cleanup documentation and usageMichael J Gruber, Aug 5, 2009
  4. 3/3 git-merge-base/git-show-branch --merge-base: Documentation and testMichael J Gruber, Aug 5, 2009

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.