git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: David Aguilar <davvid@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] difftool: add support for an extended revision syntax
Date: Mon, 23 Mar 2009 16:50:59 -0700	[thread overview]
Message-ID: <7v1vsn6boc.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1237803348-9329-1-git-send-email-davvid@gmail.com> (David Aguilar's message of "Mon, 23 Mar 2009 03:15:48 -0700")

David Aguilar <davvid@gmail.com> writes:

> This makes answering that question considerably easier.
> Users can now simply say:
>
> 	$ git difftool <file>~
>
> to compare <file> in the worktree against its
> previous version, and:
>
> 	$ git difftool <file>~2 <file>~
>
> to compare <file> from 2 versions ago to <file>'s
> previous version, etc.

These two examples are not that interesting.  Because you can say:

	$ git log -p -1 file
	$ git log -p -2 file

(admittedly you need to skip the first entry of the output in the latter
one to get to what you are interested in).

What existing syntax does not allow you to say easily is something like:

	$ git difftool <file>~4 <file>

That is, "I do not care about the intermediate states, but want to see the
4 changes consolidated in one".

As I told you in my previous message, I am not convinced a short-and-sweet
notation such as tilde-four is expressive enough for most user's needs (I
suspect most users use git as a fast CVS and have rather linear history,
in which case "Nth commit that changes the file, following only the first
parent chain down from the HEAD" _could_ be a perfectly fine and useful
semantics), but if it is, I think it would not be too involved to patch
revision.c::handle_revision_arg() to make it available to everybody.

> This makes the following statements equivalent:
>
> 	$ git difftool !
> 	$ git difftool HEAD!
> 	$ git difftool HEAD~ HEAD

Which would be:

	$ git log -p -1 file

right?

Perhaps we would want a convenient way for "log -p" or "show -p" to drive
difftool as a backend?

  parent reply	other threads:[~2009-03-23 23:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 10:15 [PATCH] difftool: add support for an extended revision syntax David Aguilar
2009-03-23 14:51 ` Michael J Gruber
2009-03-23 16:33   ` David Aguilar
2009-03-23 16:46     ` Michael J Gruber
2009-03-23 23:22     ` Junio C Hamano
2009-03-23 23:33       ` David Aguilar
2009-03-23 23:50 ` Junio C Hamano [this message]
2009-03-27 15:59 ` Jakub Narebski
2009-03-27 16:28   ` David Aguilar
2009-03-27 17:21     ` Junio C Hamano
2009-03-27 18:16       ` David Aguilar
2009-03-27 17:36     ` Junio C Hamano

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=7v1vsn6boc.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    /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).