From: "Santi Béjar" <santi@agolina.net>
To: git@vger.kernel.org
Subject: [PATCHv4 3/4] t5520-pull: --rebase with rebased upstream and two branches
Date: Fri, 12 Jun 2009 00:39:20 +0200 [thread overview]
Message-ID: <1244759961-4750-4-git-send-email-santi@agolina.net> (raw)
In-Reply-To: <1244759961-4750-1-git-send-email-santi@agolina.net>
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.
Mark this case as test_expect_failure to make people aware of this
behavior.
Signed-off-by: Santi Béjar <santi@agolina.net>
---
Changes since v3:
- Move the "git rebase --abort" to the failing test to not polute the
next test.
Hi,
I just wanted to make people aware of this behavior and then decide if
this is the correct behavior. Then we can document it, or try to find a better
solution.
Santi
t/t5520-pull.sh | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index c5a2e66..a4ac6d2 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -117,6 +117,23 @@ test_expect_success '--rebase with rebased default upstream' '
'
+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 &&
+ test_must_fail git pull --rebase &&
+ git rebase --abort &&
+ test "conflicting modification" = "$(cat file)" &&
+ test file = $(cat file2)
+
+'
+
test_expect_success 'pull --rebase dies early with dirty working directory' '
git checkout to-rebase &&
--
1.6.3.2.206.g417f7
next prev parent reply other threads:[~2009-06-11 22:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 22:39 [PATCHv4 0/4] git pull --rebase fixes and cleanup Santi Béjar
2009-06-11 22:39 ` [PATCHv4 1/4] parse-remote: function to get the tracking branch to be merge Santi Béjar
2009-06-11 22:39 ` [PATCHv4 2/4] parse-remote: support default reflist in get_remote_merge_branch Santi Béjar
2009-06-12 3:09 ` Junio C Hamano
2009-06-12 6:58 ` Santi Béjar
2009-06-11 22:39 ` Santi Béjar [this message]
2009-06-11 23:19 ` [PATCHv4 3/4] t5520-pull: --rebase with rebased upstream and two branches Junio C Hamano
2009-06-12 2:57 ` Junio C Hamano
2009-06-11 22:39 ` [PATCHv4 4/4] parse-remote: remove unused functions 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=1244759961-4750-4-git-send-email-santi@agolina.net \
--to=santi@agolina.net \
--cc=git@vger.kernel.org \
/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).