threads / patch / 25532

patchSync "git diff -h" with the manual, show options summary.

Subject: [PATCH] Sync "git diff -h" with the manual, show options summary.

## tl;dr

6 messages between Oct 23, 2010 and Oct 24, 2010. Diffs are folded; open one to read it.

replies: 5people: 5as markdown or json

Yann Dirson· Oct 23, 2010, 13:33 UTC · lore
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 builtin/diff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to builtin/diff.c +2 −1
diff --git a/builtin/diff.c b/builtin/diff.c
index a43d326..8736225 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -22,7 +22,8 @@ struct blobinfo {
 };
 
 static const char builtin_diff_usage[] =
-"git diff <options> <rev>{0,2} -- <path>*";
+"git diff [<common diff options>] <commit>{0,2} -- <path>*"
+COMMON_DIFF_OPTIONS_HELP;
 
 static void stuff_change(struct diff_options *opt,
 			 unsigned old_mode, unsigned new_mode,
-- 
1.7.2.3
Thiago Farina· Oct 23, 2010, 18:02 UTC · re: Yann Dirson · lore

Re: [PATCH] Sync "git diff -h" with the manual, show options summary.

On Sat, Oct 23, 2010 at 11:33 AM, Yann Dirson <ydirson@altern.org> wrote:
Show 15 quoted lines
> Signed-off-by: Yann Dirson <ydirson@altern.org>
> ---
>  builtin/diff.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/diff.c b/builtin/diff.c
> index a43d326..8736225 100644
> --- a/builtin/diff.c
> +++ b/builtin/diff.c
> @@ -22,7 +22,8 @@ struct blobinfo {
>  };
>
>  static const char builtin_diff_usage[] =
> -"git diff <options> <rev>{0,2} -- <path>*";
> +"git diff [<common diff options>] <commit>{0,2} -- <path>*"
Why change from <options> to <common diff options> ?
Matthieu Moy· Oct 23, 2010, 18:04 UTC · re: Thiago Farina · lore

Re: [PATCH] Sync "git diff -h" with the manual, show options summary.

Thiago Farina <tfransosi@gmail.com> writes:
Show 6 quoted lines
> On Sat, Oct 23, 2010 at 11:33 AM, Yann Dirson <ydirson@altern.org> wrote:
>>  static const char builtin_diff_usage[] =
>> -"git diff <options> <rev>{0,2} -- <path>*";
>> +"git diff [<common diff options>] <commit>{0,2} -- <path>*"
>
> Why change from <options> to <common diff options> ?
Because this is what the man page says I guess.
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Yann Dirson· Oct 23, 2010, 18:44 UTC · re: Matthieu Moy · lore

Re: [PATCH] Sync "git diff -h" with the manual, show options summary.

On Sat, Oct 23, 2010 at 08:04:26PM +0200, Matthieu Moy wrote:
Show 10 quoted lines
> Thiago Farina <tfransosi@gmail.com> writes:
> 
> > On Sat, Oct 23, 2010 at 11:33 AM, Yann Dirson <ydirson@altern.org> wrote:
> >>  static const char builtin_diff_usage[] =
> >> -"git diff <options> <rev>{0,2} -- <path>*";
> >> +"git diff [<common diff options>] <commit>{0,2} -- <path>*"
> >
> > Why change from <options> to <common diff options> ?
> 
> Because this is what the man page says I guess.

Yes, as well as the usage strings for diff-tree, diff-files, and diff-index. "diff" was just the only one to be different here, and if we want to keep "<options>" for conciseness here, we also probably want to change it everywhere (or maybe "<diff options>" for the diff-* commands ?) - after all, this is just a short usage string, not the reference page.

Štěpán Němec· Oct 24, 2010, 15:15 UTC · re: Yann Dirson · lore

Re: [PATCH] Sync "git diff -h" with the manual, show options summary.

Yann Dirson <ydirson@altern.org> writes:
Show 19 quoted lines
> Signed-off-by: Yann Dirson <ydirson@altern.org>
> ---
>  builtin/diff.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/builtin/diff.c b/builtin/diff.c
> index a43d326..8736225 100644
> --- a/builtin/diff.c
> +++ b/builtin/diff.c
> @@ -22,7 +22,8 @@ struct blobinfo {
>  };
>  
>  static const char builtin_diff_usage[] =
> -"git diff <options> <rev>{0,2} -- <path>*";
> +"git diff [<common diff options>] <commit>{0,2} -- <path>*"
> +COMMON_DIFF_OPTIONS_HELP;
>  
>  static void stuff_change(struct diff_options *opt,
>  			 unsigned old_mode, unsigned new_mode,

When at it, could you please also use [<path>...] instead of <path>*? That's what the man pages and other usage strings use.

Štěpán

← back to recent threads