Re: Support of '^' as alias for 'HEAD^'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 15, 2012 at 01:24:18AM +0300, Zeeshan Ali (Khattak) wrote:

> > Think what "log ^^ origin" would mean.  Is it "log ^HEAD^ origin"?
> > Is it "log HEAD^^ origin"?  They mean totally different things.
> 
> Sorry for my ignorance here but what does ^ *before* HEAD even mean? I

It means "not" (before "HEAD" or any other commit specifier). See
"Specifying Ranges" in "git help revisions".

> > Compared to that, at least ~<n> does not have such ambiguity within
> > the context of Git (having to quote is an ambiguity within the
> > context of using Git with shells that support dirstacks in their
> > tilde expansion).
> 
> Don't know whats dirstacks support either but that I guess just means
> that bash (the shell I have always used) doesn't do that.

Bash does support them, but you may not use them personally. Here are
some examples of how a more bare "~" can go wrong:

  $ set -x
  [this instructs the shell to show us what it is executing]

  $ git log ~
  + git log /home/peff
  [oops, the shell expanded our home directory and passed it to git]

  $ git log ~1
  + git log '~1'
  [this one works ok, but...]

  $ pushd /tmp
  $ pushd $HOME
  $ git log ~1
  + git log /tmp
  [oops, pushd users cannot use ~<n> without quoting]

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]