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

[PATCH v3] builtin/merge_recursive.c: Add an usage string and make use of it.

From
Thiago Farina <tfransosi@gmail.com>
Date
Aug 30, 2010, 03:30 UTC
Message-ID
<b58adc6cdfd6a5753fac1dde3371b3745b1f58b1.1283138840.git.tfransosi@gmail.com>
In-Reply-To
<20100830024259.GC4010@burratino>

This improves the usage output by adding builtin_merge_recursive_usage string that follows the same pattern used by the other builtin commands.

The previous output for git merger-recursive was: usage: merge-recursive <base>... -- <head> <remote> ...

Now the output is: usage: git merge-recursive <base>... -- <head> <remote> ...

Since cmd_merge_recursive is used to handle four different commands we need the %s in the usage string, so the following example:

$ git merge-subtree -h

Will output: usage: git merge-subtree <base>... -- <head> <remote> ...

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
 builtin/merge-recursive.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index d8875d5..3d00adb 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -3,6 +3,9 @@
 #include "tag.h"
 #include "merge-recursive.h"
 
+static const char builtin_merge_recursive_usage[] =
+	"git %s <base>... -- <head> <remote> ...";
+
 static const char *better_branch_name(const char *branch)
 {
 	static char githead_env[8 + 40 + 1];
@@ -29,7 +32,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
 		o.subtree_shift = "";
 
 	if (argc < 4)
-		usagef("%s <base>... -- <head> <remote> ...", argv[0]);
+		usagef(builtin_merge_recursive_usage, argv[0]);
 
 	for (i = 1; i < argc; ++i) {
 		const char *arg = argv[i];
-- 
1.7.2.1.95.g3d045
Previous: Jonathan NiederNext: Junio C Hamano
Message 5 of 10 in “builtin/merge_recursive.c: Add a usage string and make use of it.”
  1. builtin/merge_recursive.c: Add a usage string and make use of it.Thiago Farina, Aug 29, 2010
  2. Jonathan NiederAug 29, 2010
  3. builtin/merge_recursive.c: Add an usage string and make use of it.Thiago Farina, Aug 29, 2010
  4. Jonathan NiederAug 30, 2010
  5. builtin/merge_recursive.c: Add an usage string and make use of it.Thiago Farina, Aug 30, 2010
  6. Junio C HamanoAug 30, 2010
  7. Jonathan NiederAug 31, 2010
  8. Thiago FarinaSep 1, 2010
  9. Thiago FarinaAug 30, 2010
  10. Thiago FarinaAug 29, 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.