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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/7/16 Junio C Hamano <gitster@xxxxxxxxx>:
> Santi Béjar <santi@xxxxxxxxxxx> writes:
>
>>       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.

>
>> +     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.

>
>> +     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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]