From: Jeff King <peff@peff.net>
To: David Symonds <dsymonds@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Stephan Beyer <s-beyer@gmx.net>
Subject: Re: [PATCH] git-diff: Add --staged as a synonym for --cached.
Date: Wed, 29 Oct 2008 12:42:53 -0400 [thread overview]
Message-ID: <20081029164253.GA3172@sigill.intra.peff.net> (raw)
In-Reply-To: <1225296936-1357-1-git-send-email-dsymonds@gmail.com>
On Wed, Oct 29, 2008 at 09:15:36AM -0700, David Symonds wrote:
> Consider this as a replacement to the previous git-staged series.
I think this is a much more sensible (actual) approach.
> diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
> index c53eba5..a2f192f 100644
> --- a/Documentation/git-diff.txt
> +++ b/Documentation/git-diff.txt
> @@ -33,6 +33,7 @@ forced by --no-index.
> commit relative to the named <commit>. Typically you
> would want comparison with the latest commit, so if you
> do not give <commit>, it defaults to HEAD.
> + --staged is a synonym of --cached.
Hmm. I wonder if it would make it more sense to make the "official" name
--staged, and leave --cached forever as a synonym. If the goal is giving
sane names to end users, then we should probably advertise the sane
ones.
OTOH, maybe it is better to start slow, let people who are doing
training materials mention --staged, and see how that works.
> @@ -118,7 +118,7 @@ static int builtin_diff_index(struct rev_info *revs,
> int cached = 0;
> while (1 < argc) {
> const char *arg = argv[1];
> - if (!strcmp(arg, "--cached"))
> + if (!strcmp(arg, "--cached") || !strcmp(arg, "--staged"))
> cached = 1;
> else
> usage(builtin_diff_usage);
I had to investigate this hunk closely, as it really looks at first
glance (from the function name, and the fact that there are two hunks,
one here and one for cmd_diff) that this is impacting diff-index
--cached, but it's not. We just checked --cached in two different places
inside git-diff (but at least one of them is prefixed by a comment that
includes the world "Eek.").
-Peff
next prev parent reply other threads:[~2008-10-29 16:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 16:15 [PATCH] git-diff: Add --staged as a synonym for --cached David Symonds
2008-10-29 16:42 ` Jeff King [this message]
2008-10-29 16:50 ` David Symonds
2008-10-29 17:06 ` Johannes Schindelin
2008-10-29 17:11 ` Jeff King
2008-11-02 8:30 ` Junio C Hamano
2008-11-03 7:04 ` Jeff King
2008-11-02 12:35 ` Björn Steinbrink
2008-11-02 18:30 ` Junio C Hamano
2008-11-02 18:54 ` Björn Steinbrink
2008-11-03 7:14 ` Jeff King
2008-11-10 23:37 ` David Symonds
2008-11-11 0:15 ` Jeff King
2008-11-11 1:11 ` Junio C Hamano
2008-11-11 1:22 ` Jeff King
2008-11-12 0:57 ` Junio C Hamano
2008-11-11 4:04 ` Avery Pennarun
2008-11-11 5:49 ` Miles Bader
2008-11-12 8:33 ` Jeff King
2008-11-12 11:10 ` Johannes Schindelin
2008-11-12 11:06 ` Jeff King
2008-11-12 15:39 ` Avery Pennarun
2008-11-12 19:15 ` Jeff King
2008-11-12 19:29 ` Junio C Hamano
2008-11-12 19:37 ` Jeff King
2008-11-12 19:57 ` Junio C Hamano
2008-11-12 22:39 ` Avery Pennarun
2008-11-12 23:42 ` Junio C Hamano
2008-11-12 15:46 ` Avery Pennarun
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=20081029164253.GA3172@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=dsymonds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=s-beyer@gmx.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).