From: Jonathan Nieder Date: Thu, 04 Nov 2010 18:02:42 GMT Subject: Re: [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings Message-ID: <20101104180242.GA16431@burratino> In-Reply-To: <20101104174917.GA30628@sigill.intra.peff.net> Jeff King wrote: > # diff between index and working tree > git diff [options] [--] [...] > > # diff between HEAD and index > git diff --cached [options] [--] [...] > > # diff between commit and working tree > git diff [options] [--] [...] > > # diff between commit and index > git diff --cached [options] [--] [...] > > # diff between commits > git diff [options] [--] [...] > > # diff two paths > git diff [options] [--] > > which obviously is way more verbose Yes, that's way more verbose than a typical manpage synopsis. For example, from printf(3): SYNOPSIS #include int printf(const char *format, ...); int fprintf(FILE *stream, const char *format, ...); int sprintf(char *str, const char *format, ...); int snprintf(char *str, size_t size, const char *format, ...); #include int vprintf(const char *format, va_list ap); int vfprintf(FILE *stream, const char *format, va_list ap); int vsprintf(char *str, const char *format, va_list ap); int vsnprintf(char *str, size_t size, const char *format, va_list ap); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): snprintf(), vsnprintf(): _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE; or cc -std=c99 which would suggest that for git-diff(!) we should say something like: SYNOPSIS git diff [options] [--] [...] git diff [options] --cached [--] [...] git diff [options] [--] [...] git diff [options] --cached [--] [...] git diff [options] [--] [...] git diff [options] --no-index [--] I would rather treat --cached as one of the options ("instead of comparing the worktree, compare its cached content in the index to the specified commit"), and if I were running the world, I'd leave off the [options]. :) SYNOPSIS git diff [--] [...] git diff [--] [...] git diff [--] [...] git diff --no-index [--] perhaps with some kind of reminder about --cached: The first two forms accept a --cached option to compare to staged content in the index instead of the work tree.