git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <santi@agolina.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv2 2/3] parse-remote: support default reflist in  get_remote_merge_branch
Date: Sun, 7 Jun 2009 20:02:05 +0200	[thread overview]
Message-ID: <adf1fd3d0906071102v9c15517v8e7b41a6638a52bb@mail.gmail.com> (raw)
In-Reply-To: <7vljo49e08.fsf@alter.siamese.dyndns.org>

2009/6/7 Junio C Hamano <gitster@pobox.com>:
> Santi Béjar <santi@agolina.net> writes:
>
>> Expand get_remote_merge_branch to compute the tracking branch to merge
>> when called without arguments (or only the remote name). This allows
>> "git pull --rebase" without arguments (default upstream branch) to
>> work with a rebased upstream.
>
> The last sentence leaves readers wondering...  "Ok, with this patch, X
> without Y now works.  What about X _with_ Y?  Is it left unfixed?  Was it
> already working before this patch?  What is going on???"

No changes in the "with Y" case, so working.

Maybe add the sentence "( with explicit arguments it already worked)".

>
>> Also add a test to check for this case and another one (failing) to
>> test rebasing two branches on top of a rebased upstream using just
>> 'git pull --rebase'.
>
> "test doing X using just Y" _sounds as if_ you are implying
>
>        Doing X using Z (that is more cumbersome to type than Y) works but
>        doing X using Y (that ought to be the equivalent to Z) does not.
>        Let's expose this inconsistent breakage.
>
> without saying what Z is, and/or why Y is preferred.  So if that is what
> is going on, please spell these out.

If you have two branches tracking an upstream that is rebased,
currently you have to do:

git checkout branch1
git pull --rebase remote branch
git checkout branch2
git pull --rebase remote branch

The second rebase works because the first "git pull --rebase" does not
store in the local tracking branch the new value, so the second rebase
detects that it is rebased.

I think one should be able to do the same without the explicit
arguments to "git pull --rebase", but without arguments it stores the
new state of the remote branch so the second "git pull --rebase" does
not work.

I just wanted to single out that it does not currently works.

I see two solutions for this: 1) declare that it is not going to work
and to do it you have to do the explicit invocation or 2) examine the
reflog of the remote tracking branch.

> If that is not the case please drop "just"; it is confusing.

I'll add some of this explanation to the commit message, and keep the
"just" (they should be equivalent, but are not).

>
>> +test_expect_success '--rebase with rebased default upstream' '
>> +
>> +     git update-ref refs/remotes/me/copy copy-orig &&
>> +     git checkout --track -b to-rebase2 me/copy &&
>> +     git reset --hard to-rebase-orig &&
>> +     git pull --rebase &&
>> +     test "conflicting modification" = "$(cat file)" &&
>> +     test file = $(cat file2)
>> +
>> +'
>> +
>> +test_expect_failure '--rebase with rebased upstream and two branches' '
>> +
>> +     git update-ref refs/remotes/me/copy copy-orig &&
>> +     git reset --hard to-rebase-orig &&
>> +     git checkout --track -b to-rebase3 me/copy &&
>> +     git reset --hard to-rebase-orig &&
>> +     git pull --rebase &&
>> +     test "conflicting modification" = "$(cat file)" &&
>> +     test file = $(cat file2) &&
>> +     git checkout to-rebase2 &&
>> +     git pull --rebase me copy
>> +
>> +'
>> +
>>  test_expect_success 'pull --rebase dies early with dirty working directory' '
>>
>> +     git rebase --abort &&
>> +     git checkout to-rebase &&
>
> Hmm, saying "--abort" when rebase is not in progress

The rebase is in progress (the last test failed)

> (i.e. after your next
> patch fixes the above "expect_failure" to pass) does not error out?  It is
> not very nice...

My next patch does not fix the expect_failure, I only wanted to make
this behavior explicit. But if at the end this is the prefered
behavior (fail rebasing two branches with a rebased upstream) I'll
drop this test.

Santi

      reply	other threads:[~2009-06-07 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-07  9:44 [PATCHv2 2/3] parse-remote: support default reflist in get_remote_merge_branch Santi Béjar
2009-06-07 16:59 ` Junio C Hamano
2009-06-07 18:02   ` Santi Béjar [this message]

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=adf1fd3d0906071102v9c15517v8e7b41a6638a52bb@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).