git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Stefan Näwe" <stefan.naewe@gmail.com>,
	git@vger.kernel.org
Subject: Re: Support of '^' as alias for 'HEAD^'
Date: Sun, 15 Jul 2012 03:44:42 -0400	[thread overview]
Message-ID: <20120715074441.GA18385@sigill.intra.peff.net> (raw)
In-Reply-To: <CAAa3hFMNf_wA22ngypSu379jr31r3L3yAjTkvDUd_L-mVwPJkA@mail.gmail.com>

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

  reply	other threads:[~2012-07-15  7:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14  0:39 Support of '^' as alias for 'HEAD^' Zeeshan Ali (Khattak)
2012-07-14  9:48 ` Stefan Näwe
2012-07-14 20:17   ` Junio C Hamano
2012-07-14 20:34     ` Junio C Hamano
2012-07-14 20:49       ` Zeeshan Ali (Khattak)
2012-07-14 21:26         ` Junio C Hamano
2012-07-14 22:24           ` Zeeshan Ali (Khattak)
2012-07-15  7:44             ` Jeff King [this message]
2012-07-15 17:45             ` Holger Hellmuth
2012-07-15 21:48               ` Zeeshan Ali (Khattak)

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=20120715074441.GA18385@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stefan.naewe@gmail.com \
    --cc=zeeshanak@gnome.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).