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

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:24

Thiago Farina [off-list ref] writes:
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 <redacted>
Hmm, why isn't this a single liner
-		usagef("%s <base>... -- <head> <remote> ...", argv[0]);
+		usagef("git %s <base>... -- <head> <remote> ...", argv[0]);

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

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:25

Junio C Hamano wrote:
Hmm, why isn't this a single liner
quoted
-		usagef("%s <base>... -- <head> <remote> ...", argv[0]);
+		usagef("git %s <base>... -- <head> <remote> ...", argv[0]);
I can't speak for Thiago, but I assume it's for unity of style with
more complicated commands like "git fetch" that include a usage
message at the top of the file as:

 - a quick introduction for people who don't like to scroll

 - a variable that can be used from other functions when command-line
   mistakes are noticed late.

I would have gone for the one-liner, myself.

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

From: Thiago Farina <hidden>
Date: 2016-06-15 22:49:27

On Tue, Aug 31, 2010 at 8:42 PM, Jonathan Nieder [off-list ref] wrote:
Junio C Hamano wrote:
quoted
Hmm, why isn't this a single liner
quoted
-            usagef("%s <base>... -- <head> <remote> ...", argv[0]);
+            usagef("git %s <base>... -- <head> <remote> ...", argv[0]);
I can't speak for Thiago, but I assume it's for unity of style with
more complicated commands like "git fetch" that include a usage
message at the top of the file as:

 - a quick introduction for people who don't like to scroll

 - a variable that can be used from other functions when command-line
  mistakes are noticed late.
Precise explanation :-)

Thanks Jonathan.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help