Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Re: [PATCH 2/2] pull: support rebased upstream + fetch + pull --rebase

From: Santi Béjar <hidden>
Date: 2016-06-15 22:47:03

Possibly related (same subject, not in this thread)

2009/7/16 Junio C Hamano [off-list ref]:
Santi Béjar [off-list ref] writes:
quoted
      reflist="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
-     oldremoteref="$(git rev-parse -q --verify \
-             "$reflist")"
+     num=0 &&
+     while oldremoteref="$(git rev-parse -q --verify "$reflist@{$num}")"
Applying @{nth} reflog notation to something that identifies itself as a
"list" made me go "Huh?".  Why is this variable called refLIST?  Shouldn't
it be simply called something like "remoteref" or even "ref"?
It used to be a list, before my patch 97af7ff (parse-remote: function
to get the tracking branch to be merge, 2009-06-12). I'll change it.
quoted
+     do
+             test $oldremoteref = $(git merge-base $oldremoteref $curr_branch) &&
+             break
+             num=$((num+1))
I think we always write "num=$(( $num + 1 ))" for portability; notice the
lack of $ in your version.
Oops, you are right. I somehow missed, I even did "git grep "((" *.sh"
to check it.
quoted
+     done
Does this loop ever give up?  Should it?
When remote/$origin/$branch@{nth} does not exist. I don't think we
need another way to give up (nth<10?) because normally nth is small,
it does not harm the normal case and it can help when nth is large.
What happens in the subsequent code outside of the patch context, when
this loop does not find any suitable "old" value?
Then the $oldremoteref is empty and in the git-rebase command it is
used as ${oldremoteref:-$merge_head} so it get replaced by
$merge_head.

Thanks,
Santi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help