Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH 1/2] t1506: more test for @{upstream} syntax

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:07

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
Using "git show @{-1}@{u}" is still broken, though.

I tried tracing the parsing through get_sha1_basic and
interpret_branch_name, but it's pretty confusing. Especially as we seem
to deal with @{upstream}, @{now}, and @{-1} at different places.

I think the patch below does what we want, but the whole thing feels
overly complicated to me, especially with the split of parsing @{...}
between get_sha1_basic and interpret_branch_name. I guess we have spots
that don't take reflogs but do take branch names, but I think the code
would be much simpler if the syntax were parsed in one place, and then
we threw out or complained about bogus semantics (like "checkout
@{now}").
I wanted to do something like what your patch does by iterating over the
input inside get_sha1_basic() while we still see @{...}, parsing pieces
from the beginning, not from the end like the original "do we have the
reflog indicator at the end?  If so strip it and deal with what we have at
the front".  Your patch to i-b-n does that by recursing inside, which is a
nice solution.

Care to roll a patch with additional tests, to build on top of 105e473
(Fix log -g this@{upstream}, 2010-01-26)?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help