{"thread":{"id":"27239","subject":"[PATCH RFC] Test for apparent regression of merging renamed files","startedAt":"2011-05-02T19:04:24Z","lastAt":"2011-05-04T02:18:40Z","messageCount":3,"participants":["Ciaran","Elijah Newren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"166894","messageId":"BANLkTimcRbuYzSp+MM-vsvxoWhAS8Jvo8Q@mail.gmail.com","threadId":"27239","inReplyTo":null,"subject":"[PATCH RFC] Test for apparent regression of merging renamed files","fromName":"Ciaran","fromEmail":"ciaranj@gmail.com","sentAt":"2011-05-02T19:04:24Z","receivedAt":"2011-05-02T19:04:24Z","isPatch":true,"sender":{"key":"ciaranj@gmail.com","avatar":"https://avatars.githubusercontent.com/u/55368?v=4"},"body":"Provides a test to cover a case that appears to have been regressed out by:\n\n b2c8c0a762745768e8fb249949801c1aed8f7c1d\n\nAt this point no tags contain the above commit, but 'master' does.  I'm unsure\nwhat is causing the issue, but can see discussion about this fix here:\n\nhttp://git.661346.n2.nabble.com/BUG-merge-recursive-triggered-quot-BUG-quot-td6179353.html\n\nProviding a patch to demonstrate the issue and spark discussion.\n---\nWhilst working up a patch for my 'whitespace ignorant rename\ndetection' ( http://git.661346.n2.nabble.com/PATCH-RFC-Rename-detection-and-whitespace-td6288524.html\n) I was unable to get my tests working, turns out that something that\nused to work for me, no longer does in master's HEAD.\n\nI don't really understand the fault so I'm throwing it to the list in\nthe hope that someone brighter than me can take it on (I've\nCC'd the signoff-s to that end! :) Sorry!\n\n t/t9801-merge-rename.sh |   41 +++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 41 insertions(+), 0 deletions(-)\n create mode 100755 t/t9801-merge-rename.sh\n\ndiff --git a/t/t9801-merge-rename.sh b/t/t9801-merge-rename.sh\nnew file mode 100755\nindex 0000000..363911f\n--- /dev/null\n+++ b/t/t9801-merge-rename.sh\n@@ -0,0 +1,41 @@\n+#!/bin/sh\n+\n+test_description='Test for rename merge regression'\n+\n+. ./test-lib.sh\n+\n+write_out_files() {\n+cat > noformatting.txt << EOF\n+if(true){\n+// Meaningless\n+}\n+EOF\n+\n+cat > formatting.txt << EOF\n+\tif ( true ) {\n+\t  // Meaningless\n+\t}\n+EOF\n+}\n+\n+# Test the case where a rename happens in one branch and\n+# a whitespace change occurs in a different branch.  The rename\n+# change should apply to the whitespace modified file\n+test_expect_success setup '\n+\twrite_out_files &&\n+\tgit add formatting.txt &&\n+\n+\ttest_tick &&\n+\tgit commit -m Initial &&\n+\tgit checkout -b rename_branch &&\n+\tgit mv formatting.txt formatting_renamed.txt &&\n+\tgit commit -m Rename &&\n+\tgit checkout master &&\n+\trm formatting.txt &&\n+\tmv noformatting.txt formatting.txt &&\n+\tgit commit -a -m Reformat\n+'\n+test_expect_success 'merge' '\n+\tgit merge rename_branch\n+'\n+test_done\n-- \n1.7.4.1\n"},{"id":"166961","messageId":"BANLkTin6u8e4-x99JgN-D7FFJbO7pXVp-Q@mail.gmail.com","threadId":"27239","inReplyTo":"BANLkTimcRbuYzSp+MM-vsvxoWhAS8Jvo8Q@mail.gmail.com","subject":"Re: [PATCH RFC] Test for apparent regression of merging renamed files","fromName":"Ciaran","fromEmail":"ciaranj@gmail.com","sentAt":"2011-05-03T19:15:33Z","receivedAt":"2011-05-03T19:15:33Z","isPatch":true,"sender":{"key":"ciaranj@gmail.com","avatar":"https://avatars.githubusercontent.com/u/55368?v=4"},"body":"On Mon, May 2, 2011 at 8:04 PM, Ciaran <ciaranj@gmail.com> wrote:\n> Provides a test to cover a case that appears to have been regressed out by:\n>\n>  b2c8c0a762745768e8fb249949801c1aed8f7c1d\n>\n> At this point no tags contain the above commit, but 'master' does.  I'm unsure\n> what is causing the issue, but can see discussion about this fix here:\n>\n> http://git.661346.n2.nabble.com/BUG-merge-recursive-triggered-quot-BUG-quot-td6179353.html\n>\n> Providing a patch to demonstrate the issue and spark discussion.\n\nHmm I think with hindsight I should've been clearer ;)   The current\nmaster branch appears to contain a break in it, seemingly introduced\nby commit b2c8c0a . The rename & merge situation given in the\nassociated test results in output from git status such as :\n\n$ git status\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#\tdeleted:    formatting.txt\n#\n# Unmerged paths:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#   (use \"git add/rm <file>...\" as appropriate to mark resolution)\n#\n#\tboth modified:      formatting_renamed.txt\n#\n\nWhereas prior to b2c8c0a762745768e8fb249949801c1aed8f7c1d (for example\n@ d98a509ec3e9ff22bb642f778900691d0c715ba9 ) the status was:\n\n# On branch master\nnothing to commit (working directory clean)\n\nAnd git log --oneline -1 says :\n\ne03ad75 Merge branch 'rename_branch'\n\nThe original behaviour (successful merge) seems 'better' than the\ncurrent behaviour 'failed merge, 'erroneous' both modified flag' ...\nam I mis-reading this, is this a new non-supported edge case ?\n\nCheers!\n -cJ.\n\n\n\n> ---\n> Whilst working up a patch for my 'whitespace ignorant rename\n> detection' ( http://git.661346.n2.nabble.com/PATCH-RFC-Rename-detection-and-whitespace-td6288524.html\n> ) I was unable to get my tests working, turns out that something that\n> used to work for me, no longer does in master's HEAD.\n>\n> I don't really understand the fault so I'm throwing it to the list in\n> the hope that someone brighter than me can take it on (I've\n> CC'd the signoff-s to that end! :) Sorry!\n>\n>  t/t9801-merge-rename.sh |   41 +++++++++++++++++++++++++++++++++++++++++\n>  1 files changed, 41 insertions(+), 0 deletions(-)\n>  create mode 100755 t/t9801-merge-rename.sh\n>\n> diff --git a/t/t9801-merge-rename.sh b/t/t9801-merge-rename.sh\n> new file mode 100755\n> index 0000000..363911f\n> --- /dev/null\n> +++ b/t/t9801-merge-rename.sh\n> @@ -0,0 +1,41 @@\n> +#!/bin/sh\n> +\n> +test_description='Test for rename merge regression'\n> +\n> +. ./test-lib.sh\n> +\n> +write_out_files() {\n> +cat > noformatting.txt << EOF\n> +if(true){\n> +// Meaningless\n> +}\n> +EOF\n> +\n> +cat > formatting.txt << EOF\n> +       if ( true ) {\n> +         // Meaningless\n> +       }\n> +EOF\n> +}\n> +\n> +# Test the case where a rename happens in one branch and\n> +# a whitespace change occurs in a different branch.  The rename\n> +# change should apply to the whitespace modified file\n> +test_expect_success setup '\n> +       write_out_files &&\n> +       git add formatting.txt &&\n> +\n> +       test_tick &&\n> +       git commit -m Initial &&\n> +       git checkout -b rename_branch &&\n> +       git mv formatting.txt formatting_renamed.txt &&\n> +       git commit -m Rename &&\n> +       git checkout master &&\n> +       rm formatting.txt &&\n> +       mv noformatting.txt formatting.txt &&\n> +       git commit -a -m Reformat\n> +'\n> +test_expect_success 'merge' '\n> +       git merge rename_branch\n> +'\n> +test_done\n> --\n> 1.7.4.1\n>\n"},{"id":"166985","messageId":"BANLkTi=HR7CG0agR=cVMP3m6T-Y8dHP+4A@mail.gmail.com","threadId":"27239","inReplyTo":"BANLkTin6u8e4-x99JgN-D7FFJbO7pXVp-Q@mail.gmail.com","subject":"Re: [PATCH RFC] Test for apparent regression of merging renamed files","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2011-05-04T02:18:40Z","receivedAt":"2011-05-04T02:18:40Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Tue, May 3, 2011 at 1:15 PM, Ciaran <ciaranj@gmail.com> wrote:\n> On Mon, May 2, 2011 at 8:04 PM, Ciaran <ciaranj@gmail.com> wrote:\n>> Provides a test to cover a case that appears to have been regressed out by:\n>>\n>>  b2c8c0a762745768e8fb249949801c1aed8f7c1d\n>>\n>> At this point no tags contain the above commit, but 'master' does.  I'm unsure\n>> what is causing the issue, but can see discussion about this fix here:\n>>\n>> http://git.661346.n2.nabble.com/BUG-merge-recursive-triggered-quot-BUG-quot-td6179353.html\n>>\n>> Providing a patch to demonstrate the issue and spark discussion.\n....\n> The original behaviour (successful merge) seems 'better' than the\n> current behaviour 'failed merge, 'erroneous' both modified flag' ...\n> am I mis-reading this, is this a new non-supported edge case ?\n\nThanks for the testcase.  This is clearly a bug; and a rather easy one\nto trigger at that.  I'll have to take a look, though I suspect it's\ntime to fix the deeper issues Junio pointed out previously...\n\nElijah\n"}]}