From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: Itches with the current rev spec
Date: Thu, 25 Apr 2013 10:22:46 +0200 [thread overview]
Message-ID: <vpqehdzkoix.fsf@grenoble-inp.fr> (raw)
In-Reply-To: <CALkWK0n97VLtiR96VEy86645NVoDL2rS-g7LBuLb=JpncdH6VA@mail.gmail.com> (Ramkumar Ramachandra's message of "Thu, 25 Apr 2013 10:37:16 +0530")
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Hi,
>
> So, I have three serious itches that would be nice to address:
>
> 1. git reset --hard HEAD~1/ git show HEAD~1 is a very common idiom
> that's unnecessarily cumbersome to type out. We can make the <rev>
> part of <rev>~<n> optional without being ambiguous: you might argue
> that ~<n> normally refers to a /home/<n>, but who uses numbers in
> place of usernames? Even if they do, how can that path possibly be
> inside our repository?
It's a bit more complex than that: the ~<username> is expanded by the
shell, before Git has any opportunity to guess anything.
~1 would be unusable for zsh users and tcsh users at least by default:
zsh% echo ~1
zsh: not enough directory stack entries.
tcsh% echo ~1
Unknown user: 1.
(An obvious workaround is to shell-quote it, but as the goal is to have
something easy to type, \~1 or '~1' do not give so much benefit over
HEAD~1)
That said, it seems to work fine for bash (even if the number is a PID,
it's not expanded), so it may be a good idea to add it as a shortcut,
with a warning in the doc about shell expansion.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2013-04-25 8:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 5:07 Itches with the current rev spec Ramkumar Ramachandra
2013-04-25 5:54 ` Ramkumar Ramachandra
2013-04-25 8:22 ` Matthieu Moy [this message]
2013-04-25 8:48 ` Felipe Contreras
2013-04-25 11:06 ` Ramkumar Ramachandra
2013-04-29 14:00 ` Michael J Gruber
2013-04-25 9:09 ` Andreas Schwab
2013-04-25 9:13 ` Ramkumar Ramachandra
2013-04-25 19:08 ` Phil Hord
2013-04-26 8:19 ` Yann Dirson
2013-04-26 8:43 ` Johannes Sixt
2013-04-26 12:33 ` Ramkumar Ramachandra
2013-04-26 17:49 ` Junio C Hamano
2013-04-26 19:48 ` Felipe Contreras
2013-04-26 21:13 ` Junio C Hamano
2013-04-29 15:08 ` Ramkumar Ramachandra
2013-04-29 15:37 ` Yann Dirson
2013-04-29 16:05 ` Junio C Hamano
2013-04-29 17:14 ` Ramkumar Ramachandra
2013-04-29 17:33 ` Junio C Hamano
2013-04-29 19:10 ` Ramkumar Ramachandra
2013-04-29 19:23 ` Ramkumar Ramachandra
2013-04-30 4:02 ` Junio C Hamano
2013-04-29 15:20 ` Ramkumar Ramachandra
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=vpqehdzkoix.fsf@grenoble-inp.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=artagnon@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.