{"thread":{"id":"14470","subject":"Git rebase failure: .dotest overwritten","startedAt":"2008-07-15T21:08:42Z","lastAt":"2008-07-24T12:44:40Z","messageCount":37,"participants":["Joe Fiorini","Stephan Beyer","René Scharfe","Johannes Schindelin","Linus Torvalds","Junio C Hamano","Theodore Tso","Petr Baudis","Olivier Marin","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"83430","messageId":"73fd69b50807151408i6a916da6p7b89fe81e65fc717@mail.gmail.com","threadId":"14470","inReplyTo":null,"subject":"Git rebase failure: .dotest overwritten","fromName":"Joe Fiorini","fromEmail":"joe@faithfulgeek.org","sentAt":"2008-07-15T21:08:42Z","receivedAt":"2008-07-15T21:08:42Z","isPatch":false,"sender":{"key":"joe@faithfulgeek.org","avatar":null},"body":"A friend of mine asked me for help with a git rebase problem.  I was\nclueless.  Here is what he was seeing:\nThe main problem seems to be the following error: \"fatal: Untracked\nworking tree file '.dotest/0001' would be overwritten by merge.\"; also\nall the files that it says \"already exist in working directory\" did\nnot exist before he ran the rebase.  Maybe it's trying to run the\nrebase more than once? His working copy was clean.  Any thoughts?  Any\nother details I can provide?\nThanks!\nJoe\ngit rebase master\nFirst, rewinding head to replay your work on top of it...\nHEAD is now at 9bba5f1... Create function snippet\nApplying People page templates\n.dotest/patch:59: trailing whitespace.\n\n.dotest/patch:60: space before tab in indent.\n  parent::BuildControlArray($EventParameters);\n.dotest/patch:61: space before tab in indent.\n  }\n.dotest/patch:65: trailing whitespace, space before tab in indent.\n\n.dotest/patch:67: trailing whitespace.\n\nerror: .dotest/0001: already exists in working directory\nerror: .dotest/0002: already exists in working directory\nerror: .dotest/0003: already exists in working directory\nerror: .dotest/binary: already exists in working directory\nerror: .dotest/final-commit: already exists in working directory\nerror: .dotest/info: already exists in working directory\nerror: .dotest/keep: already exists in working directory\nerror: .dotest/last: already exists in working directory\nerror: .dotest/msg: already exists in working directory\nerror: .dotest/msg-clean: already exists in working directory\nerror: .dotest/next: already exists in working directory\nerror: .dotest/patch: already exists in working directory\nerror: .dotest/sign: already exists in working directory\nerror: .dotest/utf8: already exists in working directory\nerror: .dotest/whitespace: already exists in working directory\nUsing index info to reconstruct a base tree...\nstdin:59: trailing whitespace.\n\nstdin:60: space before tab in indent.\n  parent::BuildControlArray($EventParameters);\nstdin:61: space before tab in indent.\n  }\nstdin:65: trailing whitespace, space before tab in indent.\n\nstdin:67: trailing whitespace.\n\nwarning: squelched 49 whitespace errors\nwarning: 54 lines add whitespace errors.\nFalling back to patching base and 3-way merge...\nfatal: Untracked working tree file '.dotest/0001' would be overwritten by merge.\nFailed to merge in the changes.\nPatch failed at 0001.\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo restore the original branch and stop rebasing run \"git rebase --abort\".\n--\njoe fiorini\nhttp://www.faithfulgeek.org\n// freelancing & knowledge sharing\n"},{"id":"83433","messageId":"20080715212211.GL6244@leksak.fem-net","threadId":"14470","inReplyTo":"73fd69b50807151408i6a916da6p7b89fe81e65fc717@mail.gmail.com","subject":"Re: Git rebase failure: .dotest overwritten","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-15T21:22:11Z","receivedAt":"2008-07-15T21:22:11Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJoe Fiorini wrote:\n> A friend of mine asked me for help with a git rebase problem.  I was\n> clueless.  Here is what he was seeing:\n> The main problem seems to be the following error: \"fatal: Untracked\n> working tree file '.dotest/0001' would be overwritten by merge.\"; also\n> all the files that it says \"already exist in working directory\" did\n> not exist before he ran the rebase.  Maybe it's trying to run the\n> rebase more than once? His working copy was clean.  Any thoughts?  Any\n> other details I can provide?\n\ngit-rebase (without -i/-m) generates a directory called \".dotest/\" to\nsave temporary stuff like the commits you want to rebase.\n\nAnd it seems that at least one commit in his repo has .dotest/* files\nin the tree, so that message occurs.\nHmm, he should perhaps clean that commit up and remove the .dotest\nfiles from it. (After figuring out that commit, he could try\n\tgit rebase -i ...\nand change the \"pick\" line to \"edit\".)\n\nRegards.\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83436","messageId":"487D1B3D.70500@lsrfire.ath.cx","threadId":"14470","inReplyTo":"20080715212211.GL6244@leksak.fem-net","subject":"Re: Git rebase failure: .dotest overwritten","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2008-07-15T21:48:45Z","receivedAt":"2008-07-15T21:48:45Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Stephan Beyer schrieb:\n> git-rebase (without -i/-m) generates a directory called \".dotest/\" to\n> save temporary stuff like the commits you want to rebase.\n\nIn February it was discussed to move .dotest below $GIT_DIR.  There was\neven a patch (to rename it to .git-dotest).  I suspect the upcoming\nversion 1.6.0 is a good opportunity to finally remove this wart.\n\nRené\n"},{"id":"83453","messageId":"alpine.DEB.1.00.0807160245440.2841@eeepc-johanness","threadId":"14470","inReplyTo":"487D1B3D.70500@lsrfire.ath.cx","subject":"[PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T00:47:33Z","receivedAt":"2008-07-16T00:47:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSince the files generated and used during a rebase are never to be\ntracked, they should live in $GIT_DIR.  While at it, avoid the rather\nmeaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n\nThis was wished for on the mailing list, but so far unimplemented.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Tue, 15 Jul 2008, René Scharfe wrote:\n\n\t> Stephan Beyer schrieb:\n\t> > git-rebase (without -i/-m) generates a directory called \n\t> > \".dotest/\" to save temporary stuff like the commits you want to \n\t> > rebase.\n\t> \n\t> In February it was discussed to move .dotest below $GIT_DIR.  \n\t> There was even a patch (to rename it to .git-dotest).  I suspect the \n\t> upcoming version 1.6.0 is a good opportunity to finally remove this \n\t> wart.\n\n\tI kind of expected this to be a good opportunity to increase the \n\ttrack record for a certain GSoC project, but here you have it.\n\n Documentation/SubmittingPatches        |    2 +-\n Documentation/git-am.txt               |    4 +-\n Documentation/git-rebase.txt           |    2 +-\n Documentation/user-manual.txt          |    2 +-\n contrib/emacs/git.el                   |    8 +++---\n git-am.sh                              |    6 ++--\n git-completion.bash                    |   20 +++++++-------\n git-quiltimport.sh                     |    2 +-\n git-rebase--interactive.sh             |    2 +-\n git-rebase.sh                          |   46 ++++++++++++++++----------------\n t/t3401-rebase-partial.sh              |    4 +-\n t/t3404-rebase-interactive.sh          |    8 +++---\n t/t3407-rebase-abort.sh                |    4 +-\n t/t4150-am.sh                          |   22 +++++++-------\n t/t9106-git-svn-commit-diff-clobber.sh |    2 +-\n 15 files changed, 67 insertions(+), 67 deletions(-)\n\ndiff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches\nindex b116475..fdfa536 100644\n--- a/Documentation/SubmittingPatches\n+++ b/Documentation/SubmittingPatches\n@@ -301,7 +301,7 @@ If it does not apply correctly, there can be various reasons.\n   patch appropriately.\n \n * Your MUA corrupted your patch; \"am\" would complain that\n-  the patch does not apply.  Look at .dotest/ subdirectory and\n+  the patch does not apply.  Look at .git/rebase/ subdirectory and\n   see what 'patch' file contains and check for the common\n   corruption patterns mentioned above.\n \ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 3863eeb..5b800d3 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -140,9 +140,9 @@ aborts in the middle,.  You can recover from this in one of two ways:\n   the index file to bring it in a state that the patch should\n   have produced.  Then run the command with '--resolved' option.\n \n-The command refuses to process new mailboxes while `.dotest`\n+The command refuses to process new mailboxes while `.git/rebase`\n directory exists, so if you decide to start over from scratch,\n-run `rm -f -r .dotest` before running the command with mailbox\n+run `rm -f -r .git/rebase` before running the command with mailbox\n names.\n \n \ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex f3459c7..c645073 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -38,7 +38,7 @@ It is possible that a merge failure will prevent this process from being\n completely automatic.  You will have to resolve any such merge failure\n and run `git rebase --continue`.  Another option is to bypass the commit\n that caused the merge failure with `git rebase --skip`.  To restore the\n-original <branch> and remove the .dotest working files, use the command\n+original <branch> and remove the .git/rebase working files, use the command\n `git rebase --abort` instead.\n \n Assume the following history exists and the current branch is \"topic\":\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 01c1af6..94c9a58 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -2431,7 +2431,7 @@ $ git rebase origin\n -------------------------------------------------\n \n This will remove each of your commits from mywork, temporarily saving\n-them as patches (in a directory named \".dotest\"), update mywork to\n+them as patches (in a directory named \".git/rebase\"), update mywork to\n point at the latest version of origin, then apply each of the saved\n patches to the new mywork.  The result will look like:\n \ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 4fa853f..43b059b 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -1252,8 +1252,8 @@ Return the list of files that haven't been handled.\"\n        \"\\n\")\n       (when subject (insert subject \"\\n\\n\"))\n       (cond (msg (insert msg \"\\n\"))\n-            ((file-readable-p \".dotest/msg\")\n-             (insert-file-contents \".dotest/msg\"))\n+            ((file-readable-p \".git/rebase/msg\")\n+             (insert-file-contents \".git/rebase/msg\"))\n             ((file-readable-p \".git/MERGE_MSG\")\n              (insert-file-contents \".git/MERGE_MSG\")))\n       ; delete empty lines at end\n@@ -1272,9 +1272,9 @@ Return the list of files that haven't been handled.\"\n           (coding-system (git-get-commits-coding-system))\n           author-name author-email subject date)\n       (when (eq 0 (buffer-size buffer))\n-        (when (file-readable-p \".dotest/info\")\n+        (when (file-readable-p \".git/rebase/info\")\n           (with-temp-buffer\n-            (insert-file-contents \".dotest/info\")\n+            (insert-file-contents \".git/rebase/info\")\n             (goto-char (point-min))\n             (when (re-search-forward \"^Author: \\\\(.*\\\\)\\nEmail: \\\\(.*\\\\)$\" nil t)\n               (setq author-name (match-string 1))\ndiff --git a/git-am.sh b/git-am.sh\nindex fe53608..3a11f8b 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -118,7 +118,7 @@ It does not apply to blobs recorded in its index.\"\n }\n \n prec=4\n-dotest=\".dotest\"\n+dotest=\"$GIT_DIR/rebase\"\n sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=\n resolvemsg= resume=\n git_apply_opt=\n@@ -194,7 +194,7 @@ then\n \t\tfalse\n \t\t;;\n \tesac ||\n-\tdie \"previous dotest directory $dotest still exists but mbox given.\"\n+\tdie \"previous rebase directory $dotest still exists but mbox given.\"\n \tresume=yes\n else\n \t# Make sure we are not given --skip nor --resolved\n@@ -324,7 +324,7 @@ do\n \t\t\t<\"$dotest\"/info >/dev/null &&\n \t\t\tgo_next && continue\n \n-\t\ttest -s $dotest/patch || {\n+\t\ttest -s \"$dotest/patch\" || {\n \t\t\techo \"Patch is empty.  Was it split wrong?\"\n \t\t\tstop_here $this\n \t\t}\ndiff --git a/git-completion.bash b/git-completion.bash\nindex 04e2ef5..8c8af4f 100755\n--- a/git-completion.bash\n+++ b/git-completion.bash\n@@ -68,26 +68,26 @@ __git_ps1 ()\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n-\t\tif [ -d \"$g/../.dotest\" ]\n+\t\tif [ -d \"$g/rebase\" ]\n \t\tthen\n-\t\t\tif test -f \"$g/../.dotest/rebasing\"\n+\t\t\tif test -f \"$g/rebase/rebasing\"\n \t\t\tthen\n \t\t\t\tr=\"|REBASE\"\n-\t\t\telif test -f \"$g/../.dotest/applying\"\n+\t\t\telif test -f \"$g/rebase/applying\"\n \t\t\tthen\n \t\t\t\tr=\"|AM\"\n \t\t\telse\n \t\t\t\tr=\"|AM/REBASE\"\n \t\t\tfi\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\telif [ -f \"$g/.dotest-merge/interactive\" ]\n+\t\telif [ -f \"$g/rebase-merge/interactive\" ]\n \t\tthen\n \t\t\tr=\"|REBASE-i\"\n-\t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n-\t\telif [ -d \"$g/.dotest-merge\" ]\n+\t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n+\t\telif [ -d \"$g/rebase-merge\" ]\n \t\tthen\n \t\t\tr=\"|REBASE-m\"\n-\t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n+\t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n \t\telif [ -f \"$g/MERGE_HEAD\" ]\n \t\tthen\n \t\t\tr=\"|MERGING\"\n@@ -455,8 +455,8 @@ __git_whitespacelist=\"nowarn warn error error-all strip\"\n \n _git_am ()\n {\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tif [ -d .dotest ]; then\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\" dir=\"$(__gitdir)\"\n+\tif [ -d \"$dir\"/rebase ]; then\n \t\t__gitcomp \"--skip --resolved\"\n \t\treturn\n \tfi\n@@ -864,7 +864,7 @@ _git_push ()\n _git_rebase ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\" dir=\"$(__gitdir)\"\n-\tif [ -d .dotest ] || [ -d \"$dir\"/.dotest-merge ]; then\n+\tif [ -d \"$dir\"/rebase ] || [ -d \"$dir\"/rebase-merge ]; then\n \t\t__gitcomp \"--continue --skip --abort\"\n \t\treturn\n \tfi\ndiff --git a/git-quiltimport.sh b/git-quiltimport.sh\nindex 7cd8f71..d1efa1d 100755\n--- a/git-quiltimport.sh\n+++ b/git-quiltimport.sh\n@@ -53,7 +53,7 @@ if ! [ -d \"$QUILT_PATCHES\" ] ; then\n fi\n \n # Temporary directories\n-tmp_dir=.dotest\n+tmp_dir=\"$GIT_DIR\"/rebase\n tmp_msg=\"$tmp_dir/msg\"\n tmp_patch=\"$tmp_dir/patch\"\n tmp_info=\"$tmp_dir/info\"\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 297b646..dd01a45 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -17,7 +17,7 @@ OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n \n-DOTEST=\"$GIT_DIR/.dotest-merge\"\n+DOTEST=\"$GIT_DIR/rebase-merge\"\n TODO=\"$DOTEST\"/git-rebase-todo\n DONE=\"$DOTEST\"/done\n MSG=\"$DOTEST\"/message\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex bf0e7a9..74ff873 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -14,7 +14,7 @@ It is possible that a merge failure will prevent this process from being\n completely automatic.  You will have to resolve any such merge failure\n and run git rebase --continue.  Another option is to bypass the commit\n that caused the merge failure with git rebase --skip.  To restore the\n-original <branch> and remove the .dotest working files, use the command\n+original <branch> and remove the .git/rebase working files, use the command\n git rebase --abort instead.\n \n Note that if <branch> is not specified on the command line, the\n@@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \\\"git rebase --abort\\\".\n unset newbase\n strategy=recursive\n do_merge=\n-dotest=$GIT_DIR/.dotest-merge\n+dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n verbose=\n git_am_opt=\n@@ -150,7 +150,7 @@ while test $# != 0\n do\n \tcase \"$1\" in\n \t--continue)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit diff-files --quiet --ignore-submodules || {\n@@ -173,15 +173,15 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n-\t\thead_name=$(cat .dotest/head-name) &&\n-\t\tonto=$(cat .dotest/onto) &&\n-\t\torig_head=$(cat .dotest/orig-head) &&\n+\t\thead_name=$(cat \"$GIT_DIR\"/rebase/head-name) &&\n+\t\tonto=$(cat \"$GIT_DIR\"/rebase/onto) &&\n+\t\torig_head=$(cat \"$GIT_DIR\"/rebase/orig-head) &&\n \t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n \t--skip)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit reset --hard HEAD || exit $?\n@@ -200,19 +200,19 @@ do\n \t\t\tdone\n \t\t\tfinish_rb_merge\n \t\t\texit\n-\t\telif ! test -d .dotest\n+\t\telif ! test -d \"$GIT_DIR\"/rebase\n \t\tthen\n \t\t\tdie \"No rebase in progress?\"\n \t\tfi\n-\t\thead_name=$(cat .dotest/head-name) &&\n-\t\tonto=$(cat .dotest/onto) &&\n-\t\torig_head=$(cat .dotest/orig-head) &&\n+\t\thead_name=$(cat \"$GIT_DIR\"/rebase/head-name) &&\n+\t\tonto=$(cat \"$GIT_DIR\"/rebase/onto) &&\n+\t\torig_head=$(cat \"$GIT_DIR\"/rebase/orig-head) &&\n \t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n \t--abort)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit rerere clear\n@@ -220,7 +220,7 @@ do\n \t\tthen\n \t\t\tmove_to_original_branch\n \t\telse\n-\t\t\tdotest=.dotest\n+\t\t\tdotest=\"$GIT_DIR\"/rebase\n \t\t\tmove_to_original_branch\n \t\tfi\n \t\tgit reset --hard $(cat \"$dotest/orig-head\")\n@@ -268,24 +268,24 @@ do\n \tshift\n done\n \n-# Make sure we do not have .dotest\n+# Make sure we do not have $GIT_DIR/rebase\n if test -z \"$do_merge\"\n then\n-\tif mkdir .dotest\n+\tif mkdir \"$GIT_DIR\"/rebase\n \tthen\n-\t\trmdir .dotest\n+\t\trmdir \"$GIT_DIR\"/rebase\n \telse\n \t\techo >&2 '\n-It seems that I cannot create a .dotest directory, and I wonder if you\n+It seems that I cannot create a .git/rebase directory, and I wonder if you\n are in the middle of patch application or another rebase.  If that is not\n-the case, please rm -fr .dotest and run me again.  I am stopping in case\n+the case, please rm -fr .git/rebase and run me again.  I am stopping in case\n you still have something valuable there.'\n \t\texit 1\n \tfi\n else\n \tif test -d \"$dotest\"\n \tthen\n-\t\tdie \"previous dotest directory $dotest still exists.\" \\\n+\t\tdie \"previous rebase directory $dotest still exists.\" \\\n \t\t\t'try git-rebase < --continue | --abort >'\n \tfi\n fi\n@@ -399,10 +399,10 @@ then\n \tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n \tmove_to_original_branch\n \tret=$?\n-\ttest 0 != $ret -a -d .dotest &&\n-\t\techo $head_name > .dotest/head-name &&\n-\t\techo $onto > .dotest/onto &&\n-\t\techo $orig_head > .dotest/orig-head\n+\ttest 0 != $ret -a -d \"$GIT_DIR\"/rebase &&\n+\t\techo $head_name > \"$GIT_DIR\"/rebase/head-name &&\n+\t\techo $onto > \"$GIT_DIR\"/rebase/onto &&\n+\t\techo $orig_head > \"$GIT_DIR\"/rebase/orig-head\n \texit $ret\n fi\n \ndiff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh\nindex 4934a4e..36d9a2a 100755\n--- a/t/t3401-rebase-partial.sh\n+++ b/t/t3401-rebase-partial.sh\n@@ -50,12 +50,12 @@ test_debug \\\n \n test_expect_success \\\n     'rebase topic branch against new master and check git-am did not get halted' \\\n-    'git-rebase master && test ! -d .dotest'\n+    'git-rebase master && test ! -d .git/rebase'\n \n test_expect_success \\\n \t'rebase --merge topic branch that was partially merged upstream' \\\n \t'git-checkout -f my-topic-branch-merge &&\n \t git-rebase --merge master-merge &&\n-\t test ! -d .git/.dotest-merge'\n+\t test ! -d .git/rebase-merge'\n \n test_done\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 1c80148..d27554e 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -159,19 +159,19 @@ test_expect_success 'stop on conflicting pick' '\n \tgit tag new-branch1 &&\n \ttest_must_fail git rebase -i master &&\n \ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse master)\" &&\n-\ttest_cmp expect .git/.dotest-merge/patch &&\n+\ttest_cmp expect .git/rebase-merge/patch &&\n \ttest_cmp expect2 file1 &&\n \ttest \"$(git-diff --name-status |\n \t\tsed -n -e \"/^U/s/^U[^a-z]*//p\")\" = file1 &&\n-\ttest 4 = $(grep -v \"^#\" < .git/.dotest-merge/done | wc -l) &&\n-\ttest 0 = $(grep -c \"^[^#]\" < .git/.dotest-merge/git-rebase-todo)\n+\ttest 4 = $(grep -v \"^#\" < .git/rebase-merge/done | wc -l) &&\n+\ttest 0 = $(grep -c \"^[^#]\" < .git/rebase-merge/git-rebase-todo)\n '\n \n test_expect_success 'abort' '\n \tgit rebase --abort &&\n \ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n \ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n-\t! test -d .git/.dotest-merge\n+\t! test -d .git/rebase-merge\n '\n \n test_expect_success 'retain authorship' '\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 1777ffe..12c8804 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -74,7 +74,7 @@ testrebase() {\n \t'\n }\n \n-testrebase \"\" .dotest\n-testrebase \" --merge\" .git/.dotest-merge\n+testrebase \"\" .git/rebase\n+testrebase \" --merge\" .git/rebase-merge\n \n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex bc98260..5cbd5ef 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am <patch1 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff second)\" &&\n \ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n@@ -123,7 +123,7 @@ test_expect_success 'am changes committer and keeps author' '\n \ttest_tick &&\n \tgit checkout first &&\n \tgit am patch2 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n \ttest -z \"$(git diff master..HEAD)\" &&\n \ttest -z \"$(git diff master^..HEAD^)\" &&\n@@ -163,7 +163,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '\n test_expect_success 'am --keep really keeps the subject' '\n \tgit checkout HEAD^ &&\n \tgit am --keep patch4 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \tgit-cat-file commit HEAD |\n \t\tgrep -q -F \"Re: Re: Re: [PATCH 1/5 v2] third\"\n '\n@@ -176,19 +176,19 @@ test_expect_success 'am -3 falls back to 3-way merge' '\n \ttest_tick &&\n \tgit commit -m \"copied stuff\" &&\n \tgit am -3 lorem-move.patch &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff lorem)\"\n '\n \n test_expect_success 'am pauses on conflict' '\n \tgit checkout lorem2^^ &&\n \t! git am lorem-move.patch &&\n-\ttest -d .dotest\n+\ttest -d .git/rebase\n '\n \n test_expect_success 'am --skip works' '\n \tgit am --skip &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff lorem2^^ -- file)\" &&\n \ttest goodbye = \"$(cat another)\"\n '\n@@ -196,31 +196,31 @@ test_expect_success 'am --skip works' '\n test_expect_success 'am --resolved works' '\n \tgit checkout lorem2^^ &&\n \t! git am lorem-move.patch &&\n-\ttest -d .dotest &&\n+\ttest -d .git/rebase &&\n \techo resolved >>file &&\n \tgit add file &&\n \tgit am --resolved &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest goodbye = \"$(cat another)\"\n '\n \n test_expect_success 'am takes patches from a Pine mailbox' '\n \tgit checkout first &&\n \tcat pine patch1 | git am &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff master^..HEAD)\"\n '\n \n test_expect_success 'am fails on mail without patch' '\n \t! git am <failmail &&\n-\trm -r .dotest/\n+\trm -r .git/rebase/\n '\n \n test_expect_success 'am fails on empty patch' '\n \techo \"---\" >>failmail &&\n \t! git am <failmail &&\n \tgit am --skip &&\n-\t! test -d .dotest\n+\t! test -d .git/rebase\n '\n \n test_expect_success 'am works from stdin in subdirectory' '\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex 58a3a7b..27a65e0 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -87,7 +87,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' \"\n \t\"\n \n \n-test_expect_success 'check that rebase really failed' 'test -d .dotest'\n+test_expect_success 'check that rebase really failed' 'test -d .git/rebase'\n \n test_expect_success 'resolve, continue the rebase and dcommit' \"\n \techo clobber and I really mean it > file &&\n-- \n1.5.6.2.449.g342381.dirty\n"},{"id":"83456","messageId":"alpine.LFD.1.10.0807151756550.2867@woody.linux-foundation.org","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160245440.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-07-16T00:57:48Z","receivedAt":"2008-07-16T00:57:48Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 16 Jul 2008, Johannes Schindelin wrote:\n> \n> Since the files generated and used during a rebase are never to be\n> tracked, they should live in $GIT_DIR.  While at it, avoid the rather\n> meaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n\nAck. Please make it so. Even _I_ have now taught myself to do \"git am\" \ninstead of using my old \"dotest\" alias.\n\n\t\tLinus\n"},{"id":"83457","messageId":"7v4p6qzla3.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160245440.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T01:10:28Z","receivedAt":"2008-07-16T01:10:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Since the files generated and used during a rebase are never to be\n> tracked, they should live in $GIT_DIR.  While at it, avoid the rather\n> meaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n\nI understand moving away from .dotest/ to .git/something, but I do not\nfollow the logic of making that something to rebase at all.  It is a\nscratch area for \"am\" (and applymbox), isn't it?\n"},{"id":"83458","messageId":"alpine.DEB.1.00.0807160315020.2841@eeepc-johanness","threadId":"14470","inReplyTo":"7v4p6qzla3.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T01:15:42Z","receivedAt":"2008-07-16T01:15:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 15 Jul 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Since the files generated and used during a rebase are never to be \n> > tracked, they should live in $GIT_DIR.  While at it, avoid the rather \n> > meaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n> \n> I understand moving away from .dotest/ to .git/something, but I do not \n> follow the logic of making that something to rebase at all.  It is a \n> scratch area for \"am\" (and applymbox), isn't it?\n\nOf course, you can name it as you want.  But I thought that the name \n\"rebase\" applies as well: the patches are rebased from somewhere else on \ntop of HEAD :-)\n\nCiao,\nDscho\n"},{"id":"83459","messageId":"7vzloiy6ah.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160315020.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T01:19:34Z","receivedAt":"2008-07-16T01:19:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Of course, you can name it as you want.  But I thought that the name \n> \"rebase\" applies as well: the patches are rebased from somewhere else...\n\nSomewhere else being my mailbox or gmane newsgroup?\n\nThe patch does not apply to my master anyway, sigh...\n"},{"id":"83460","messageId":"20080716012619.GM8185@mit.edu","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160245440.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2008-07-16T01:26:19Z","receivedAt":"2008-07-16T01:26:19Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Wed, Jul 16, 2008 at 02:47:33AM +0200, Johannes Schindelin wrote:\n> \n> Since the files generated and used during a rebase are never to be\n> tracked, they should live in $GIT_DIR.  While at it, avoid the rather\n> meaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n> \n> This was wished for on the mailing list, but so far unimplemented.\n\nWhile you have \"git am\" open, how about adding an \"git am --abort\"\nwhich nukes the .dotest aka .git/rebase directory, and resets HEAD\nback to the original position?\n\nAnd another nice shortcut would be \"git am --forceapply\" which applies\nthe patch, leaving .rej files for the user to resolve by hand.  That\nmakes it easier for the user to manually run patch while passing a\nfilename in .dotest aka .git/rebase.\n\nThese two additions would make the git-am workflow much smoother.\n\nRegards,\n\n\t\t\t\t\t- Ted\n"},{"id":"83462","messageId":"alpine.DEB.1.00.0807160332190.2841@eeepc-johanness","threadId":"14470","inReplyTo":"7vzloiy6ah.fsf@gitster.siamese.dyndns.org","subject":"[PATCH for master] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T01:33:44Z","receivedAt":"2008-07-16T01:33:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSince the files generated and used during a rebase are never to be\ntracked, they should live in $GIT_DIR.  While at it, avoid the rather\nmeaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n\nThis was wished for on the mailing list, but so far unimplemented.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Tue, 15 Jul 2008, Junio C Hamano wrote:\n\n\t> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\t> \n\t> > Of course, you can name it as you want.  But I thought that \n\t> > the name \"rebase\" applies as well: the patches are rebased from \n\t> > somewhere else...\n\t> \n\t> Somewhere else being my mailbox or gmane newsgroup?\n\n\tSomething like this *-)\n\n\t> The patch does not apply to my master anyway, sigh...\n\n\tHere you are.\n\n Documentation/SubmittingPatches        |    2 +-\n Documentation/git-am.txt               |    4 +-\n Documentation/git-rebase.txt           |    2 +-\n Documentation/user-manual.txt          |    2 +-\n contrib/completion/git-completion.bash |   20 +++++++-------\n contrib/emacs/git.el                   |    8 +++---\n git-am.sh                              |    6 ++--\n git-quiltimport.sh                     |    2 +-\n git-rebase--interactive.sh             |    2 +-\n git-rebase.sh                          |   44 ++++++++++++++++----------------\n t/t3401-rebase-partial.sh              |    4 +-\n t/t3404-rebase-interactive.sh          |    8 +++---\n t/t3407-rebase-abort.sh                |    4 +-\n t/t4150-am.sh                          |   22 ++++++++--------\n t/t9106-git-svn-commit-diff-clobber.sh |    2 +-\n 15 files changed, 66 insertions(+), 66 deletions(-)\n\ndiff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches\nindex b116475..fdfa536 100644\n--- a/Documentation/SubmittingPatches\n+++ b/Documentation/SubmittingPatches\n@@ -301,7 +301,7 @@ If it does not apply correctly, there can be various reasons.\n   patch appropriately.\n \n * Your MUA corrupted your patch; \"am\" would complain that\n-  the patch does not apply.  Look at .dotest/ subdirectory and\n+  the patch does not apply.  Look at .git/rebase/ subdirectory and\n   see what 'patch' file contains and check for the common\n   corruption patterns mentioned above.\n \ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 1395c7d..2d7f162 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -140,9 +140,9 @@ aborts in the middle,.  You can recover from this in one of two ways:\n   the index file to bring it in a state that the patch should\n   have produced.  Then run the command with '--resolved' option.\n \n-The command refuses to process new mailboxes while `.dotest`\n+The command refuses to process new mailboxes while `.git/rebase`\n directory exists, so if you decide to start over from scratch,\n-run `rm -f -r .dotest` before running the command with mailbox\n+run `rm -f -r .git/rebase` before running the command with mailbox\n names.\n \n Before any patches are applied, ORIG_HEAD is set to the tip of the\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex e30f6a6..51afc87 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -39,7 +39,7 @@ It is possible that a merge failure will prevent this process from being\n completely automatic.  You will have to resolve any such merge failure\n and run `git rebase --continue`.  Another option is to bypass the commit\n that caused the merge failure with `git rebase --skip`.  To restore the\n-original <branch> and remove the .dotest working files, use the command\n+original <branch> and remove the .git/rebase working files, use the command\n `git rebase --abort` instead.\n \n Assume the following history exists and the current branch is \"topic\":\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 92d4007..8761ee7 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -2431,7 +2431,7 @@ $ git rebase origin\n -------------------------------------------------\n \n This will remove each of your commits from mywork, temporarily saving\n-them as patches (in a directory named \".dotest\"), update mywork to\n+them as patches (in a directory named \".git/rebase\"), update mywork to\n point at the latest version of origin, then apply each of the saved\n patches to the new mywork.  The result will look like:\n \ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 03e4e02..29f6cd4 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -73,26 +73,26 @@ __git_ps1 ()\n \tif [ -n \"$g\" ]; then\n \t\tlocal r\n \t\tlocal b\n-\t\tif [ -d \"$g/../.dotest\" ]\n+\t\tif [ -d \"$g/rebase\" ]\n \t\tthen\n-\t\t\tif test -f \"$g/../.dotest/rebasing\"\n+\t\t\tif test -f \"$g/rebase/rebasing\"\n \t\t\tthen\n \t\t\t\tr=\"|REBASE\"\n-\t\t\telif test -f \"$g/../.dotest/applying\"\n+\t\t\telif test -f \"$g/rebase/applying\"\n \t\t\tthen\n \t\t\t\tr=\"|AM\"\n \t\t\telse\n \t\t\t\tr=\"|AM/REBASE\"\n \t\t\tfi\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n-\t\telif [ -f \"$g/.dotest-merge/interactive\" ]\n+\t\telif [ -f \"$g/rebase-merge/interactive\" ]\n \t\tthen\n \t\t\tr=\"|REBASE-i\"\n-\t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n-\t\telif [ -d \"$g/.dotest-merge\" ]\n+\t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n+\t\telif [ -d \"$g/rebase-merge\" ]\n \t\tthen\n \t\t\tr=\"|REBASE-m\"\n-\t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n+\t\t\tb=\"$(cat \"$g/rebase-merge/head-name\")\"\n \t\telif [ -f \"$g/MERGE_HEAD\" ]\n \t\tthen\n \t\t\tr=\"|MERGING\"\n@@ -487,8 +487,8 @@ __git_whitespacelist=\"nowarn warn error error-all strip\"\n \n _git_am ()\n {\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tif [ -d .dotest ]; then\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\" dir=\"$(__gitdir)\"\n+\tif [ -d \"$dir\"/rebase ]; then\n \t\t__gitcomp \"--skip --resolved\"\n \t\treturn\n \tfi\n@@ -915,7 +915,7 @@ _git_push ()\n _git_rebase ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\" dir=\"$(__gitdir)\"\n-\tif [ -d .dotest ] || [ -d \"$dir\"/.dotest-merge ]; then\n+\tif [ -d \"$dir\"/rebase ] || [ -d \"$dir\"/rebase-merge ]; then\n \t\t__gitcomp \"--continue --skip --abort\"\n \t\treturn\n \tfi\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 4fa853f..43b059b 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -1252,8 +1252,8 @@ Return the list of files that haven't been handled.\"\n        \"\\n\")\n       (when subject (insert subject \"\\n\\n\"))\n       (cond (msg (insert msg \"\\n\"))\n-            ((file-readable-p \".dotest/msg\")\n-             (insert-file-contents \".dotest/msg\"))\n+            ((file-readable-p \".git/rebase/msg\")\n+             (insert-file-contents \".git/rebase/msg\"))\n             ((file-readable-p \".git/MERGE_MSG\")\n              (insert-file-contents \".git/MERGE_MSG\")))\n       ; delete empty lines at end\n@@ -1272,9 +1272,9 @@ Return the list of files that haven't been handled.\"\n           (coding-system (git-get-commits-coding-system))\n           author-name author-email subject date)\n       (when (eq 0 (buffer-size buffer))\n-        (when (file-readable-p \".dotest/info\")\n+        (when (file-readable-p \".git/rebase/info\")\n           (with-temp-buffer\n-            (insert-file-contents \".dotest/info\")\n+            (insert-file-contents \".git/rebase/info\")\n             (goto-char (point-min))\n             (when (re-search-forward \"^Author: \\\\(.*\\\\)\\nEmail: \\\\(.*\\\\)$\" nil t)\n               (setq author-name (match-string 1))\ndiff --git a/git-am.sh b/git-am.sh\nindex 52b5669..cc8787b 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -119,7 +119,7 @@ It does not apply to blobs recorded in its index.\"\n }\n \n prec=4\n-dotest=\".dotest\"\n+dotest=\"$GIT_DIR/rebase\"\n sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=\n resolvemsg= resume=\n git_apply_opt=\n@@ -195,7 +195,7 @@ then\n \t\tfalse\n \t\t;;\n \tesac ||\n-\tdie \"previous dotest directory $dotest still exists but mbox given.\"\n+\tdie \"previous rebase directory $dotest still exists but mbox given.\"\n \tresume=yes\n else\n \t# Make sure we are not given --skip nor --resolved\n@@ -325,7 +325,7 @@ do\n \t\t\t<\"$dotest\"/info >/dev/null &&\n \t\t\tgo_next && continue\n \n-\t\ttest -s $dotest/patch || {\n+\t\ttest -s \"$dotest/patch\" || {\n \t\t\techo \"Patch is empty.  Was it split wrong?\"\n \t\t\tstop_here $this\n \t\t}\ndiff --git a/git-quiltimport.sh b/git-quiltimport.sh\nindex 7cd8f71..d1efa1d 100755\n--- a/git-quiltimport.sh\n+++ b/git-quiltimport.sh\n@@ -53,7 +53,7 @@ if ! [ -d \"$QUILT_PATCHES\" ] ; then\n fi\n \n # Temporary directories\n-tmp_dir=.dotest\n+tmp_dir=\"$GIT_DIR\"/rebase\n tmp_msg=\"$tmp_dir/msg\"\n tmp_patch=\"$tmp_dir/patch\"\n tmp_info=\"$tmp_dir/info\"\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a35212d..da79a24 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -31,7 +31,7 @@ skip               skip current patch and continue rebasing process\n . git-sh-setup\n require_work_tree\n \n-DOTEST=\"$GIT_DIR/.dotest-merge\"\n+DOTEST=\"$GIT_DIR/rebase-merge\"\n TODO=\"$DOTEST\"/git-rebase-todo\n DONE=\"$DOTEST\"/done\n MSG=\"$DOTEST\"/message\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 2597d77..5fe06d1 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -14,7 +14,7 @@ It is possible that a merge failure will prevent this process from being\n completely automatic.  You will have to resolve any such merge failure\n and run git rebase --continue.  Another option is to bypass the commit\n that caused the merge failure with git rebase --skip.  To restore the\n-original <branch> and remove the .dotest working files, use the command\n+original <branch> and remove the .git/rebase working files, use the command\n git rebase --abort instead.\n \n Note that if <branch> is not specified on the command line, the\n@@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \\\"git rebase --abort\\\".\n unset newbase\n strategy=recursive\n do_merge=\n-dotest=$GIT_DIR/.dotest-merge\n+dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n verbose=\n git_am_opt=\n@@ -150,7 +150,7 @@ while test $# != 0\n do\n \tcase \"$1\" in\n \t--continue)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit diff-files --quiet --ignore-submodules || {\n@@ -173,15 +173,15 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n-\t\thead_name=$(cat .dotest/head-name) &&\n-\t\tonto=$(cat .dotest/onto) &&\n-\t\torig_head=$(cat .dotest/orig-head) &&\n+\t\thead_name=$(cat \"$GIT_DIR\"/rebase/head-name) &&\n+\t\tonto=$(cat \"$GIT_DIR\"/rebase/onto) &&\n+\t\torig_head=$(cat \"$GIT_DIR\"/rebase/orig-head) &&\n \t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n \t--skip)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit reset --hard HEAD || exit $?\n@@ -201,15 +201,15 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n-\t\thead_name=$(cat .dotest/head-name) &&\n-\t\tonto=$(cat .dotest/onto) &&\n-\t\torig_head=$(cat .dotest/orig-head) &&\n+\t\thead_name=$(cat \"$GIT_DIR\"/rebase/head-name) &&\n+\t\tonto=$(cat \"$GIT_DIR\"/rebase/onto) &&\n+\t\torig_head=$(cat \"$GIT_DIR\"/rebase/orig-head) &&\n \t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n \t--abort)\n-\t\ttest -d \"$dotest\" -o -d .dotest ||\n+\t\ttest -d \"$dotest\" -o -d \"$GIT_DIR\"/rebase ||\n \t\t\tdie \"No rebase in progress?\"\n \n \t\tgit rerere clear\n@@ -217,7 +217,7 @@ do\n \t\tthen\n \t\t\tmove_to_original_branch\n \t\telse\n-\t\t\tdotest=.dotest\n+\t\t\tdotest=\"$GIT_DIR\"/rebase\n \t\t\tmove_to_original_branch\n \t\tfi\n \t\tgit reset --hard $(cat \"$dotest/orig-head\")\n@@ -265,24 +265,24 @@ do\n \tshift\n done\n \n-# Make sure we do not have .dotest\n+# Make sure we do not have $GIT_DIR/rebase\n if test -z \"$do_merge\"\n then\n-\tif mkdir .dotest\n+\tif mkdir \"$GIT_DIR\"/rebase\n \tthen\n-\t\trmdir .dotest\n+\t\trmdir \"$GIT_DIR\"/rebase\n \telse\n \t\techo >&2 '\n-It seems that I cannot create a .dotest directory, and I wonder if you\n+It seems that I cannot create a .git/rebase directory, and I wonder if you\n are in the middle of patch application or another rebase.  If that is not\n-the case, please rm -fr .dotest and run me again.  I am stopping in case\n+the case, please rm -fr .git/rebase and run me again.  I am stopping in case\n you still have something valuable there.'\n \t\texit 1\n \tfi\n else\n \tif test -d \"$dotest\"\n \tthen\n-\t\tdie \"previous dotest directory $dotest still exists.\" \\\n+\t\tdie \"previous rebase directory $dotest still exists.\" \\\n \t\t\t'try git-rebase < --continue | --abort >'\n \tfi\n fi\n@@ -396,10 +396,10 @@ then\n \tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n \tmove_to_original_branch\n \tret=$?\n-\ttest 0 != $ret -a -d .dotest &&\n-\t\techo $head_name > .dotest/head-name &&\n-\t\techo $onto > .dotest/onto &&\n-\t\techo $orig_head > .dotest/orig-head\n+\ttest 0 != $ret -a -d \"$GIT_DIR\"/rebase &&\n+\t\techo $head_name > \"$GIT_DIR\"/rebase/head-name &&\n+\t\techo $onto > \"$GIT_DIR\"/rebase/onto &&\n+\t\techo $orig_head > \"$GIT_DIR\"/rebase/orig-head\n \texit $ret\n fi\n \ndiff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh\nindex 4934a4e..36d9a2a 100755\n--- a/t/t3401-rebase-partial.sh\n+++ b/t/t3401-rebase-partial.sh\n@@ -50,12 +50,12 @@ test_debug \\\n \n test_expect_success \\\n     'rebase topic branch against new master and check git-am did not get halted' \\\n-    'git-rebase master && test ! -d .dotest'\n+    'git-rebase master && test ! -d .git/rebase'\n \n test_expect_success \\\n \t'rebase --merge topic branch that was partially merged upstream' \\\n \t'git-checkout -f my-topic-branch-merge &&\n \t git-rebase --merge master-merge &&\n-\t test ! -d .git/.dotest-merge'\n+\t test ! -d .git/rebase-merge'\n \n test_done\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 092aa26..ffe3dd9 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -159,19 +159,19 @@ test_expect_success 'stop on conflicting pick' '\n \tgit tag new-branch1 &&\n \ttest_must_fail git rebase -i master &&\n \ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse master)\" &&\n-\ttest_cmp expect .git/.dotest-merge/patch &&\n+\ttest_cmp expect .git/rebase-merge/patch &&\n \ttest_cmp expect2 file1 &&\n \ttest \"$(git-diff --name-status |\n \t\tsed -n -e \"/^U/s/^U[^a-z]*//p\")\" = file1 &&\n-\ttest 4 = $(grep -v \"^#\" < .git/.dotest-merge/done | wc -l) &&\n-\ttest 0 = $(grep -c \"^[^#]\" < .git/.dotest-merge/git-rebase-todo)\n+\ttest 4 = $(grep -v \"^#\" < .git/rebase-merge/done | wc -l) &&\n+\ttest 0 = $(grep -c \"^[^#]\" < .git/rebase-merge/git-rebase-todo)\n '\n \n test_expect_success 'abort' '\n \tgit rebase --abort &&\n \ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n \ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n-\t! test -d .git/.dotest-merge\n+\t! test -d .git/rebase-merge\n '\n \n test_expect_success 'retain authorship' '\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 1777ffe..12c8804 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -74,7 +74,7 @@ testrebase() {\n \t'\n }\n \n-testrebase \"\" .dotest\n-testrebase \" --merge\" .git/.dotest-merge\n+testrebase \"\" .git/rebase\n+testrebase \" --merge\" .git/rebase-merge\n \n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex bc98260..5cbd5ef 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -102,7 +102,7 @@ test_expect_success 'am applies patch correctly' '\n \tgit checkout first &&\n \ttest_tick &&\n \tgit am <patch1 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff second)\" &&\n \ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n@@ -123,7 +123,7 @@ test_expect_success 'am changes committer and keeps author' '\n \ttest_tick &&\n \tgit checkout first &&\n \tgit am patch2 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n \ttest -z \"$(git diff master..HEAD)\" &&\n \ttest -z \"$(git diff master^..HEAD^)\" &&\n@@ -163,7 +163,7 @@ test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '\n test_expect_success 'am --keep really keeps the subject' '\n \tgit checkout HEAD^ &&\n \tgit am --keep patch4 &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \tgit-cat-file commit HEAD |\n \t\tgrep -q -F \"Re: Re: Re: [PATCH 1/5 v2] third\"\n '\n@@ -176,19 +176,19 @@ test_expect_success 'am -3 falls back to 3-way merge' '\n \ttest_tick &&\n \tgit commit -m \"copied stuff\" &&\n \tgit am -3 lorem-move.patch &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff lorem)\"\n '\n \n test_expect_success 'am pauses on conflict' '\n \tgit checkout lorem2^^ &&\n \t! git am lorem-move.patch &&\n-\ttest -d .dotest\n+\ttest -d .git/rebase\n '\n \n test_expect_success 'am --skip works' '\n \tgit am --skip &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff lorem2^^ -- file)\" &&\n \ttest goodbye = \"$(cat another)\"\n '\n@@ -196,31 +196,31 @@ test_expect_success 'am --skip works' '\n test_expect_success 'am --resolved works' '\n \tgit checkout lorem2^^ &&\n \t! git am lorem-move.patch &&\n-\ttest -d .dotest &&\n+\ttest -d .git/rebase &&\n \techo resolved >>file &&\n \tgit add file &&\n \tgit am --resolved &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest goodbye = \"$(cat another)\"\n '\n \n test_expect_success 'am takes patches from a Pine mailbox' '\n \tgit checkout first &&\n \tcat pine patch1 | git am &&\n-\t! test -d .dotest &&\n+\t! test -d .git/rebase &&\n \ttest -z \"$(git diff master^..HEAD)\"\n '\n \n test_expect_success 'am fails on mail without patch' '\n \t! git am <failmail &&\n-\trm -r .dotest/\n+\trm -r .git/rebase/\n '\n \n test_expect_success 'am fails on empty patch' '\n \techo \"---\" >>failmail &&\n \t! git am <failmail &&\n \tgit am --skip &&\n-\t! test -d .dotest\n+\t! test -d .git/rebase\n '\n \n test_expect_success 'am works from stdin in subdirectory' '\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex 58a3a7b..27a65e0 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -87,7 +87,7 @@ test_expect_success 'multiple dcommit from git-svn will not clobber svn' \"\n \t\"\n \n \n-test_expect_success 'check that rebase really failed' 'test -d .dotest'\n+test_expect_success 'check that rebase really failed' 'test -d .git/rebase'\n \n test_expect_success 'resolve, continue the rebase and dcommit' \"\n \techo clobber and I really mean it > file &&\n-- \n1.5.6.2.449.g342381.dirty\n"},{"id":"83463","messageId":"20080716014711.GD31732@leksak.fem-net","threadId":"14470","inReplyTo":"20080716012619.GM8185@mit.edu","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-16T01:47:11Z","receivedAt":"2008-07-16T01:47:11Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nTheodore Tso wrote:\n> While you have \"git am\" open, how about adding an \"git am --abort\"\n> which nukes the .dotest aka .git/rebase directory, and resets HEAD\n> back to the original position?\n\nPerhaps it will not conform you, but my sequencer patchset (coming\ntomorrow or the day after, I think), will add --abort as a trivial\npatch (running sequencer --abort).\n\nRegards.\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83465","messageId":"alpine.LFD.1.10.0807151851090.2835@woody.linux-foundation.org","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160315020.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-07-16T01:52:06Z","receivedAt":"2008-07-16T01:52:06Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 16 Jul 2008, Johannes Schindelin wrote:\n> \n> Of course, you can name it as you want.  But I thought that the name \n> \"rebase\" applies as well: the patches are rebased from somewhere else on \n> top of HEAD :-)\n\nWell, the original thing was not rebasing, it was patch application. You \ncould _perhaps_ call that \"rebasing\" from another tree, but that's a \nstretch.\n\nBut I don't really care about the name. _Anything_ is better then \n\".dotest\", after all.\n\n\t\tLinus\n"},{"id":"83467","messageId":"alpine.DEB.1.00.0807160428590.2841@eeepc-johanness","threadId":"14470","inReplyTo":"alpine.LFD.1.10.0807151851090.2835@woody.linux-foundation.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-16T02:30:16Z","receivedAt":"2008-07-16T02:30:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 15 Jul 2008, Linus Torvalds wrote:\n\n> On Wed, 16 Jul 2008, Johannes Schindelin wrote:\n> > \n> > Of course, you can name it as you want.  But I thought that the name \n> > \"rebase\" applies as well: the patches are rebased from somewhere else \n> > on top of HEAD :-)\n> \n> Well, the original thing was not rebasing, it was patch application. You \n> could _perhaps_ call that \"rebasing\" from another tree, but that's a \n> stretch.\n\nHey, I do not insist on that name.  I just explained why I thought it was \nokay even for am.  If you know a better name, just tell me, and I'll adapt \nthe patch in no time (at least as long as I am awake).\n\nCiao,\nDscho\n"},{"id":"83469","messageId":"7vlk02wmtt.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160428590.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T03:05:18Z","receivedAt":"2008-07-16T03:05:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Well, the original thing was not rebasing, it was patch application. You \n>> could _perhaps_ call that \"rebasing\" from another tree, but that's a \n>> stretch.\n>\n> Hey, I do not insist on that name.  I just explained why I thought it was \n> okay even for am.  If you know a better name, just tell me, and I'll adapt \n> the patch in no time (at least as long as I am awake).\n\nI obviously do not care too much about the name, as long as you volunteer\nto squelch any newbie questions here and #git \"Why is it called rebase\nwhen I asked for am???\".\n\nAnyway, it's all in 'master' now, and you will see a huge \"What's in\" and\nmuch leaner \"What's cooking\" shortly.\n"},{"id":"83565","messageId":"7viqv5r637.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"20080716012619.GM8185@mit.edu","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T19:18:04Z","receivedAt":"2008-07-16T19:18:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Theodore Tso <tytso@mit.edu> writes:\n\n> While you have \"git am\" open, how about adding an \"git am --abort\"\n> which nukes the .dotest aka .git/rebase directory, and resets HEAD\n> back to the original position?\n\nThis does not seem to have reached the list nor its archives.  I cannot\nsay I have really looked at it deeply but it may be a good starting\npoint.  It needs docs ;-)\n\n-- >8 --\nFrom: Nanako Shiraishi <nanako3@lavabit.com>\nDate: Wed, 16 Jul 2008 19:39:10 +0900\nSubject: [PATCH] git am --abort\n\nAfter failing to apply patches in the middle of a series, \"git am --abort\"\nlets you go back to the original commit.\n\nSigned-off-by: Nanako Shiraishi <nanako3@lavabit.com>\n---\n git-am.sh           |   19 +++++++++++++++----\n t/t4151-am-abort.sh |   48 ++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 63 insertions(+), 4 deletions(-)\n create mode 100755 t/t4151-am-abort.sh\n\ndiff --git a/git-am.sh b/git-am.sh\nindex cc8787b..a44bd7a 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -22,6 +22,7 @@ p=              pass it through git-apply\n resolvemsg=     override error message when patch failure occurs\n r,resolved      to be used after a patch failure\n skip            skip the current patch\n+abort           abandon patch application and clear .dotest directory\n rebasing        (internal use for git-rebase)\"\n \n . git-sh-setup\n@@ -120,7 +121,7 @@ It does not apply to blobs recorded in its index.\"\n \n prec=4\n dotest=\"$GIT_DIR/rebase\"\n-sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=\n+sign= utf8=t keep= skip= interactive= resolved= binary= rebasing= abort=\n resolvemsg= resume=\n git_apply_opt=\n \n@@ -145,6 +146,8 @@ do\n \t\tresolved=t ;;\n \t--skip)\n \t\tskip=t ;;\n+\t--abort)\n+\t\tabort=t ;;\n \t--rebasing)\n \t\trebasing=t threeway=t keep=t binary=t ;;\n \t-d|--dotest)\n@@ -177,7 +180,7 @@ fi\n \n if test -d \"$dotest\"\n then\n-\tcase \"$#,$skip$resolved\" in\n+\tcase \"$#,$skip$resolved$abort\" in\n \t0,*t*)\n \t\t# Explicit resume command and we do not have file, so\n \t\t# we are happy.\n@@ -197,9 +200,17 @@ then\n \tesac ||\n \tdie \"previous rebase directory $dotest still exists but mbox given.\"\n \tresume=yes\n+\n+\tcase \"$abort\" in\n+\tt)\n+\t\trm -fr \"$dotest\" &&\n+\t\tgit read-tree -m -u ORIG_HEAD &&\n+\t\tgit reset ORIG_HEAD && :\n+\t\texit ;;\n+\tesac\n else\n-\t# Make sure we are not given --skip nor --resolved\n-\ttest \",$skip,$resolved,\" = ,,, ||\n+\t# Make sure we are not given --skip, --resolved, nor --abort\n+\ttest \"$skip$resolved$abort\" = \"\" ||\n \t\tdie \"Resolve operation not in progress, we are not resuming.\"\n \n \t# Start afresh.\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nnew file mode 100755\nindex 0000000..96b2cd5\n--- /dev/null\n+++ b/t/t4151-am-abort.sh\n@@ -0,0 +1,48 @@\n+#!/bin/sh\n+\n+test_description='am --abort'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\tfor i in a b c d e f g\n+\tdo\n+\t\techo $i\n+\tdone >file-1 &&\n+\tcp file-1 file-2 &&\n+\ttest_tick &&\n+\tgit add file-1 file-2 &&\n+\tgit commit -m initial &&\n+\tgit tag initial &&\n+\tfor i in 2 3 4 5\n+\tdo\n+\t\techo $i >>file-1 &&\n+\t\ttest_tick &&\n+\t\tgit commit -a -m $i || break\n+\tdone &&\n+\tgit format-patch initial &&\n+\tgit checkout -b side initial &&\n+\techo local change >file-2 &&\n+\tcp file-2 file-2-expect\n+'\n+\n+test_expect_success 'am stops at a patch that does not apply' '\n+\ttest_must_fail git am 000[124]-*.patch &&\n+\tgit log --pretty=tformat:%s >actual &&\n+\tfor i in 3 2 initial\n+\tdo\n+\t\techo $i\n+\tdone >expect &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'am --abort goes back' '\n+\tgit am --abort &&\n+\tgit rev-parse HEAD >actual &&\n+\tgit rev-parse initial >expect &&\n+\ttest_cmp expect actual &&\n+\ttest_cmp file-2-expect file-2 &&\n+\tgit diff-index --exit-code --cached HEAD\n+'\n+\n+test_done\n-- \n1.5.6\n"},{"id":"83597","messageId":"20080716212707.GQ32184@machine.or.cz","threadId":"14470","inReplyTo":"alpine.DEB.1.00.0807160315020.2841@eeepc-johanness","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-07-16T21:27:07Z","receivedAt":"2008-07-16T21:27:07Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nOn Wed, Jul 16, 2008 at 03:15:42AM +0200, Johannes Schindelin wrote:\n> On Tue, 15 Jul 2008, Junio C Hamano wrote:\n> \n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > \n> > > Since the files generated and used during a rebase are never to be \n> > > tracked, they should live in $GIT_DIR.  While at it, avoid the rather \n> > > meaningless term \"dotest\" to \"rebase\", and unhide \".dotest-merge\".\n> > \n> > I understand moving away from .dotest/ to .git/something, but I do not \n> > follow the logic of making that something to rebase at all.  It is a \n> > scratch area for \"am\" (and applymbox), isn't it?\n> \n> Of course, you can name it as you want.  But I thought that the name \n> \"rebase\" applies as well: the patches are rebased from somewhere else on \n> top of HEAD :-)\n\n  even not considering the sequencer work, wouldn't \"sequence\" be a well\ndescriptive name?\n\n\t\t\t\tPetr \"Pasky\" Baudis\n"},{"id":"83599","messageId":"7v8ww1pkrg.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"20080716212707.GQ32184@machine.or.cz","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-16T21:44:03Z","receivedAt":"2008-07-16T21:44:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> Of course, you can name it as you want.  But I thought that the name \n>> \"rebase\" applies as well: the patches are rebased from somewhere else on \n>> top of HEAD :-)\n>\n>   even not considering the sequencer work, wouldn't \"sequence\" be a well\n> descriptive name?\n\nHeh, I did not want to become a painter, especially I already have a\nrather busy plumber job, but here is my thought process:\n\n * \"rebase-merge\" is used only by rebase that uses merge as the pick\n   mechanism;\n\n * when $dotest is used by rebase, it is to implement the \"pick\" mechanism\n   based on applying patches.  \"rebase-apply\" is a good parallel to\n   \"rebase-merge\" here;\n\n * when $dotest is used by am, it is to hold the patches to be applied.\n\nCalling the directory \"rebase-apply\" would be easy to understand for\nsomebody who does _not_ know nor care about such low-level details, too.\nIt is a temporary holding area that is used by the procedure to rebase a\nhistory and the procedure to apply patches.\n"},{"id":"83961","messageId":"4882350B.6020003@free.fr","threadId":"14470","inReplyTo":"7viqv5r637.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-19T18:40:11Z","receivedAt":"2008-07-19T18:40:11Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Junio C Hamano a écrit :\n> Theodore Tso <tytso@mit.edu> writes:\n> \n>> While you have \"git am\" open, how about adding an \"git am --abort\"\n>> which nukes the .dotest aka .git/rebase directory, and resets HEAD\n>> back to the original position?\n> \n> This does not seem to have reached the list nor its archives.  I cannot\n> say I have really looked at it deeply but it may be a good starting\n> point.  It needs docs ;-)\n\nThis can be squashed to Nanako's path: it adds missing docs,\n'git rerere clear' and move $dotest deletion at the end in case\n'git read-tree' failed (because of a dirty index).\n\nOlivier.\n\n-- >8 --\nSubject: [PATCH] git am --abort\n\nTo squash.\n\nSigned-off-by: Olivier Marin <dkr@freesurf.fr>\n---\n Documentation/git-am.txt |    5 ++++-\n git-am.sh                |    8 +++++---\n 2 files changed, 9 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 2d7f162..e010a16 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n          [--3way] [--interactive] [--binary]\n          [--whitespace=<option>] [-C<n>] [-p<n>]\n \t [<mbox> | <Maildir>...]\n-'git am' (--skip | --resolved)\n+'git am' (--skip | --resolved | --abort)\n \n DESCRIPTION\n -----------\n@@ -99,6 +99,9 @@ default.   You could use `--no-utf8` to override this.\n \tor `--skip` to handle the failure.  This is solely\n \tfor internal use between 'git-rebase' and 'git-am'.\n \n+--abort::\n+\tRestore the original branch and abort the patching operation.\n+\n DISCUSSION\n ----------\n \ndiff --git a/git-am.sh b/git-am.sh\nindex 5e645e4..04b2e96 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -22,7 +22,7 @@ p=              pass it through git-apply\n resolvemsg=     override error message when patch failure occurs\n r,resolved      to be used after a patch failure\n skip            skip the current patch\n-abort           abandon patch application and clear .dotest directory\n+abort           restore the original branch and abort the patching operation.\n rebasing        (internal use for git-rebase)\"\n \n . git-sh-setup\n@@ -55,6 +55,7 @@ stop_here_user_resolve () {\n     fi\n     echo \"When you have resolved this problem run \\\"$cmdline --resolved\\\".\"\n     echo \"If you would prefer to skip this patch, instead run \\\"$cmdline --skip\\\".\"\n+    echo \"To restore the original branch and stop patching run \\\"$cmdline --abort\\\".\"\n \n     stop_here $1\n }\n@@ -203,9 +204,10 @@ then\n \n \tcase \"$abort\" in\n \tt)\n-\t\trm -fr \"$dotest\" &&\n+\t\tgit rerere clear &&\n \t\tgit read-tree -m -u ORIG_HEAD &&\n-\t\tgit reset ORIG_HEAD && :\n+\t\tgit reset ORIG_HEAD &&\n+\t\trm -fr \"$dotest\"\n \t\texit ;;\n \tesac\n else\n-- \n1.5.6.3.441.g3087\n"},{"id":"83965","messageId":"4882454D.2080500@free.fr","threadId":"14470","inReplyTo":"7viqv5r637.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-19T19:49:33Z","receivedAt":"2008-07-19T19:49:33Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Junio C Hamano a écrit :\n> Theodore Tso <tytso@mit.edu> writes:\n> \n>> While you have \"git am\" open, how about adding an \"git am --abort\"\n>> which nukes the .dotest aka .git/rebase directory, and resets HEAD\n>> back to the original position?\n> \n> This does not seem to have reached the list nor its archives.  I cannot\n> say I have really looked at it deeply but it may be a good starting\n> point.  It needs docs ;-)\n\nThinking about the way \"git am\" works:\n\nIt tries to apply patches even on a dirty tree which makes difficult\nto automatically do a \"git reset --hard\" with --skip or --abort and\nforces the user to clean the index by hand if last patch failed with\nunmerged files.\n\nSo, do some people still use \"git am\" with a dirty tree or will a\npatch that make it work like \"git rebase\" be accepted?\n\nI think users can use \"git stash\" and \"git stash pop\" today. Did I\nmiss something?\n\nNote: the version that use \"git sequencer\" seems to work like I want\n      but I do not know if it is a side effect or not.\n\nOlivier.\n"},{"id":"83967","messageId":"20080719195944.GB5792@leksak.fem-net","threadId":"14470","inReplyTo":"4882454D.2080500@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-19T19:59:44Z","receivedAt":"2008-07-19T19:59:44Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nOlivier Marin wrote:\n> Note: the version that use \"git sequencer\" seems to work like I want\n>       but I do not know if it is a side effect or not.\n\nIf you mean with \"work like I want\" that it complains about an unclean\nwork tree: the check is explicitly done by git-sequencer.\n\nI guess there are situations where you want to apply a patch on a dirty\nwork tree, e.g. if you fixed some tiny issues so that patches can\napply cleanly.\nBut I think it does not hurt to commit such tiny changes and perhaps\nsquash later.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83969","messageId":"48824DCC.7090405@free.fr","threadId":"14470","inReplyTo":"20080719195944.GB5792@leksak.fem-net","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-19T20:25:48Z","receivedAt":"2008-07-19T20:25:48Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Stephan Beyer a écrit :\n> \n> If you mean with \"work like I want\" that it complains about an unclean\n> work tree: the check is explicitly done by git-sequencer.\n\nYes, I mean: refuse to work if the tree is not clean _and_ --skip\nand --abort clean the index/tree for me.\nWith current git version \"git am --skip\" refuse to continue with a\nmessage: \"Dirty index: cannot apply patches (dirty: ...)\", if some\nfiles stay unmerged.\nAs a user I find --skip and --abort useless^Wpainful to use in this\nsituation.\n\n> I guess there are situations where you want to apply a patch on a dirty\n> work tree, e.g. if you fixed some tiny issues so that patches can\n> apply cleanly.\n\nMaybe.\n\nOlivier.\n"},{"id":"83972","messageId":"7vd4l9zgmp.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"4882454D.2080500@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-19T21:52:14Z","receivedAt":"2008-07-19T21:52:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Olivier Marin <dkr+ml.git@free.fr> writes:\n\n> It tries to apply patches even on a dirty tree which makes difficult\n> to automatically do a \"git reset --hard\" with --skip or --abort and\n> forces the user to clean the index by hand if last patch failed with\n> unmerged files.\n>\n> So, do some people still use \"git am\" with a dirty tree or will a\n> patch that make it work like \"git rebase\" be accepted?\n\nAnything that changes \"am\" to require a clean working tree will NEVER be\naccepted.  I personally rely on the ability for it to run in a dirty tree,\nso does Linus.\n\n\tSide note.  Anything that changes \"merge\" to require a clean\n\tworking tree is also unacceptable.  Cf.\n\n\thttp://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089\n\n\tLinus talks about \"patch\" in the paragraph second to the last one\n\tin the message; back then he was talking about \"git-applymbox\" but\n\tthe same argument there applies to its newer incarnation \"git-am\".\n\n\tSide note #2.  It would have been nice if \"rebase\" were also\n\twritten in such a way that it can work in a dirty tree as long as\n\tlocal changes did not interfere with the operation, but it is a\n\tlot more involved.\n\nWhen I looked at the \"am --abort\" patch briefly, I had an impression (by\nreading its test case) that it correctly refrained from doing the\ndestructive \"reset --hard\".\n"},{"id":"83974","messageId":"7v3am5zfea.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"4882350B.6020003@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-19T22:18:53Z","receivedAt":"2008-07-19T22:18:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Olivier Marin <dkr+ml.git@free.fr> writes:\n\n> Subject: [PATCH] git am --abort\n>\n> To squash.\n>\n> Signed-off-by: Olivier Marin <dkr@freesurf.fr>\n\nThanks.\n\n> @@ -203,9 +204,10 @@ then\n>  \n>  \tcase \"$abort\" in\n>  \tt)\n> -\t\trm -fr \"$dotest\" &&\n> +\t\tgit rerere clear &&\n>  \t\tgit read-tree -m -u ORIG_HEAD &&\n> -\t\tgit reset ORIG_HEAD && :\n> +\t\tgit reset ORIG_HEAD &&\n> +\t\trm -fr \"$dotest\"\n>  \t\texit ;;\n>  \tesac\n>  else\n\nClearing the rerere information needs to be done, but I think we should\ndrop the last && to make sure we remove \"$dotest\" and exit with its exit\nstatus.\n\nI'm happy with the documentation and help-text parts of your patch, but\nprobably this, on top of 1a6f6bb (git am --abort, 2008-07-16), is more\nappropriate?\n\n--- \n git-am.sh           |    6 +++---\n t/t4151-am-abort.sh |   46 +++++++++++++++++++++++++++-------------------\n 2 files changed, 30 insertions(+), 22 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex a44bd7a..5cbf8f4 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -203,9 +203,9 @@ then\n \n \tcase \"$abort\" in\n \tt)\n-\t\trm -fr \"$dotest\" &&\n-\t\tgit read-tree -m -u ORIG_HEAD &&\n-\t\tgit reset ORIG_HEAD && :\n+\t\tgit rerere clear\n+\t\tgit read-tree --reset -u HEAD ORIG_HEAD\n+\t\trm -fr \"$dotest\"\n \t\texit ;;\n \tesac\n else\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex 96b2cd5..dda7e2c 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -22,27 +22,35 @@ test_expect_success setup '\n \tdone &&\n \tgit format-patch initial &&\n \tgit checkout -b side initial &&\n-\techo local change >file-2 &&\n-\tcp file-2 file-2-expect\n+\techo local change >file-2-expect\n '\n \n-test_expect_success 'am stops at a patch that does not apply' '\n-\ttest_must_fail git am 000[124]-*.patch &&\n-\tgit log --pretty=tformat:%s >actual &&\n-\tfor i in 3 2 initial\n-\tdo\n-\t\techo $i\n-\tdone >expect &&\n-\ttest_cmp expect actual\n-'\n+for with3 in '' ' -3'\n+do\n+\ttest_expect_success \"am$with3 stops at a patch that does not apply\" '\n \n-test_expect_success 'am --abort goes back' '\n-\tgit am --abort &&\n-\tgit rev-parse HEAD >actual &&\n-\tgit rev-parse initial >expect &&\n-\ttest_cmp expect actual &&\n-\ttest_cmp file-2-expect file-2 &&\n-\tgit diff-index --exit-code --cached HEAD\n-'\n+\t\tgit reset --hard initial &&\n+\t\tcp file-2-expect file-2 &&\n+\n+\t\ttest_must_fail git am$with3 000[124]-*.patch &&\n+\t\tgit log --pretty=tformat:%s >actual &&\n+\t\tfor i in 3 2 initial\n+\t\tdo\n+\t\t\techo $i\n+\t\tdone >expect &&\n+\t\ttest_cmp expect actual\n+\t'\n+\n+\ttest_expect_success \"am --abort goes back after failed am$with3\" '\n+\t\tgit-am --abort &&\n+\t\tgit rev-parse HEAD >actual &&\n+\t\tgit rev-parse initial >expect &&\n+\t\ttest_cmp expect actual &&\n+\t\ttest_cmp file-2-expect file-2 &&\n+\t\tgit diff-index --exit-code --cached HEAD &&\n+\t\ttest ! -f .git/rr-cache/MERGE_RR\n+\t'\n+\n+done\n \n test_done\n"},{"id":"83975","messageId":"7vy73xy0ex.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"7v3am5zfea.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-19T22:27:50Z","receivedAt":"2008-07-19T22:27:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I'm happy with the documentation and help-text parts of your patch, but\n> probably this, on top of 1a6f6bb (git am --abort, 2008-07-16), is more\n> appropriate?\n>\n> --- \n>  git-am.sh           |    6 +++---\n>  t/t4151-am-abort.sh |   46 +++++++++++++++++++++++++++-------------------\n>  2 files changed, 30 insertions(+), 22 deletions(-)\n>\n> diff --git a/git-am.sh b/git-am.sh\n> index a44bd7a..5cbf8f4 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -203,9 +203,9 @@ then\n>  \n>  \tcase \"$abort\" in\n>  \tt)\n> -\t\trm -fr \"$dotest\" &&\n> -\t\tgit read-tree -m -u ORIG_HEAD &&\n> -\t\tgit reset ORIG_HEAD && :\n> +\t\tgit rerere clear\n> +\t\tgit read-tree --reset -u HEAD ORIG_HEAD\n> +\t\trm -fr \"$dotest\"\n\nWe still need \"git reset ORIG_HEAD\" after the read-tree.  Sorry about the\nnoise.\n\n>  \t\texit ;;\n>  \tesac\n>  else\n"},{"id":"83977","messageId":"g5tqec$73f$1@ger.gmane.org","threadId":"14470","inReplyTo":"7vd4l9zgmp.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-07-19T22:39:12Z","receivedAt":"2008-07-19T22:39:12Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[This is git@vger.kernel.org only copy]\n\nJunio C Hamano wrote:\n> Olivier Marin <dkr+ml.git@free.fr> writes:\n> \n>> It tries to apply patches even on a dirty tree which makes difficult\n>> to automatically do a \"git reset --hard\" with --skip or --abort and\n>> forces the user to clean the index by hand if last patch failed with\n>> unmerged files.\n>>\n>> So, do some people still use \"git am\" with a dirty tree or will a\n>> patch that make it work like \"git rebase\" be accepted?\n> \n> Anything that changes \"am\" to require a clean working tree will NEVER be\n> accepted.  I personally rely on the ability for it to run in a dirty tree,\n> so does Linus.\n> \n>       Side note.  Anything that changes \"merge\" to require a clean\n>       working tree is also unacceptable.  Cf.\n> \n>       http://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089\n> \n>       Linus talks about \"patch\" in the paragraph second to the last one\n>       in the message; back then he was talking about \"git-applymbox\" but\n>       the same argument there applies to its newer incarnation \"git-am\".\n> \n>       Side note #2.  It would have been nice if \"rebase\" were also\n>       written in such a way that it can work in a dirty tree as long as\n>       local changes did not interfere with the operation, but it is a\n>       lot more involved.\n> \n> When I looked at the \"am --abort\" patch briefly, I had an impression (by\n> reading its test case) that it correctly refrained from doing the\n> destructive \"reset --hard\".\n\nI guess instead of \"git reset --hard\" we can use here \"git stash save\n&& git stash apply --index\" to save state (perhaps as \"git stash save\n--no-reset\"), and either \"git stash drop\" at the the end, or \n\"git reset --hard && git stash pop --index\" at '--abort'.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"84193","messageId":"4884917A.1060005@free.fr","threadId":"14470","inReplyTo":"7vd4l9zgmp.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-21T13:39:06Z","receivedAt":"2008-07-21T13:39:06Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Junio C Hamano a écrit :\n> \n> Anything that changes \"am\" to require a clean working tree will NEVER be\n> accepted.  I personally rely on the ability for it to run in a dirty tree,\n> so does Linus.\n> \n> \tSide note.  Anything that changes \"merge\" to require a clean\n> \tworking tree is also unacceptable.  Cf.\n> \n> \thttp://thread.gmane.org/gmane.comp.version-control.git/9073/focus=9089\n> \n> \tLinus talks about \"patch\" in the paragraph second to the last one\n> \tin the message; back then he was talking about \"git-applymbox\" but\n> \tthe same argument there applies to its newer incarnation \"git-am\".\n> \n> \tSide note #2.  It would have been nice if \"rebase\" were also\n> \twritten in such a way that it can work in a dirty tree as long as\n> \tlocal changes did not interfere with the operation, but it is a\n> \tlot more involved.\n\nThanks for the explanation and the really interesting pointer.\n\nThe last thing that still annoy me is the --skip that refuse to skip in 3-way\nmerge. Perhaps we can use the \"git read-tree --reset -u\" thing for skip too.\n\nSo, what about the following patch?\n\n-- >8 --\nFrom: Olivier Marin <dkr@freesurf.fr>\n\ngit am --skip: clean the index while preserving local changes\n\nIn 3-way merge, \"am\" will let the index with unmerged path waiting\nfor us to resolve conflicts and continue. But if we want to --skip\ninstead, \"am\" refuses to continue because of the dirty index.\n\nWith this patch, \"am\" will clean the index without touching files\nlocally modified, before continue.\n\nSigned-off-by: Olivier Marin <dkr@freesurf.fr>\n---\n git-am.sh           |   12 +++++++++---\n t/t4151-am-abort.sh |   11 +++++++++--\n 2 files changed, 18 insertions(+), 5 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 60aaa4a..864c77e 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -202,8 +202,15 @@ then\n \tdie \"previous rebase directory $dotest still exists but mbox given.\"\n \tresume=yes\n \n-\tcase \"$abort\" in\n-\tt)\n+\tcase \"$skip,$abort\" in\n+\tt,)\n+\t\tgit rerere clear\n+\t\tgit read-tree --reset -u HEAD HEAD\n+\t\torig_head=$(cat \"$GIT_DIR/ORIG_HEAD\")\n+\t\tgit reset HEAD\n+\t\tgit update-ref ORIG_HEAD $orig_head\n+\t\t;;\n+\t,t)\n \t\tgit rerere clear\n \t\tgit read-tree --reset -u HEAD ORIG_HEAD\n \t\tgit reset ORIG_HEAD\n@@ -297,7 +304,6 @@ last=`cat \"$dotest/last\"`\n this=`cat \"$dotest/next\"`\n if test \"$skip\" = t\n then\n-\tgit rerere clear\n \tthis=`expr \"$this\" + 1`\n \tresume=\n fi\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex dda7e2c..249093b 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -14,7 +14,7 @@ test_expect_success setup '\n \tgit add file-1 file-2 &&\n \tgit commit -m initial &&\n \tgit tag initial &&\n-\tfor i in 2 3 4 5\n+\tfor i in 2 3 4 5 6\n \tdo\n \t\techo $i >>file-1 &&\n \t\ttest_tick &&\n@@ -32,7 +32,7 @@ do\n \t\tgit reset --hard initial &&\n \t\tcp file-2-expect file-2 &&\n \n-\t\ttest_must_fail git am$with3 000[124]-*.patch &&\n+\t\ttest_must_fail git am$with3 000[1245]-*.patch &&\n \t\tgit log --pretty=tformat:%s >actual &&\n \t\tfor i in 3 2 initial\n \t\tdo\n@@ -41,6 +41,13 @@ do\n \t\ttest_cmp expect actual\n \t'\n \n+\ttest_expect_success \"am$with3 --skip continue after failed am$with3\" '\n+\t\ttest_must_fail git-am$with3 --skip >output &&\n+\t\ttest \"$(grep \"^Applying\" output)\" = \"Applying 6\" &&\n+\t\ttest_cmp file-2-expect file-2 &&\n+\t\ttest ! -f .git/rr-cache/MERGE_RR\n+\t'\n+\n \ttest_expect_success \"am --abort goes back after failed am$with3\" '\n \t\tgit-am --abort &&\n \t\tgit rev-parse HEAD >actual &&\n-- \n1.5.6.4.570.g052e.dirty\n"},{"id":"84405","messageId":"20080722234703.GD5904@leksak.fem-net","threadId":"14470","inReplyTo":"7v3am5zfea.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-22T23:47:03Z","receivedAt":"2008-07-22T23:47:03Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJunio C Hamano wrote:\n> Olivier Marin <dkr+ml.git@free.fr> writes:\n> > @@ -203,9 +204,10 @@ then\n> >  \n> >  \tcase \"$abort\" in\n> >  \tt)\n> > -\t\trm -fr \"$dotest\" &&\n> > +\t\tgit rerere clear &&\n> >  \t\tgit read-tree -m -u ORIG_HEAD &&\n[...]\n> diff --git a/git-am.sh b/git-am.sh\n> index a44bd7a..5cbf8f4 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -203,9 +203,9 @@ then\n>  \n>  \tcase \"$abort\" in\n>  \tt)\n> -\t\trm -fr \"$dotest\" &&\n> -\t\tgit read-tree -m -u ORIG_HEAD &&\n> -\t\tgit reset ORIG_HEAD && :\n> +\t\tgit rerere clear\n> +\t\tgit read-tree --reset -u HEAD ORIG_HEAD\n\nPerhaps I am confused, but ...\nWhy is there \"HEAD\" and \"ORIG_HEAD\" and not only \"ORIG_HEAD\"?\n\nRegards.\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"84409","messageId":"1216771825-21457-1-git-send-email-s-beyer@gmx.net","threadId":"14470","inReplyTo":"4882350B.6020003@free.fr","subject":"[PATCH] am --abort: Add to bash-completion and mention in git-rerere documentation","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-23T00:10:25Z","receivedAt":"2008-07-23T00:10:25Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"The git-rerere documentation talks about commands that invoke\n\"git rerere clear\" automatically. git am --abort is added and\na typo is fixed additionally.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n Documentation/git-rerere.txt           |    2 +-\n contrib/completion/git-completion.bash |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt\nindex beebd53..89f321b 100644\n--- a/Documentation/git-rerere.txt\n+++ b/Documentation/git-rerere.txt\n@@ -37,7 +37,7 @@ its working state.\n 'clear'::\n \n This resets the metadata used by rerere if a merge resolution is to be\n-is aborted.  Calling 'git-am --skip' or 'git-rebase [--skip|--abort]'\n+aborted.  Calling 'git-am [--skip|--abort]' or 'git-rebase [--skip|--abort]'\n will automatically invoke this command.\n \n 'diff'::\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 2edb341..8fc9145 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -489,7 +489,7 @@ _git_am ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\" dir=\"$(__gitdir)\"\n \tif [ -d \"$dir\"/rebase-apply ]; then\n-\t\t__gitcomp \"--skip --resolved\"\n+\t\t__gitcomp \"--skip --resolved --abort\"\n \t\treturn\n \tfi\n \tcase \"$cur\" in\n-- \n1.5.6.4.459.gfa44d\n"},{"id":"84413","messageId":"7vk5fdiheh.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"4884917A.1060005@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-23T00:16:38Z","receivedAt":"2008-07-23T00:16:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Olivier Marin <dkr+ml.git@free.fr> writes:\n\n> The last thing that still annoy me is the --skip that refuse to skip in 3-way\n> merge. Perhaps we can use the \"git read-tree --reset -u\" thing for skip too.\n\nHmm...\n\nWe traditionally left that as something the user deliberately should do to\nsignal --skip that the user knows he is dropping that change (by the way,\nso did \"git-rebase\").  But with fb6e4e1 (Do git reset --hard HEAD when\nusing git rebase --skip, 2007-11-08), we run the reset upon rebase --skip,\nso it probably is a good idea to match it here as well.\n\n> diff --git a/git-am.sh b/git-am.sh\n> index 60aaa4a..864c77e 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -202,8 +202,15 @@ then\n>  \tdie \"previous rebase directory $dotest still exists but mbox given.\"\n>  \tresume=yes\n>  \n> -\tcase \"$abort\" in\n> -\tt)\n> +\tcase \"$skip,$abort\" in\n> +\tt,)\n> +\t\tgit rerere clear\n> +\t\tgit read-tree --reset -u HEAD HEAD\n> +\t\torig_head=$(cat \"$GIT_DIR/ORIG_HEAD\")\n> +\t\tgit reset HEAD\n> +\t\tgit update-ref ORIG_HEAD $orig_head\n> +\t\t;;\n\nSorry, I do not quite understand what this reset after the read-tree dance\nis trying to do; you have already reset the index to the tree in HEAD when\nyou cleared the change involved in the patch application with that\ntwo-tree form of read-tree.\n"},{"id":"84416","messageId":"7vbq0pifwq.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"20080722234703.GD5904@leksak.fem-net","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-23T00:48:53Z","receivedAt":"2008-07-23T00:48:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n> Hi,\n>\n> Junio C Hamano wrote:\n>> Olivier Marin <dkr+ml.git@free.fr> writes:\n>> > @@ -203,9 +204,10 @@ then\n>> >  \n>> >  \tcase \"$abort\" in\n>> >  \tt)\n>> > -\t\trm -fr \"$dotest\" &&\n>> > +\t\tgit rerere clear &&\n>> >  \t\tgit read-tree -m -u ORIG_HEAD &&\n> [...]\n>> diff --git a/git-am.sh b/git-am.sh\n>> index a44bd7a..5cbf8f4 100755\n>> --- a/git-am.sh\n>> +++ b/git-am.sh\n>> @@ -203,9 +203,9 @@ then\n>>  \n>>  \tcase \"$abort\" in\n>>  \tt)\n>> -\t\trm -fr \"$dotest\" &&\n>> -\t\tgit read-tree -m -u ORIG_HEAD &&\n>> -\t\tgit reset ORIG_HEAD && :\n>> +\t\tgit rerere clear\n>> +\t\tgit read-tree --reset -u HEAD ORIG_HEAD\n>\n> Perhaps I am confused, but ...\n> Why is there \"HEAD\" and \"ORIG_HEAD\" and not only \"ORIG_HEAD\"?\n\nJust being a bit defensive -- in this case I think it might be Ok to say\n\"read-tree --reset -u ORIG_HEAD\", but I haven't checked in a conflicted\ncase.\n\nIf some path was added between ORIG_HEAD (that is where we started from)\nand HEAD (that is where we are and we decide we do not want it), and that\npath is conflicted in the index, a single tree form \"read-tree --reset -u\nHEAD\" would leave it behind in the working tree, wouldn't it?\n"},{"id":"84425","messageId":"20080723011341.GE5904@leksak.fem-net","threadId":"14470","inReplyTo":"7vbq0pifwq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-23T01:13:41Z","receivedAt":"2008-07-23T01:13:41Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJunio C Hamano wrote:\n> Stephan Beyer <s-beyer@gmx.net> writes:\n> > Junio C Hamano wrote:\n> >> Olivier Marin <dkr+ml.git@free.fr> writes:\n> >> > @@ -203,9 +204,10 @@ then\n> >> >  \n> >> >  \tcase \"$abort\" in\n> >> >  \tt)\n> >> > -\t\trm -fr \"$dotest\" &&\n> >> > +\t\tgit rerere clear &&\n> >> >  \t\tgit read-tree -m -u ORIG_HEAD &&\n> > [...]\n> >> diff --git a/git-am.sh b/git-am.sh\n> >> index a44bd7a..5cbf8f4 100755\n> >> --- a/git-am.sh\n> >> +++ b/git-am.sh\n> >> @@ -203,9 +203,9 @@ then\n> >>  \n> >>  \tcase \"$abort\" in\n> >>  \tt)\n> >> -\t\trm -fr \"$dotest\" &&\n> >> -\t\tgit read-tree -m -u ORIG_HEAD &&\n> >> -\t\tgit reset ORIG_HEAD && :\n> >> +\t\tgit rerere clear\n> >> +\t\tgit read-tree --reset -u HEAD ORIG_HEAD\n> >\n> > Perhaps I am confused, but ...\n> > Why is there \"HEAD\" and \"ORIG_HEAD\" and not only \"ORIG_HEAD\"?\n> \n> Just being a bit defensive -- in this case I think it might be Ok to say\n> \"read-tree --reset -u ORIG_HEAD\", but I haven't checked in a conflicted\n> case.\n\nWell, the test suite fails:\n* FAIL 4: am --abort goes back after failed am\n\n                        git-am --abort &&\n                        git rev-parse HEAD >actual &&\n                        git rev-parse initial >expect &&\n                        test_cmp expect actual &&\n  here>                 test_cmp file-2-expect file-2 &&\n  ...                   git diff-index --exit-code --cached HEAD &&\n                        test ! -f .git/rr-cache/MERGE_RR\n\n* FAIL 7: am --abort goes back after failed am -3\n\n                        git-am --abort &&\n                        git rev-parse HEAD >actual &&\n                        git rev-parse initial >expect &&\n                        test_cmp expect actual &&\n and here>              test_cmp file-2-expect file-2 &&\n                        git diff-index --exit-code --cached HEAD &&\n                        test ! -f .git/rr-cache/MERGE_RR\n\nSo no reason to be defensive ;)\n\n> If some path was added between ORIG_HEAD (that is where we started from)\n> and HEAD (that is where we are and we decide we do not want it), and that\n> path is conflicted in the index, a single tree form \"read-tree --reset -u\n> HEAD\" would leave it behind in the working tree, wouldn't it?\n\nSeems so.\n\nThe reason of my question was that I *blindly* incorporated the change into\nsequencer to make it able to work on a dirty working tree and thus to be\nable to migrate am onto it without losing the ability to apply patches\non a dirty working tree....\nAll am tests applied afterwards, but the sequencer and the rebase-i\ntest suite failed in a place where I didn't expect it. I *then* had\na deeper look at the read-tree line and I was wondering what the \"HEAD\"\nshould achieve.\nI removed it and all tests passed. (I didn't have t4151 in my branch\nat that point.)\n\nNow, because t4151 does not pass, I am wondering what's the best thing\nI could do...\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"84477","messageId":"488722F5.9030602@free.fr","threadId":"14470","inReplyTo":"7vk5fdiheh.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-23T12:24:21Z","receivedAt":"2008-07-23T12:24:21Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Junio C Hamano a écrit :\n>\n>> diff --git a/git-am.sh b/git-am.sh\n>> index 60aaa4a..864c77e 100755\n>> --- a/git-am.sh\n>> +++ b/git-am.sh\n>> @@ -202,8 +202,15 @@ then\n>>  \tdie \"previous rebase directory $dotest still exists but mbox given.\"\n>>  \tresume=yes\n>>  \n>> -\tcase \"$abort\" in\n>> -\tt)\n>> +\tcase \"$skip,$abort\" in\n>> +\tt,)\n>> +\t\tgit rerere clear\n>> +\t\tgit read-tree --reset -u HEAD HEAD\n>> +\t\torig_head=$(cat \"$GIT_DIR/ORIG_HEAD\")\n>> +\t\tgit reset HEAD\n>> +\t\tgit update-ref ORIG_HEAD $orig_head\n>> +\t\t;;\n> \n> Sorry, I do not quite understand what this reset after the read-tree dance\n> is trying to do; you have already reset the index to the tree in HEAD when\n> you cleared the change involved in the patch application with that\n> two-tree form of read-tree.\n\nI add reset to unstage paths with no conflict that are left behind. Perhaps\nread-tree can clear those paths as well but I do not know how, the man page\nis hard to follow.\n\n-- \nOlivier.\n"},{"id":"84502","messageId":"48874617.3010108@free.fr","threadId":"14470","inReplyTo":"20080723011341.GE5904@leksak.fem-net","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-23T14:54:15Z","receivedAt":"2008-07-23T14:54:15Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Stephan Beyer a écrit :\n> \n>>> Perhaps I am confused, but ...\n\nI can understand. ;-)\n\n>>> Why is there \"HEAD\" and \"ORIG_HEAD\" and not only \"ORIG_HEAD\"?\n>> Just being a bit defensive -- in this case I think it might be Ok to say\n>> \"read-tree --reset -u ORIG_HEAD\", but I haven't checked in a conflicted\n>> case.\n\ngit read-tree --reset -u ORIG_HEAD clears local changes which is not good.\n\n> Well, the test suite fails:\n> * FAIL 4: am --abort goes back after failed am\n> \n>                         git-am --abort &&\n>                         git rev-parse HEAD >actual &&\n>                         git rev-parse initial >expect &&\n>                         test_cmp expect actual &&\n>   here>                 test_cmp file-2-expect file-2 &&\n\nLocal changes have been lost.\n\n> The reason of my question was that I *blindly* incorporated the change into\n> sequencer to make it able to work on a dirty working tree and thus to be\n> able to migrate am onto it without losing the ability to apply patches\n> on a dirty working tree....\n\nAre you talking about your seq-proto-dev3 branch?\n\n> All am tests applied afterwards, but the sequencer and the rebase-i\n> test suite failed in a place where I didn't expect it. I *then* had\n> a deeper look at the read-tree line and I was wondering what the \"HEAD\"\n> should achieve.\n> I removed it and all tests passed. (I didn't have t4151 in my branch\n> at that point.)\n> \n> Now, because t4151 does not pass, I am wondering what's the best thing\n> I could do...\n\nI looked at your code. You use reset_almost_hard() instead of \"reset --hard\",\nit's fine but you does not update require_clean_work_tree() to be less\nrestrictive and let the sequencer work with local modifications. Those two\nlines must be removed, I think:\n  git update-index --ignore-submodules --refresh &&\n  git diff-files --quiet --ignore-submodules &&\n\nTry that with the original read-tree line and t4151 should pass.\n\nAh, you should change \"Applying 6\" with \"Applying \\\"6\\\"\" in t4151-am-abort.sh\ntoo.\n\nOlivier.\n"},{"id":"84545","messageId":"20080723164739.GB17648@leksak.fem-net","threadId":"14470","inReplyTo":"48874617.3010108@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-23T16:47:39Z","receivedAt":"2008-07-23T16:47:39Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nOlivier Marin wrote:\n> > The reason of my question was that I *blindly* incorporated the change into\n> > sequencer to make it able to work on a dirty working tree and thus to be\n> > able to migrate am onto it without losing the ability to apply patches\n> > on a dirty working tree....\n> \n> Are you talking about your seq-proto-dev3 branch?\n\nRight, and your suggested changes are right, too, and I've incorporated\nthem yesterday (with an --allow-dirty option) but I hadn't commited them...\n(Hence, not pushed.)\n\n> > Now, because t4151 does not pass, I am wondering what's the best thing\n> > I could do...\n\nWell, that was solved...\nThe problem was that the additional \"HEAD\" (that made t4151 work), resulted\nin untracked files in some test cases of sequencer and rebase-i. Those made\nmerges fail, because these merges would overwrite these files. So the\nmerges failed, and the test cases failed.\n\nI've solved this with the trick that the \"HEAD\" argument is only added if\n--allow-dirty is set (and git-am uses --allow-dirty of course).\n\nThis is perhaps not the cleanest way but seemed to be far more better\nthan forcing overwrites on merges (checkouts, etc.).\n\n> Ah, you should change \"Applying 6\" with \"Applying \\\"6\\\"\" in t4151-am-abort.sh\n> too.\n\nI btw wondered if the quotes are useful in original am.\nWell, I've just sent a patch adding a colon (instead of quotes). Let's\nsee ;)\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"84568","messageId":"7v1w1ke9k5.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"488722F5.9030602@free.fr","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-23T18:31:54Z","receivedAt":"2008-07-23T18:31:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Olivier Marin <dkr+ml.git@free.fr> writes:\n\n> Junio C Hamano a écrit :\n>>> diff --git a/git-am.sh b/git-am.sh\n>> ...\n>>> @@ -202,8 +202,15 @@ then\n>> ...\n>>> +\tcase \"$skip,$abort\" in\n>>> +\tt,)\n>>> +\t\tgit rerere clear\n>>> +\t\tgit read-tree --reset -u HEAD HEAD\n>>> +\t\torig_head=$(cat \"$GIT_DIR/ORIG_HEAD\")\n>>> +\t\tgit reset HEAD\n>>> +\t\tgit update-ref ORIG_HEAD $orig_head\n>>> +\t\t;;\n>> ...\n> I add reset to unstage paths with no conflict that are left behind.\n\nDoes removing the last three lines (1) change the behaviour?  (2) break any test?\n\nIf the answers are \"Yes and No\", we would need a few more tests in the\ntestsuite.\n\nIf the answers are \"No and naturally no\", then let's remove the last three\nlines in the hunk.\n"},{"id":"84604","messageId":"7vod4obahd.fsf@gitster.siamese.dyndns.org","threadId":"14470","inReplyTo":"20080723011341.GE5904@leksak.fem-net","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-23T20:40:14Z","receivedAt":"2008-07-23T20:40:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>> Just being a bit defensive -- in this case I think it might be Ok to say\n>> \"read-tree --reset -u ORIG_HEAD\", but I haven't checked in a conflicted\n>> case.\n>\n> Well, the test suite fails:\n> ...\n> So no reason to be defensive ;)\n\nOk, so it is not just being defensive but actually is necessary.\n"},{"id":"84710","messageId":"48887938.3060406@free.fr","threadId":"14470","inReplyTo":"7v1w1ke9k5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Rename \".dotest/\" to \".git/rebase\" and \".dotest-merge\" to \"rebase-merge\"","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-07-24T12:44:40Z","receivedAt":"2008-07-24T12:44:40Z","isPatch":true,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Junio C Hamano a écrit :\n> Olivier Marin <dkr+ml.git@free.fr> writes:\n> \n>> Junio C Hamano a écrit :\n>>>> diff --git a/git-am.sh b/git-am.sh\n>>> ...\n>>>> @@ -202,8 +202,15 @@ then\n>>> ...\n>>>> +\tcase \"$skip,$abort\" in\n>>>> +\tt,)\n>>>> +\t\tgit rerere clear\n>>>> +\t\tgit read-tree --reset -u HEAD HEAD\n>>>> +\t\torig_head=$(cat \"$GIT_DIR/ORIG_HEAD\")\n>>>> +\t\tgit reset HEAD\n>>>> +\t\tgit update-ref ORIG_HEAD $orig_head\n>>>> +\t\t;;\n>>> ...\n>> I add reset to unstage paths with no conflict that are left behind.\n> \n> Does removing the last three lines (1) change the behaviour?  (2) break any test?\n> \n> If the answers are \"Yes and No\", we would need a few more tests in the\n> testsuite.\n\nThe answers are \"Yes and No\" and test case update follow.\n\n-- >8 --\nFrom: Olivier Marin <dkr@freesurf.fr>\n[PATCH] update test case to protect am --skip behaviour\n\nSigned-off-by: Olivier Marin <dkr@freesurf.fr>\n---\n t/t4151-am-abort.sh |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh\nindex f45ab0a..7d86cdf 100755\n--- a/t/t4151-am-abort.sh\n+++ b/t/t4151-am-abort.sh\n@@ -17,6 +17,8 @@ test_expect_success setup '\n \tfor i in 2 3 4 5 6\n \tdo\n \t\techo $i >>file-1 &&\n+\t\techo $i >otherfile-$i &&\n+\t\tgit add otherfile-$i &&\n \t\ttest_tick &&\n \t\tgit commit -a -m $i || break\n \tdone &&\n-- \n1.6.0.rc0.44.gd618.dirty\n"}]}