From: Junio C Hamano Date: Mon, 25 Jul 2016 21:39:37 GMT Subject: Re: [PATCH v4 01/16] Verify that `git pull --rebase` shows the helpful advice when failing Message-ID: In-Reply-To: <37e2f36e4f982261a741e327f1b534cb67b65149.1469187652.git.johannes.schindelin@gmx.de> Johannes Schindelin writes: > +test_expect_success '--rebase with conflicts shows advice' ' > + test_when_finished "git rebase --abort; git checkout -f to-rebase" && > + git checkout -b seq && > + printf "1\\n2\\n3\\n4\\n5\\n" >seq.txt && Make this more readble by using test-write-lines, perhaps? > + git add seq.txt && > + test_tick && > + git commit -m "Add seq.txt" && > + printf "6\\n" >>seq.txt && > + test_tick && > + git commit -m "Append to seq.txt" seq.txt && > + git checkout -b with-conflicts HEAD^ && > + printf "conflicting\\n" >>seq.txt && > + test_tick && > + git commit -m "Create conflict" seq.txt && > + test_must_fail git pull --rebase . seq 2>err >out && > + grep "When you have resolved this problem" out > +' > +test_expect_success 'failed --rebase shows advice' ' Need a blank line before this one. > + test_when_finished "git rebase --abort; git checkout -f to-rebase" && > + git checkout -b diverging && > + test_commit attributes .gitattributes "* text=auto" attrs && > + sha1="$(printf "1\\r\\n" | git hash-object -w --stdin)" && > + git update-index --cacheinfo 0644 $sha1 file && > + git commit -m v1-with-cr && > + git checkout -f -b fails-to-rebase HEAD^ && It is unclear what the "-f" is for; is it attempting to clean up a potential mess previous steps might have left? We didn't have it in the previous test above. > + test_commit v2-without-cr file "2" file2-lf && > + test_must_fail git pull --rebase . diverging 2>err >out && > + grep "When you have resolved this problem" out > +' > + > test_expect_success '--rebase fails with multiple branches' ' > git reset --hard before-rebase && > test_must_fail git pull --rebase . copy master 2>err && Not worth a reroll but after this series settles we would probably want to address some of the above up with a follow-up clean-up patch.