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

6 messages from 2010-10-23 to 2010-10-24. Participants: Yann Dirson, Thiago Farina, Matthieu Moy, Štěpán Němec.
Thread: https://gitlist.dev/t/25532

## Yann Dirson, 2010-10-23 13:33

Subject: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <1287840825-6491-1-git-send-email-ydirson@altern.org>
URL: https://gitlist.dev/e/1287840825-6491-1-git-send-email-ydirson%40altern.org

```
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,
-- 
1.7.2.3

```

## Yann Dirson, 2010-10-23 14:07

Subject: Re: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <20101023140755.GO4983@home.lan>
URL: https://gitlist.dev/e/20101023140755.GO4983%40home.lan
In-Reply-To: <1287840825-6491-1-git-send-email-ydirson@altern.org>

```
Hm, looks like I had sent those two small patches already, although
they got not feedback.

-- 
Yann

```

## Thiago Farina, 2010-10-23 18:02

Subject: Re: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <AANLkTi=kETrjKccdVo188mKjX59mWeCRLVwGpiVP-oQ1@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DkETrjKccdVo188mKjX59mWeCRLVwGpiVP-oQ1%40mail.gmail.com
In-Reply-To: <1287840825-6491-1-git-send-email-ydirson@altern.org>

```
On Sat, Oct 23, 2010 at 11:33 AM, Yann Dirson <ydirson@altern.org> wrote:
> 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, 2010-10-23 18:04

Subject: Re: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <vpqvd4sn5ud.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqvd4sn5ud.fsf%40bauges.imag.fr
In-Reply-To: <AANLkTi=kETrjKccdVo188mKjX59mWeCRLVwGpiVP-oQ1@mail.gmail.com>

```
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.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Yann Dirson, 2010-10-23 18:44

Subject: Re: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <20101023184425.GP4983@home.lan>
URL: https://gitlist.dev/e/20101023184425.GP4983%40home.lan
In-Reply-To: <vpqvd4sn5ud.fsf@bauges.imag.fr>

```
On Sat, Oct 23, 2010 at 08:04:26PM +0200, Matthieu Moy wrote:
> 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, 2010-10-24 15:15

Subject: Re: [PATCH] Sync "git diff -h" with the manual, show options summary.
Message-ID: <87tykbpqpu.fsf@gmail.com>
URL: https://gitlist.dev/e/87tykbpqpu.fsf%40gmail.com
In-Reply-To: <1287840825-6491-1-git-send-email-ydirson@altern.org>

```
Yann Dirson <ydirson@altern.org> writes:

> 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

```
