From: Junio C Hamano <hidden> Date: 2016-06-15 22:54:15
"Zeeshan Ali (Khattak)" [off-list ref] writes:
What about '^' and '^^' that I suggested?
quoted
quoted
While I see your "~<N>" much distasteful compared to "^", you still
s/dist/less dist/; sorry ;-)
Why?
That "^^" is the most important reason why your "^ is the same as
HEAD^" is flawed, and goes against my taste.
Think what "log ^^ origin" would mean. Is it "log ^HEAD^ origin"?
Is it "log HEAD^^ origin"? They mean totally different things.
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).
From: Zeeshan Ali (Khattak) <hidden> Date: 2016-06-15 22:54:15
On Sun, Jul 15, 2012 at 12:26 AM, Junio C Hamano [off-list ref] wrote:
"Zeeshan Ali (Khattak)" [off-list ref] writes:
quoted
What about '^' and '^^' that I suggested?
quoted
quoted
While I see your "~<N>" much distasteful compared to "^", you still
s/dist/less dist/; sorry ;-)
Why?
That "^^" is the most important reason why your "^ is the same as
HEAD^" is flawed, and goes against my taste.
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
tried playing with different combinations of ^ and HEAD here (e.g
^HEAD^, ^HEAD^^, ^HEAD^^^) with both log and show commands but git
just silently returns on them. Is this ^ before HEAD actually used
cause I have never seen/heard of that before. Google isn't able to
help either.
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.
--
Regards,
Zeeshan Ali (Khattak)
FSF member#5124
From: Jeff King <hidden> Date: 2016-06-15 22:54:15
On Sun, Jul 15, 2012 at 01:24:18AM +0300, Zeeshan Ali (Khattak) wrote:
quoted
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".
quoted
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
Am 15.07.2012 00:24, schrieb Zeeshan Ali (Khattak):
On Sun, Jul 15, 2012 at 12:26 AM, Junio C Hamano[off-list ref] wrote:
quoted
"Zeeshan Ali (Khattak)"[off-list ref] writes:
quoted
What about '^' and '^^' that I suggested?
If you want a shortcut, you might try this:
echo "ref: HEAD" > .git/h
Then you can use 'h' instead of 'HEAD'.
Tested it and it seemed to work. If not someone on this list surely will
correct me.
From: Zeeshan Ali (Khattak) <hidden> Date: 2016-06-15 22:54:15
On Sun, Jul 15, 2012 at 8:45 PM, Holger Hellmuth [off-list ref] wrote:
Am 15.07.2012 00:24, schrieb Zeeshan Ali (Khattak):
quoted
On Sun, Jul 15, 2012 at 12:26 AM, Junio C Hamano[off-list ref]
wrote:
quoted
"Zeeshan Ali (Khattak)"[off-list ref] writes:
quoted
What about '^' and '^^' that I suggested?
If you want a shortcut, you might try this:
echo "ref: HEAD" > .git/h
Then you can use 'h' instead of 'HEAD'.
Tested it and it seemed to work. If not someone on this list surely will
correct me.
Thanks, was hoping to have something thats supported out of the box in
future git but I guess I can settle for a local hack too. :)
--
Regards,
Zeeshan Ali (Khattak)
FSF member#5124