git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Kågedal" <davidk@lysator.liu.se>
To: git@vger.kernel.org
Cc: Teemu Likonen <tlikonen@iki.fi>,
	Wincent Colaiuta <win@wincent.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	David Symonds <dsymonds@gmail.com>,
	gitster@pobox.com, Jeff King <peff@peff.net>
Subject: Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
Date: Wed, 29 Oct 2008 21:24:51 +0100	[thread overview]
Message-ID: <87abcnb14c.fsf@krank.kagedal.org> (raw)
In-Reply-To: <878ws7w8xc.fsf@iki.fi>

Teemu Likonen <tlikonen@iki.fi> writes:

> Wincent Colaiuta (2008-10-29 18:42 +0100) wrote:
>
>> El 29/10/2008, a las 18:03, Johannes Schindelin escribió:
>>> I completely disagree. If the existing set of commands causes
>>> confusion, we need to deprecate those parts and add new commands.
>>> Even if we have a ton of commands already.
>>
>> The confusion isn't at the command level; it's at the switch/option
>> level. The solution isn't to add a new command.
>
> I don't remember being confused in particular area but I think it's a
> _very_ good thing that the following three are behind the same "diff"
> command:
>
>     git diff
>     git diff --cached       (or --staged)
>     git diff HEAD

One irregularity hear is that there is no way to explicitly say what
you want to compare against the index (the staging area).  Diff
compares two things to each other, and a more regular and general way
to express what it does would be something like

    git diff STAGE WORKTREE   (like "git diff" today)
    git diff HEAD WORKTREE    (like "git diff HEAD" today)
    git diff WORKTREE HEAD    (like "git diff -R HEAD" today)
    git diff HEAD STAGE       (like "git diff --cached" today)
    git diff commit STAGE     (like "git diff --cached commit" today)

To me, it isn't obvious that --cached changes the thing you *compare*
rather than the thing you compare *against*.  I think it would be
useful to have a way of explicitly stating what you compare, something
like what I wrote above, and then having useful shortcuts for common
cases (like that no arguments compares the work tree against the
stage).

-- 
David Kågedal

  reply	other threads:[~2008-10-29 20:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 23:39 David Symonds
2008-10-28 23:46 ` Jeff King
2008-10-28 23:59 ` David Symonds
2008-10-29  0:39   ` Jeff King
2008-10-29  0:44     ` David Symonds
2008-10-29  1:02       ` Johannes Schindelin
2008-10-29  0:58         ` Jeff King
2008-10-29 10:59       ` Wincent Colaiuta
2008-10-29 15:08         ` Johannes Schindelin
2008-10-29 15:22           ` Stephan Beyer
2008-10-29 15:48             ` Johannes Schindelin
2008-10-29 16:16           ` Wincent Colaiuta
2008-10-29 17:03             ` Johannes Schindelin
2008-10-29 17:13               ` Pascal Obry
2008-10-29 17:42               ` Wincent Colaiuta
2008-10-29 18:30                 ` Teemu Likonen
2008-10-29 20:24                   ` David Kågedal [this message]
2008-10-29 19:23                 ` Johannes Schindelin
2008-10-29 19:44                   ` Wincent Colaiuta
2008-10-29  1:01     ` Stephan Beyer
2008-10-29  1:05       ` Jeff King
2008-10-29 14:33         ` Brandon Casey
2008-10-29 15:19           ` Jeff King
2008-10-29 14:58 ` Pascal Obry
2008-10-29 19:49 ` Felipe Contreras

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=87abcnb14c.fsf@krank.kagedal.org \
    --to=davidk@lysator.liu.se \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dsymonds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=tlikonen@iki.fi \
    --cc=win@wincent.com \
    --subject='Re: [PATCH] Implement git-staged, an alias for '\''git diff --cached'\''.' \
    /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

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