From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "Štěpán Němec" <stepnem@gmail.com>,
git@vger.kernel.org, "Sverre Rabbelier" <srabbelier@gmail.com>,
"Mark Lodato" <lodatom@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings
Date: Thu, 4 Nov 2010 13:02:42 -0500 [thread overview]
Message-ID: <20101104180242.GA16431@burratino> (raw)
In-Reply-To: <20101104174917.GA30628@sigill.intra.peff.net>
Jeff King wrote:
> # diff between index and working tree
> git diff [options] [--] [<path>...]
>
> # diff between HEAD and index
> git diff --cached [options] [--] [<path>...]
>
> # diff between commit and working tree
> git diff [options] <commit> [--] [<path>...]
>
> # diff between commit and index
> git diff --cached [options] <commit> [--] [<path>...]
>
> # diff between commits
> git diff [options] <commit> <commit> [--] [<path>...]
>
> # diff two paths
> git diff [options] [--] <path> <path>
>
> which obviously is way more verbose
Yes, that's way more verbose than a typical manpage synopsis.
For example, from printf(3):
SYNOPSIS
#include <stdio.h>
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 <stdarg.h>
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] [--] [<path>...]
git diff [options] --cached [--] [<path>...]
git diff [options] <commit> [--] [<path>...]
git diff [options] --cached <commit> [--] [<path>...]
git diff [options] <commit> <commit> [--] [<path>...]
git diff [options] --no-index [--] <path> <path>
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 [--] [<path>...]
git diff <commit> [--] [<path>...]
git diff <commit> <commit> [--] [<path>...]
git diff --no-index [--] <path> <path>
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.
next prev parent reply other threads:[~2010-11-04 18:03 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 0:52 [PATCH/RFC] Unify argument and option notation in the docs Štěpán Němec
2010-10-08 7:43 ` Jonathan Nieder
2010-10-08 11:13 ` Štěpán Němec
2010-10-08 17:31 ` [PATCH 0/6] " Štěpán Němec
2010-10-08 17:44 ` Jonathan Nieder
2010-10-08 19:43 ` Junio C Hamano
2010-10-08 20:15 ` Štěpán Němec
2010-10-21 22:21 ` Jonathan Nieder
2010-10-24 15:51 ` [PATCH] CodingGuidelines: Add a section on writing documentation Štěpán Němec
2010-10-29 2:56 ` Mark Lodato
2010-10-29 11:54 ` Štěpán Němec
2010-10-29 17:14 ` Sverre Rabbelier
2010-11-01 17:00 ` Štěpán Němec
2010-11-04 17:12 ` [PATCH v2] " Štěpán Němec
2010-11-04 17:18 ` [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings Štěpán Němec
2010-11-04 17:22 ` Sverre Rabbelier
2010-11-04 17:49 ` Jeff King
2010-11-04 18:02 ` Jonathan Nieder [this message]
2010-11-04 18:13 ` Jeff King
2010-11-04 18:38 ` Jonathan Nieder
2010-11-04 18:55 ` Jeff King
2010-11-04 20:26 ` Štěpán Němec
2010-11-04 20:43 ` Jeff King
2010-11-04 21:17 ` [PATCH] docs: clarify git diff modes of operation Jeff King
2010-11-04 21:50 ` Jonathan Nieder
2010-11-05 1:57 ` Mark Lodato
2010-11-04 21:51 ` Štěpán Němec
2010-11-04 21:30 ` [PATCH] diff,difftool: Don't use the {0,2} notation in usage strings Štěpán Němec
2010-10-08 17:31 ` [PATCH 1/6] Use angles for placeholders consistently Štěpán Němec
2010-10-08 17:31 ` [PATCH 2/6] Fix odd markup in --diff-filter documentation Štěpán Němec
2010-10-08 17:39 ` Jonathan Nieder
2010-10-08 17:57 ` Štěpán Němec
2010-10-08 18:03 ` Jonathan Nieder
2010-10-08 18:40 ` Štěpán Němec
2010-10-08 18:53 ` Jonathan Nieder
2010-10-08 17:31 ` [PATCH 3/6] Use parentheses and `...' where appropriate Štěpán Němec
2010-10-08 17:31 ` [PATCH 4/6] Remove stray quotes in --pretty and --format documentation Štěpán Němec
2010-10-08 17:31 ` [PATCH 5/6] Put a space between `<' and argument in pack-objects usage string Štěpán Němec
2010-10-08 17:31 ` [PATCH 6/6] Fix {update,checkout}-index usage strings Štěpán Němec
2010-10-08 16:45 ` [PATCH 0/2] pack-objects: use ALLOC_GROW in place of manual growth Jonathan Nieder
2010-10-08 16:46 ` [PATCH 1/2] Documentation: No argument of ALLOC_GROW should have side-effects Jonathan Nieder
2010-10-08 16:47 ` [PATCH 2/2] pack-objects: use ALLOC_GROW Jonathan Nieder
2010-10-08 17:02 ` [PATCH 3/2] Allow side-effects in second argument to ALLOC_GROW Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101104180242.GA16431@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=lodatom@gmail.com \
--cc=peff@peff.net \
--cc=srabbelier@gmail.com \
--cc=stepnem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.