From: Thomas Rast <tr@thomasrast.ch>
To: "Øystein Walle" <oystwa@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] stash: handle specifying stashes with spaces
Date: Fri, 29 Nov 2013 22:33:52 +0100 [thread overview]
Message-ID: <878uw6dha7.fsf@thomasrast.ch> (raw)
In-Reply-To: <1385758845-8627-1-git-send-email-oystwa@gmail.com> ("Øystein Walle"'s message of "Fri, 29 Nov 2013 22:00:45 +0100")
Thanks for looking into this!
Øystein Walle <oystwa@gmail.com> writes:
> - REV=$(git rev-parse --quiet --symbolic --verify $1 2>/dev/null) || {
> + REV=$(git rev-parse --quiet --symbolic --verify "$1" 2>/dev/null) || {
> reference="$1"
It's somewhat ironic that the one place where the original did use
quoting is where it's actually not required.
> - i_commit=$(git rev-parse --quiet --verify $REV^2 2>/dev/null) &&
> - set -- $(git rev-parse $REV $REV^1 $REV: $REV^1: $REV^2: 2>/dev/null) &&
> + i_commit=$(git rev-parse --quiet --verify "$REV^2" 2>/dev/null) &&
> + set -- $(git rev-parse "$REV" "$REV^1" "$REV:" "$REV^1:" "$REV^2:" 2>/dev/null) &&
Thanks for being careful here.
I wonder what we would lose by dropping the --symbolic in the line I
quoted above (which is the second parsing pass), so that it resolves to
a SHA1. We would gain some robustness, as I'm not sure "$REV:" works
correctly in the face of weird revision expressions like ":/foo".
--
Thomas Rast
tr@thomasrast.ch
next prev parent reply other threads:[~2013-11-29 21:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 19:22 [PATCH] stash: handle specifying stashes with spaces Øystein Walle
2013-11-29 19:54 ` Thomas Rast
2013-11-29 21:00 ` [PATCH v2] " Øystein Walle
2013-11-29 21:33 ` Thomas Rast [this message]
2013-11-30 15:29 ` Øystein Walle
2013-12-01 0:41 ` [PATCH] " Eric Sunshine
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=878uw6dha7.fsf@thomasrast.ch \
--to=tr@thomasrast.ch \
--cc=git@vger.kernel.org \
--cc=oystwa@gmail.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.