From: Junio C Hamano Date: Mon, 23 Mar 2009 23:50:59 GMT Subject: Re: [PATCH] difftool: add support for an extended revision syntax Message-ID: <7v1vsn6boc.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1237803348-9329-1-git-send-email-davvid@gmail.com> David Aguilar writes: > This makes answering that question considerably easier. > Users can now simply say: > > $ git difftool ~ > > to compare in the worktree against its > previous version, and: > > $ git difftool ~2 ~ > > to compare from 2 versions ago to '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 ~4 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?