git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] difftool: add support for an extended revision syntax
Date: Mon, 23 Mar 2009 09:33:44 -0700	[thread overview]
Message-ID: <20090323163343.GB16258@gmail.com> (raw)
In-Reply-To: <49C7A20E.7060503@drmicha.warpmail.net>

On  0, Michael J Gruber <git@drmicha.warpmail.net> wrote:
> David Aguilar venit, vidit, dixit 23.03.2009 11:15:
> > 
> > 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.
> > 
> 
> I like the idea of having a shortcut like that a lot, but I'm sorry I'm
> not supportive of a tool-specific rev syntax extension; for principal
> reasons, but also because diff, checkout and maybe others could make
> good use of it.

I completely agree.  I want a convenient shortcut to use everywhere.


> Work is underway on clearing out the issue of forbidden characters in
> revision specifiers. We already have commit:file. I think something like
> ~2:file would be short enough as well as in line with the usual
> semantics. Similarly,
> 
> git diff ~3 ~2 file
> git diff ~3 file
> 
> would be short and simple as soon as ~3 is implemented to be a shortcut
> for HEAD~3. (I'm not sure we can actually use ~, even though it would
> fit in with the usual "if it's not specified it's HEAD".) This would
> only need a shortcut for HEAD, such as not even specifying it (as above)
> or c~ with c being our new fancy character for that.


One of my ulterior motives for sending this patch was to
start a discussion on this topic.  I missed the discussion
about clearing out forbidden characters so I'll see if I can
find it in the archives.  Do you happen to have a link?

Keep in mind that the syntax that this patch added does
not have file~3 = HEAD~3.  file~3 means finding file as it
existed 3 changes-to-file ago, which is != to HEAD~3 if file
did not change in the last 3 commits.

It basically runs 'git log -- file' so that only the commits
that touch file are considered.

Are you suggesting that ~3:file could be the shortcut for
this, or would we need a different syntax since you just
said that ~3 would be a shortcut for HEAD~3?

If there's work on syntax-sugarfying diff/checkout/etc. with
these kind of shortcuts then I would like to help out with
patches, testing, etc.

This is a feature that lots of users would enjoy--I know that
for sure.

-- 

	David

  reply	other threads:[~2009-03-23 16:35 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 [this message]
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
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=20090323163343.GB16258@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 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).