From: "Santi Béjar" <santi@agolina.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] pull: support rebased upstream + fetch + pull --rebase
Date: Thu, 16 Jul 2009 08:29:22 +0200 [thread overview]
Message-ID: <adf1fd3d0907152329v7f49999u42b0d0fc4d39f5e9@mail.gmail.com> (raw)
In-Reply-To: <7vab35cw2e.fsf@alter.siamese.dyndns.org>
2009/7/16 Junio C Hamano <gitster@pobox.com>:
> Santi Béjar <santi@agolina.net> 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
next prev parent reply other threads:[~2009-07-16 6:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 0:09 [PATCH 1/2] t5520-pull: Test for rebased upstream + fetch + pull --rebase Santi Béjar
2009-07-16 0:09 ` [PATCH 2/2] pull: support " Santi Béjar
2009-07-16 0:26 ` Junio C Hamano
2009-07-16 6:29 ` Santi Béjar [this message]
2009-07-16 8:12 ` [PATCHv2 " Santi Béjar
2009-07-16 8:12 ` Santi Béjar
2009-07-16 8:15 ` Santi Béjar
2009-07-16 8:51 ` Johannes Schindelin
2009-07-16 16:32 ` Santi Béjar
2009-07-17 10:13 ` Johannes Schindelin
2009-07-16 20:41 ` Junio C Hamano
2009-07-16 23:18 ` Santi Béjar
2009-07-17 7:51 ` Santi Béjar
2009-07-17 8:25 ` Junio C Hamano
2009-07-17 13:24 ` Santi Béjar
2009-07-18 13:46 ` [PATCHv3 " Santi Béjar
2009-07-18 17:55 ` Junio C Hamano
2009-07-19 7:27 ` Santi Béjar
2009-07-19 7:45 ` [PATCHv4 " Santi Béjar
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=adf1fd3d0907152329v7f49999u42b0d0fc4d39f5e9@mail.gmail.com \
--to=santi@agolina.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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).