From: "Øystein Walle" <oystwa@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH v2] stash: handle specifying stashes with spaces
Date: Sat, 30 Nov 2013 15:29:57 +0000 (UTC) [thread overview]
Message-ID: <loom.20131130T153012-412@post.gmane.org> (raw)
In-Reply-To: 878uw6dha7.fsf@thomasrast.ch
Thomas Rast <tr <at> thomasrast.ch> writes:
> 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".
If I drop --symbolic then all hell breaks loose. Removing it very
naively led to 29 failed tests. I managed to get that down quite a bit
though.
After the function ends $REV is supposed to expand to a symbolic
reference, and the test for whether the given argument is a valid stash
reference is to see if running `git rev-parse --symbolic-full-name
"${REV%@*}"` expands to 'refs/stash' or not. So we have to do both with
and without --symbolic and keep both around. For example `git stash
drop` had problems because git-reflog doesn't let you remove entries in
the log by SHA1:
$ git reflog delete --updateref --rewrite $(git rev-parse stash@{0})
error: Not a reflog: 418af27beea220ad8a2fd3b8286959b1ec9c8852
I think a not entirely accurate but succinct way of putting it is that
if foo is a valid ref or valid entry in the reflog then
git rev-parse --symbolic $(git rev-parse foo)
does *not* output 'foo' but the SHA1 of 'foo'. So we cannot simply
convert everything to hashes and proceed from there.
Øsse
next prev parent reply other threads:[~2013-11-30 15:30 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
2013-11-30 15:29 ` Øystein Walle [this message]
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=loom.20131130T153012-412@post.gmane.org \
--to=oystwa@gmail.com \
--cc=git@vger.kernel.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).