{"thread":{"id":"24547","subject":"[PATCH v2] Fix git rebase --continue to work with touched files","startedAt":"2010-07-28T08:20:16Z","lastAt":"2010-07-28T17:23:36Z","messageCount":2,"participants":["David D. Kilzer","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"146592","messageId":"1280305216-59263-1-git-send-email-ddkilzer@kilzer.net","threadId":"24547","inReplyTo":null,"subject":"[PATCH v2] Fix git rebase --continue to work with touched files","fromName":"David D. Kilzer","fromEmail":"ddkilzer@kilzer.net","sentAt":"2010-07-28T08:20:16Z","receivedAt":"2010-07-28T08:20:16Z","isPatch":true,"sender":{"key":"ddkilzer@kilzer.net","avatar":"https://avatars.githubusercontent.com/u/263571?v=4"},"body":"When performing a non-interactive rebase, sometimes\n\"git rebase --continue\" will fail if an unmodified file is\ntouched in the working directory:\n\n    You must edit all merge conflicts and then\n    mark them as resolved using git add\n\nThis is caused by \"git diff-files\" reporting a difference\nbetween the index and the filesystem:\n\n    :100644 100644 d00491...... 000000...... M\tfile\n\nThe fix is to run \"git update-index --refresh\" before\n\"git diff-files\" as is done in git-rebase--interactive.\n\nSigned-off-by: David D. Kilzer <ddkilzer@kilzer.net>\nAcked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\nChanges since v1:\n- Updated test script based on list feedback.  Thanks!\n  * Replaced while loop in original test with test-chmtime.\n  * Switched to use test_commit.\n- Added test case for the same issue in git-rebase--interactive\n  that was already fixed, and verified that the test breaks when\n  the fix is removed.\n\n git-rebase.sh              |    1 +\n t/t3418-rebase-continue.sh |   43 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 44 insertions(+), 0 deletions(-)\n create mode 100755 t/t3418-rebase-continue.sh\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex ab4afa7..2d88742 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -208,6 +208,7 @@ do\n \t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase-apply ||\n \t\t\tdie \"No rebase in progress?\"\n \n+\t\tgit update-index --ignore-submodules --refresh &&\n \t\tgit diff-files --quiet --ignore-submodules || {\n \t\t\techo \"You must edit all merge conflicts and then\"\n \t\t\techo \"mark them as resolved using git add\"\ndiff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh\nnew file mode 100755\nindex 0000000..3b0d273\n--- /dev/null\n+++ b/t/t3418-rebase-continue.sh\n@@ -0,0 +1,43 @@\n+#!/bin/sh\n+\n+test_description='git rebase --continue tests'\n+\n+. ./test-lib.sh\n+\n+. \"$TEST_DIRECTORY\"/lib-rebase.sh\n+\n+set_fake_editor\n+\n+test_expect_success 'setup' '\n+\ttest_commit \"commit-new-file-F1\" F1 1 &&\n+\ttest_commit \"commit-new-file-F2\" F2 2 &&\n+\n+\tgit checkout -b topic HEAD^ &&\n+\ttest_commit \"commit-new-file-F2-on-topic-branch\" F2 22 &&\n+\n+\tgit checkout master\n+'\n+\n+test_expect_success 'interactive rebase --continue works with touched file' '\n+\trm -fr .git/rebase-* &&\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\n+\tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\n+\ttest-chmtime =-60 F1 &&\n+\tgit rebase --continue\n+'\n+\n+test_expect_success 'non-interactive rebase --continue works with touched file' '\n+\trm -fr .git/rebase-* &&\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\n+\ttest_must_fail git rebase --onto master master topic &&\n+\techo \"Resolved\" >F2 &&\n+\tgit add F2 &&\n+\ttest-chmtime =-60 F1 &&\n+\tgit rebase --continue\n+'\n+\n+test_done\n-- \n1.7.2.25.gd0768\n"},{"id":"146645","messageId":"7vocdr4j1j.fsf@alter.siamese.dyndns.org","threadId":"24547","inReplyTo":"1280305216-59263-1-git-send-email-ddkilzer@kilzer.net","subject":"Re: [PATCH v2] Fix git rebase --continue to work with touched files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-28T17:23:36Z","receivedAt":"2010-07-28T17:23:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Reasonable.  Thanks, both.\n"}]}