{"thread":{"id":"33802","subject":"[PATCH v3 0/7] rebase.autostash completed","startedAt":"2013-05-12T11:56:34Z","lastAt":"2013-05-13T14:56:42Z","messageCount":22,"participants":["Ramkumar Ramachandra","Junio C Hamano","Matthieu Moy"],"isPatch":true,"patchVersion":3,"patchTotal":7},"messages":[{"id":"217067","messageId":"1368359801-28121-1-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":null,"subject":"[PATCH v3 0/7] rebase.autostash completed","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:34Z","receivedAt":"2013-05-12T11:56:34Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Minor changes since v2 in response to reviews by Junio and Eric\nSunshine.\n\nShould be ready to merge soon.\n\nRamkumar Ramachandra (7):\n  am: tighten a conditional that checks for $dotest\n  rebase -i: don't error out if $state_dir already exists\n  rebase: prepare to do generic housekeeping\n  am: return control to caller, for housekeeping\n  rebase -i: return control to caller, for housekeeping\n  rebase --merge: return control to caller, for housekeeping\n  rebase: implement --[no-]autostash and rebase.autostash\n\n Documentation/config.txt     |   8 +++\n Documentation/git-rebase.txt |  10 +++\n git-am.sh                    |  13 +++-\n git-rebase--am.sh            |   8 +--\n git-rebase--interactive.sh   |  11 ++--\n git-rebase--merge.sh         |   5 +-\n git-rebase.sh                |  46 +++++++++++++-\n t/t3420-rebase-autostash.sh  | 148 +++++++++++++++++++++++++++++++++++++++++++\n 8 files changed, 233 insertions(+), 16 deletions(-)\n create mode 100755 t/t3420-rebase-autostash.sh\n\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217068","messageId":"1368359801-28121-2-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 1/7] am: tighten a conditional that checks for $dotest","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:35Z","receivedAt":"2013-05-12T11:56:35Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"In preparation for a later patch that creates $dotest/autostash in\ngit-rebase.sh before anything else happens, don't assume that the\npresence of a $dotest directory implies the existence of the\n$dotest/next and $dotest/last files.  Look for them explicitly.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-am.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex c092855..ccb854a 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -446,6 +446,8 @@ done\n # If the dotest directory exists, but we have finished applying all the\n # patches in them, clear it out.\n if test -d \"$dotest\" &&\n+   test -f \"$dotest/last\" &&\n+   test -f \"$dotest/next\" &&\n    last=$(cat \"$dotest/last\") &&\n    next=$(cat \"$dotest/next\") &&\n    test $# != 0 &&\n@@ -454,7 +456,7 @@ then\n    rm -fr \"$dotest\"\n fi\n \n-if test -d \"$dotest\"\n+if test -d \"$dotest\" && test -f \"$dotest/last\" && test -f \"$dotest/next\"\n then\n \tcase \"$#,$skip$resolved$abort\" in\n \t0,*t*)\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217073","messageId":"1368359801-28121-3-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 2/7] rebase -i: don't error out if $state_dir already exists","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:36Z","receivedAt":"2013-05-12T11:56:36Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"In preparation for a later patch that will create $state_dir/autostash\nin git-rebase.sh before anything else can happen, change a `mkdir\n$state_dir` call to `mkdir -p $state_dir`.  The change is safe,\nbecause this is not a test to detect an in-progress rebase (that is\nalready done much earlier in git-rebase.sh).\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-rebase--interactive.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 5822b2c..3411139 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -842,7 +842,7 @@ then\n fi\n \n orig_head=$(git rev-parse --verify HEAD) || die \"No HEAD?\"\n-mkdir \"$state_dir\" || die \"Could not create temporary $state_dir\"\n+mkdir -p \"$state_dir\" || die \"Could not create temporary $state_dir\"\n \n : > \"$state_dir\"/interactive || die \"Could not mark as interactive\"\n write_basic_state\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217070","messageId":"1368359801-28121-4-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 3/7] rebase: prepare to do generic housekeeping","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:37Z","receivedAt":"2013-05-12T11:56:37Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"On successful completion of a rebase in git-rebase--$backend.sh, the\n$backend script cleans up on its own and exits.  The cleanup routine\nis however, independent of the $backend, and each $backend script\nunnecessarily duplicates this work:\n\n    rm -rf \"$state_dir\"\n    git gc --auto\n\nPrepare git-rebase.sh for later patches that return control from each\n$backend script back to us, for performing this generic cleanup\nroutine.  The code that this patch adds is currently unreachable, and\nwill only start to be used when git-rebase--$backend.sh scripts are\ntaught to return control in later patches.\n\nAnother advantage is that git-rebase.sh can implement a generic\nfinish_rebase() to possibly do additional tasks in addition to the\ncleanup.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-rebase.sh | 7 +++++++\n 1 file changed, 7 insertions(+)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 2c692c3..f8b533d 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -150,6 +150,13 @@ run_specific_rebase () {\n \t\tautosquash=\n \tfi\n \t. git-rebase--$type\n+\tret=$?\n+\tif test $ret -eq 0\n+\tthen\n+\t\tgit gc --auto &&\n+\t\trm -rf \"$state_dir\"\n+\tfi\n+\texit $ret\n }\n \n run_pre_rebase_hook () {\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217069","messageId":"1368359801-28121-5-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 4/7] am: return control to caller, for housekeeping","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:38Z","receivedAt":"2013-05-12T11:56:38Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"We only need to do these two tasks\n\n    git gc --auto\n    rm -fr \"$dotest\"\n\nourselves if the script was invoked as a standalone program; when\ninvoked with --rebasing (from git-rebase--am.sh), cascade control back\nto the ultimate caller git-rebase.sh to do this for us.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-am.sh         | 9 +++++++--\n git-rebase--am.sh | 8 ++++----\n 2 files changed, 11 insertions(+), 6 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex ccb854a..1cf3d1d 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -906,5 +906,10 @@ if test -s \"$dotest\"/rewritten; then\n     fi\n fi\n \n-rm -fr \"$dotest\"\n-git gc --auto\n+# If am was called with --rebasing (from git-rebase--am), it's up to\n+# the caller to take care of housekeeping.\n+if ! test -f \"$dotest/rebasing\"\n+then\n+\trm -fr \"$dotest\"\n+\tgit gc --auto\n+fi\ndiff --git a/git-rebase--am.sh b/git-rebase--am.sh\nindex f84854f..34e3102 100644\n--- a/git-rebase--am.sh\n+++ b/git-rebase--am.sh\n@@ -7,12 +7,12 @@ case \"$action\" in\n continue)\n \tgit am --resolved --resolvemsg=\"$resolvemsg\" &&\n \tmove_to_original_branch\n-\texit\n+\treturn\n \t;;\n skip)\n \tgit am --skip --resolvemsg=\"$resolvemsg\" &&\n \tmove_to_original_branch\n-\texit\n+\treturn\n \t;;\n esac\n \n@@ -56,7 +56,7 @@ else\n \n \t\tAs a result, git cannot rebase them.\n \t\tEOF\n-\t\texit $?\n+\t\treturn $?\n \tfi\n \n \tgit am $git_am_opt --rebasing --resolvemsg=\"$resolvemsg\" <\"$GIT_DIR/rebased-patches\"\n@@ -68,7 +68,7 @@ fi\n if test 0 != $ret\n then\n \ttest -d \"$state_dir\" && write_basic_state\n-\texit $ret\n+\treturn $ret\n fi\n \n move_to_original_branch\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217071","messageId":"1368359801-28121-6-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 5/7] rebase -i: return control to caller, for housekeeping","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:39Z","receivedAt":"2013-05-12T11:56:39Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Return control to the caller git-rebase.sh to get these two tasks\n\n    rm -fr \"$dotest\"\n    git gc --auto\n\ndone by it.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-rebase--interactive.sh | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3411139..f953d8d 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -628,17 +628,16 @@ do_next () {\n \t\t\"$GIT_DIR\"/hooks/post-rewrite rebase < \"$rewritten_list\"\n \t\ttrue # we don't care if this hook failed\n \tfi &&\n-\trm -rf \"$state_dir\" &&\n-\tgit gc --auto &&\n \twarn \"Successfully rebased and updated $head_name.\"\n \n-\texit\n+\treturn 1 # not failure; just to break the do_rest loop\n }\n \n+# can only return 0, when the infinite loop breaks\n do_rest () {\n \twhile :\n \tdo\n-\t\tdo_next\n+\t\tdo_next || break\n \tdone\n }\n \n@@ -805,11 +804,13 @@ first and then run 'git rebase --continue' again.\"\n \n \trequire_clean_work_tree \"rebase\"\n \tdo_rest\n+\treturn 0\n \t;;\n skip)\n \tgit rerere clear\n \n \tdo_rest\n+\treturn 0\n \t;;\n edit-todo)\n \tgit stripspace --strip-comments <\"$todo\" >\"$todo\".new\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217072","messageId":"1368359801-28121-7-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 6/7] rebase --merge: return control to caller, for housekeeping","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:40Z","receivedAt":"2013-05-12T11:56:40Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Return control to the caller git-rebase.sh to get these two tasks\n\n    rm -fr \"$dotest\"\n    git gc --auto\n\ndone by it.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n git-rebase--merge.sh | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-rebase--merge.sh b/git-rebase--merge.sh\nindex b10f2cf..16d1817 100644\n--- a/git-rebase--merge.sh\n+++ b/git-rebase--merge.sh\n@@ -96,7 +96,6 @@ finish_rb_merge () {\n \t\t\t\"$GIT_DIR\"/hooks/post-rewrite rebase <\"$state_dir\"/rewritten\n \t\tfi\n \tfi\n-\trm -r \"$state_dir\"\n \tsay All done.\n }\n \n@@ -110,7 +109,7 @@ continue)\n \t\tcontinue_merge\n \tdone\n \tfinish_rb_merge\n-\texit\n+\treturn\n \t;;\n skip)\n \tread_state\n@@ -122,7 +121,7 @@ skip)\n \t\tcontinue_merge\n \tdone\n \tfinish_rb_merge\n-\texit\n+\treturn\n \t;;\n esac\n \n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217074","messageId":"1368359801-28121-8-git-send-email-artagnon@gmail.com","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-12T11:56:41Z","receivedAt":"2013-05-12T11:56:41Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"This new feature allows a rebase to be executed on a dirty worktree or\nindex.  It works by creating a temporary \"dangling merge commit\" out\nof the worktree and index changes (via 'git stash create'), and\nautomatically applying it after a successful rebase or abort.\n\nrebase stores the SHA-1 hex of the temporary merge commit, along with\nthe rest of the rebase state, in either\n.git/{rebase-merge,rebase-apply}/autostash depending on the kind of\nrebase.  Since $state_dir is automatically removed at the end of a\nsuccessful rebase or abort, so is the autostash.\n\nThe advantage of this approach is that we do not affect the normal\nstash's reflogs, making the autostash invisible to the end-user.  This\nmeans that you can use 'git stash' during a rebase as usual.\n\nWhen the autostash application results in a conflict, we push\n$state_dir/autostash onto the normal stash and remove $state_dir\nending the rebase.  The user can inspect the stash, and pop or drop at\nany time.\n\nMost significantly, this feature means that a caller like pull (with\npull.rebase set to true) can easily be patched to remove the\nrequire_clean_work_tree restriction.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/config.txt     |   8 +++\n Documentation/git-rebase.txt |  10 +++\n git-rebase.sh                |  43 ++++++++++++-\n t/t3420-rebase-autostash.sh  | 148 +++++++++++++++++++++++++++++++++++++++++++\n 4 files changed, 206 insertions(+), 3 deletions(-)\n create mode 100755 t/t3420-rebase-autostash.sh\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 6e53fc5..7fd4035 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1867,6 +1867,14 @@ rebase.stat::\n rebase.autosquash::\n \tIf set to true enable '--autosquash' option by default.\n \n+rebase.autostash::\n+\tWhen set to true, automatically create a temporary stash\n+\tbefore the operation begins, and apply it after the operation\n+\tends.  This means that you can run rebase on a dirty worktree.\n+\tHowever, use with care: the final stash application after a\n+\tsuccessful rebase might result in non-trivial conflicts.\n+\tDefaults to false.\n+\n receive.autogc::\n \tBy default, git-receive-pack will run \"git-gc --auto\" after\n \treceiving data from git-push and updating refs.  You can stop\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex aca8405..c84854a 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -208,6 +208,9 @@ rebase.stat::\n rebase.autosquash::\n \tIf set to true enable '--autosquash' option by default.\n \n+rebase.autostash::\n+\tIf set to true enable '--autostash' option by default.\n+\n OPTIONS\n -------\n --onto <newbase>::\n@@ -394,6 +397,13 @@ If the '--autosquash' option is enabled by default using the\n configuration variable `rebase.autosquash`, this option can be\n used to override and disable this setting.\n \n+--[no-]autostash::\n+\tAutomatically create a temporary stash before the operation\n+\tbegins, and apply it after the operation ends.  This means\n+\tthat you can run rebase on a dirty worktree.  However, use\n+\twith care: the final stash application after a successful\n+\trebase might result in non-trivial conflicts.\n+\n --no-ff::\n \tWith --interactive, cherry-pick all rebased commits instead of\n \tfast-forwarding over the unchanged ones.  This ensures that the\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex f8b533d..709ef6b 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -13,6 +13,7 @@ git-rebase --continue | --abort | --skip | --edit-todo\n  Available options are\n v,verbose!         display a diffstat of what changed upstream\n q,quiet!           be quiet. implies --no-stat\n+autostash!         automatically stash/stash pop before and after\n onto=!             rebase onto given branch instead of upstream\n p,preserve-merges! try to recreate merges instead of ignoring them\n s,strategy=!       use the given merge strategy\n@@ -64,6 +65,7 @@ apply_dir=\"$GIT_DIR\"/rebase-apply\n verbose=\n diffstat=\n test \"$(git config --bool rebase.stat)\" = true && diffstat=t\n+autostash=\"$(git config --bool rebase.autostash || echo false)\"\n git_am_opt=\n rebase_root=\n force_rebase=\n@@ -143,6 +145,28 @@ move_to_original_branch () {\n \tesac\n }\n \n+finish_rebase () {\n+\tif test -f \"$state_dir/autostash\"\n+\tthen\n+\t\tstash_sha1=$(cat \"$state_dir/autostash\")\n+\t\tif git stash apply $stash_sha1 2>&1 >/dev/null\n+\t\tthen\n+\t\t\techo \"Applied autostash\"\n+\t\telse\n+\t\t\tref_stash=refs/stash &&\n+\t\t\t: >>\"$GIT_DIR/logs/$ref_stash\" &&\n+\t\t\tgit update-ref -m \"autostash\" $ref_stash $stash_sha1 \\\n+\t\t\t\t|| die \"$(eval_gettext 'Cannot store $stash_sha1')\"\n+\t\t\techo \"\n+$(gettext 'Applying autostash resulted in conflicts.\n+Your changes are safe in the stash.\n+You can apply or drop it at any time.')\"\n+\t\tfi\n+\tfi\n+\tgit gc --auto &&\n+\trm -rf \"$state_dir\"\n+}\n+\n run_specific_rebase () {\n \tif [ \"$interactive_rebase\" = implied ]; then\n \t\tGIT_EDITOR=:\n@@ -153,8 +177,7 @@ run_specific_rebase () {\n \tret=$?\n \tif test $ret -eq 0\n \tthen\n-\t\tgit gc --auto &&\n-\t\trm -rf \"$state_dir\"\n+\t\tfinish_rebase\n \tfi\n \texit $ret\n }\n@@ -248,6 +271,9 @@ do\n \t--stat)\n \t\tdiffstat=t\n \t\t;;\n+\t--autostash)\n+\t\tautostash=true\n+\t\t;;\n \t-v)\n \t\tverbose=t\n \t\tdiffstat=t\n@@ -348,7 +374,7 @@ abort)\n \t\t;;\n \tesac\n \toutput git reset --hard $orig_head\n-\trm -r \"$state_dir\"\n+\tfinish_rebase\n \texit\n \t;;\n edit-todo)\n@@ -487,6 +513,17 @@ case \"$#\" in\n \t;;\n esac\n \n+if test \"$autostash\" = true && ! (require_clean_work_tree) 2>/dev/null\n+then\n+\tstash_sha1=$(git stash create \"autostash\") \\\n+\t\t|| die \"$(gettext 'Cannot autostash')\"\n+\tmkdir -p \"$state_dir\" &&\n+\techo $stash_sha1 >\"$state_dir/autostash\" &&\n+\tstash_abbrev=$(git rev-parse --short $stash_sha1) &&\n+\techo \"$(eval_gettext 'Created autostash: $stash_abbrev')\" &&\n+\tgit reset --hard\n+fi\n+\n require_clean_work_tree \"rebase\" \"$(gettext \"Please commit or stash them.\")\"\n \n # Now we are rebasing commits $upstream..$orig_head (or with --root,\ndiff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh\nnew file mode 100755\nindex 0000000..479cbb2\n--- /dev/null\n+++ b/t/t3420-rebase-autostash.sh\n@@ -0,0 +1,148 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2013 Ramkumar Ramachandra\n+#\n+\n+test_description='git rebase --autostash tests'\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\techo hello-world >file0 &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m \"initial commit\" &&\n+\tgit checkout -b feature-branch &&\n+\techo another-hello >file1 &&\n+\techo goodbye >file2 &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m \"second commit\" &&\n+\techo final-goodbye >file3 &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m \"third commit\" &&\n+\tgit checkout -b unrelated-onto-branch master &&\n+\techo unrelated >file4 &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m \"unrelated commit\" &&\n+\tgit checkout -b related-onto-branch master &&\n+\techo conflicting-change >file2 &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m \"related commit\"\n+'\n+\n+testrebase() {\n+\ttype=$1\n+\tdotest=$2\n+\n+\ttest_expect_success \"rebase$type: dirty worktree, non-conflicting rebase\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\tgit rebase$type unrelated-onto-branch &&\n+\t\tgrep unrelated file4 &&\n+\t\tgrep dirty file3 &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: dirty index, non-conflicting rebase\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\tgit add file3 &&\n+\t\tgit rebase$type unrelated-onto-branch &&\n+\t\tgrep unrelated file4 &&\n+\t\tgrep dirty file3 &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: conflicting rebase\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\ttest_must_fail git rebase$type related-onto-branch &&\n+\t\ttest_path_is_file $dotest/autostash &&\n+\t\t! grep dirty file3 &&\n+\t\trm -rf $dotest &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: --continue\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\ttest_must_fail git rebase$type related-onto-branch &&\n+\t\ttest_path_is_file $dotest/autostash &&\n+\t\t! grep dirty file3 &&\n+\t\techo \"conflicting-plus-goodbye\" >file2 &&\n+\t\tgit add file2 &&\n+\t\tgit rebase --continue &&\n+\t\ttest_path_is_missing $dotest/autostash &&\n+\t\tgrep dirty file3 &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: --skip\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\ttest_must_fail git rebase$type related-onto-branch &&\n+\t\ttest_path_is_file $dotest/autostash &&\n+\t\t! grep dirty file3 &&\n+\t\tgit rebase --skip &&\n+\t\ttest_path_is_missing $dotest/autostash &&\n+\t\tgrep dirty file3 &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: --abort\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >>file3 &&\n+\t\ttest_must_fail git rebase$type related-onto-branch &&\n+\t\ttest_path_is_file $dotest/autostash &&\n+\t\t! grep dirty file3 &&\n+\t\tgit rebase --abort &&\n+\t\ttest_path_is_missing $dotest/autostash &&\n+\t\tgrep dirty file3 &&\n+\t\tgit checkout feature-branch\n+\t'\n+\n+\ttest_expect_success \"rebase$type: non-conflicting rebase, conflicting stash\" '\n+\t\ttest_config rebase.autostash true &&\n+\t\tgit reset --hard &&\n+\t\tgit checkout -b rebased-feature-branch feature-branch &&\n+\t\ttest_when_finished git branch -D rebased-feature-branch &&\n+\t\techo dirty >file4 &&\n+\t\tgit add file4 &&\n+\t\tgit rebase$type unrelated-onto-branch &&\n+\t\ttest_path_is_missing $dotest &&\n+\t\tgit reset --hard &&\n+\t\tgrep unrelated file4 &&\n+\t\t! grep dirty file4 &&\n+\t\tgit checkout feature-branch &&\n+\t\tgit stash pop &&\n+\t\tgrep dirty file4\n+\t'\n+}\n+\n+testrebase \"\" .git/rebase-apply\n+testrebase \" --merge\" .git/rebase-merge\n+testrebase \" --interactive\" .git/rebase-merge\n+\n+test_done\n-- \n1.8.3.rc1.51.gd7a04de\n"},{"id":"217116","messageId":"7vy5bjqxxa.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"1368359801-28121-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T04:57:37Z","receivedAt":"2013-05-13T04:57:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Minor changes since v2 in response to reviews by Junio and Eric\n> Sunshine.\n>\n> Should be ready to merge soon.\n\nThat, and the \"completed\" on the Subject line are not for you to\ndecide, I would have to say ;-)\n\nOverall the patches look cleanly done, but I did not carefully look\ninto the implementation.  Especially I did not check if there are\nstill undesirable data loss behaviour in corner cases that people\nwere worried about in the discussion.  It would have been nice to CC\npeople who voiced concerns during the previous reviews.\n\nA few comments on possible follow-up work, not meant as a suggestion\nto include in this series:\n\n * The series shows that it is necessary to first prepare a stash\n   entry with \"stash create\", then later decide to queue it to the\n   stash (or decide not to do so) in some applications.\n\n   In the longer term, it is unmaintainable to make such users (like\n   this new code) of the stash mechanism manually do so, and we may\n   want to add a \"git stash __store\" subcommand, not meant for the\n   interactive use of end users.  The implementation of the stash\n   can later be changed without affecting such users by doing so.\n\n * The primary reason why you wanted this autostash was because\n   \"rebase\" is implemented in a lazy and stupid way, compared to\n   \"merge\" that detects possible conflicts with local changes and\n   refrains from touching the working tree at all, and any local\n   change that do not interfere with the merge are permitted.\n\n   Perhaps \"rebase\" can be taught to be more careful when checking\n   if local changes may overlap with the changes being replayed.\n   When replaying a range A..B on top of the onto commit O, perhaps\n   \"rebase\" can at least do these:\n\n    - If the index is dirty with respect to HEAD, stop just like\n      \"merge\" does.\n\n    - Take a union of paths different between O and the working\n      tree, and untracked new paths in the working tree.  These are\n      the possible \"local changes\".  If there is no way the replay\n      of A..B touches any of these paths, we do not even have to\n      worry about stashing.\n\n    - Take output from \"diff-tree -m --name-only\" for each commit in\n      the replayed range (note that I am not adding -M to take\n      maximal coverage).  Check if any of the paths overlap with the\n      \"local changes\", and if so, stop.\n\n   to be par with \"merge\". \n\nWhen the latter is done, there is _no_ justification for autostash\nto be an option specific fo \"rebase.  At that point, \"rebase\" and\n\"merge\" would refuse to start in the same situation, i.e. the local\nchanges you have are known to interfere with the integration with\nthe branch, diminishing the need to \"autostash\" greatly.\n\nWhen autostash is still needed to proceed after such change to\n\"rebase\", I suspect that the user may be better off saving such\nwork-in-progress in a temporary commit (possibly after making it\ninto a better shape before even starting to \"rebase\" or \"merge\")\nthan using a transient mechanism like stash to save such a work,\nbecause it is likely that such local changes have a real conflict\nwith the work being integrated.\n\nThose who still want to use stash would benefit from having an\nautostash, but at that point, there is no reason to single out\n\"rebase\" for the autostash feature.  Those who want to stash\nimmediately before a \"merge\" that is known to conflict can use the\nsame autostash and may want to do so for exactly the same reason\nthey may want to use it for \"rebase\".\n"},{"id":"217122","messageId":"7vd2svqtqd.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"1368359801-28121-8-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T06:28:10Z","receivedAt":"2013-05-13T06:28:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> +finish_rebase () {\n> +\tif test -f \"$state_dir/autostash\"\n> +\tthen\n> +\t\tstash_sha1=$(cat \"$state_dir/autostash\")\n> +\t\tif git stash apply $stash_sha1 2>&1 >/dev/null\n> +\t\tthen\n> +\t\t\techo \"Applied autostash\"\n> +\t\telse\n> +\t\t\tref_stash=refs/stash &&\n> +\t\t\t: >>\"$GIT_DIR/logs/$ref_stash\" &&\n> +\t\t\tgit update-ref -m \"autostash\" $ref_stash $stash_sha1 \\\n> +\t\t\t\t|| die \"$(eval_gettext 'Cannot store $stash_sha1')\"\n\nWriting it like this:\n\n\t\t\tref_stash=refs/stash &&\n\t\t\t: >>\"$GIT_DIR/logs/$ref_stash\" &&\n\t\t\tgit update-ref -m \"autostash\" $ref_stash $stash_sha1 ||\n\t\t\tdie \"$(eval_gettext 'Cannot store $stash_sha1')\"\n\nwith a blank line before the next \"echo\", it would be more readable.\n\nAs I said in a separate message, having a code that knows where\n\"stash\" is and how it is organized outside the implementation of\n\"git stash\" is less than ideal.  It probably makes more sense to\nlet programs like this to say:\n\n\t\t\tgit stash store -m \"autostash\" $stash_sha1 || exit\n\n\n> +\t\t\techo \"\n> +$(gettext 'Applying autostash resulted in conflicts.\n> +Your changes are safe in the stash.\n> +You can apply or drop it at any time.')\"\n\nThis feels funny.  Why not\n\n\t\t\tgettext \"$msg\"\n\nwithout an extra command substitution with an echo?\n"},{"id":"217135","messageId":"CALkWK0mWRC9_QVYAu9Q4iAoVTpfkf9xkc9apjrdv6SyEiCq+hA@mail.gmail.com","threadId":"33802","inReplyTo":"7vy5bjqxxa.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-13T07:59:29Z","receivedAt":"2013-05-13T07:59:29Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> Especially I did not check if there are\n> still undesirable data loss behaviour in corner cases that people\n> were worried about in the discussion.\n\nCheck the tests.  What am I missing?\n\n>    In the longer term, it is unmaintainable to make such users (like\n>    this new code) of the stash mechanism manually do so, and we may\n>    want to add a \"git stash __store\" subcommand, not meant for the\n>    interactive use of end users.  The implementation of the stash\n>    can later be changed without affecting such users by doing so.\n\nYes, a \"store\" that stores a commit created with \"create\" would be\nnice.  Why the horrible double-underscore though?  \"git stash create\"\nis not meant for interactive use of end users either.\n\n>    Perhaps \"rebase\" can be taught to be more careful when checking\n>    if local changes may overlap with the changes being replayed.\n\nFrankly, I don't know if it's worth the effort.  It might be a nice\ntheoretical exercise, but what tangible benefit do I get as the end\nuser (now that I have rebase.autostash)?  In fact, I'll probably be\nslowing down the interactive rebase noticeably by executing a\ndiff-tree at every step.  And for what?\n\n> Those who still want to use stash would benefit from having an\n> autostash, but at that point, there is no reason to single out\n> \"rebase\" for the autostash feature.  Those who want to stash\n> immediately before a \"merge\" that is known to conflict can use the\n> same autostash and may want to do so for exactly the same reason\n> they may want to use it for \"rebase\".\n\nEach command that wants to have autostash will have to implement it\nindependently.  You argued that an implicit merge.autostash may be\nharmful earlier: maybe an explicit --autostash; but at this point, the\nreturns are diminishing: what is the great advantage of --autostash\nover a quick manual g ss, g sp (git stash save, git stash pop)?  I\ndon't know what problem you're trying to solve anymore.\n"},{"id":"217137","messageId":"CALkWK0nP=RmJHjcFUG2u4pz1ORtPhR7bzi3VvTE=7ggnKbjaQA@mail.gmail.com","threadId":"33802","inReplyTo":"7vd2svqtqd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-13T08:03:50Z","receivedAt":"2013-05-13T08:03:50Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> Writing it like this:\n> [...]\n> with a blank line before the next \"echo\", it would be more readable.\n\n> This feels funny.  Why not\n> [...]\n> without an extra command substitution with an echo?\n\nI'll re-roll if there are more comments.  Otherwise, can you fix these\nup locally?  Thanks.\n\n>                         git stash store -m \"autostash\" $stash_sha1 || exit\n\nDefinitely nicer.  I'll write follow-ups for pull and stash.\n"},{"id":"217140","messageId":"vpq1u9be18t.fsf@grenoble-inp.fr","threadId":"33802","inReplyTo":"1368359801-28121-8-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-05-13T08:24:18Z","receivedAt":"2013-05-13T08:24:18Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> +finish_rebase () {\n> +\tif test -f \"$state_dir/autostash\"\n> +\tthen\n> +\t\tstash_sha1=$(cat \"$state_dir/autostash\")\n> +\t\tif git stash apply $stash_sha1 2>&1 >/dev/null\n> +\t\tthen\n> +\t\t\techo \"Applied autostash\"\n\nAny reason why this is not using gettext and the other messages do.\n\n> +\t\telse\n> +\t\t\tref_stash=refs/stash &&\n> +\t\t\t: >>\"$GIT_DIR/logs/$ref_stash\" &&\n> +\t\t\tgit update-ref -m \"autostash\" $ref_stash $stash_sha1 \\\n> +\t\t\t\t|| die \"$(eval_gettext 'Cannot store $stash_sha1')\"\n> +\t\t\techo \"\n> +$(gettext 'Applying autostash resulted in conflicts.\n> +Your changes are safe in the stash.\n> +You can apply or drop it at any time.')\"\n\nGood idea to put the autostash in an actual stash. Perhaps the message\ncan be made more explicit, e.g. \n\n  You can run \"git stash apply\" or \"git stash drop\" at any time.\n\n(actually, \"git stash pop\" may be a better suggestion to \"git stash\napply\" here).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"217141","messageId":"CALkWK0kRW07qW_A1Rcyx7gML9ZNJ=g-hvE1O==zFpzToQtTg3g@mail.gmail.com","threadId":"33802","inReplyTo":"vpq1u9be18t.fsf@grenoble-inp.fr","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-13T08:27:45Z","receivedAt":"2013-05-13T08:27:45Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Matthieu Moy wrote:\n> Any reason why this is not using gettext and the other messages do.\n>   You can run \"git stash apply\" or \"git stash drop\" at any time.\n\nFixed.  Thanks.\n"},{"id":"217142","messageId":"vpqobcfcmb8.fsf@grenoble-inp.fr","threadId":"33802","inReplyTo":"CALkWK0mWRC9_QVYAu9Q4iAoVTpfkf9xkc9apjrdv6SyEiCq+hA@mail.gmail.com","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-05-13T08:32:11Z","receivedAt":"2013-05-13T08:32:11Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Especially I did not check if there are\n>> still undesirable data loss behaviour in corner cases that people\n>> were worried about in the discussion.\n>\n> Check the tests.  What am I missing?\n\nI didn't do a thorough check, but my earlier comments are taken into\naccount, I didn't see anything wrong and the tests in 7/7 are good.\n\n>>    Perhaps \"rebase\" can be taught to be more careful when checking\n>>    if local changes may overlap with the changes being replayed.\n>\n> Frankly, I don't know if it's worth the effort.  It might be a nice\n> theoretical exercise, but what tangible benefit do I get as the end\n> user (now that I have rebase.autostash)?  In fact, I'll probably be\n> slowing down the interactive rebase noticeably by executing a\n> diff-tree at every step.  And for what?\n\nOne benefit would be to avoid triggering rebuild (and editor reload) by\nkeeping the timestamps intact. But I agree it's probably not worth the\neffort (and definitely isn't in the scope of this series).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"217143","messageId":"vpq8v3jclwi.fsf@grenoble-inp.fr","threadId":"33802","inReplyTo":"CALkWK0kRW07qW_A1Rcyx7gML9ZNJ=g-hvE1O==zFpzToQtTg3g@mail.gmail.com","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-05-13T08:41:01Z","receivedAt":"2013-05-13T08:41:01Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Matthieu Moy wrote:\n>> Any reason why this is not using gettext and the other messages do.\n>>   You can run \"git stash apply\" or \"git stash drop\" at any time.\n>\n> Fixed.  Thanks.\n\nAfter thinking a bit, I have another nit about the message: it's not\nclear whether it's saying \"your changes are in the work tree, but with\nconflicts so you may want to retry later with \"git stash pop\"\", or \"I\ncould not apply your changes at all, do it yourself with \"git stash\npop\"\".\n\nI suppose it's the former, but it could be more explicit.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"217169","messageId":"7v4ne7q9b0.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"CALkWK0nP=RmJHjcFUG2u4pz1ORtPhR7bzi3VvTE=7ggnKbjaQA@mail.gmail.com","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T13:49:23Z","receivedAt":"2013-05-13T13:49:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Writing it like this:\n>> [...]\n>> with a blank line before the next \"echo\", it would be more readable.\n>\n>> This feels funny.  Why not\n>> [...]\n>> without an extra command substitution with an echo?\n>\n> I'll re-roll if there are more comments.  Otherwise, can you fix these\n> up locally?  Thanks.\n\nNo, thanks.  I won't be even taking the patch right now, so you have\nplenty of time ;-).\n"},{"id":"217170","messageId":"CALkWK0nKZNdzT=42Kdq7T0epM=0=5xQGm2ivhAxDXLSbZSC3Rw@mail.gmail.com","threadId":"33802","inReplyTo":"7v4ne7q9b0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-13T13:52:45Z","receivedAt":"2013-05-13T13:52:45Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> No, thanks.  I won't be even taking the patch right now, so you have\n> plenty of time ;-).\n\nThere were some additional comments from Matthieu, so I will re-roll\n(just this part).  I've even posted a stash series based on this one.\nDo you have any additional comments?\n"},{"id":"217175","messageId":"7vr4hbou7d.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"CALkWK0mWRC9_QVYAu9Q4iAoVTpfkf9xkc9apjrdv6SyEiCq+hA@mail.gmail.com","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T14:00:54Z","receivedAt":"2013-05-13T14:00:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Especially I did not check if there are\n>> still undesirable data loss behaviour in corner cases that people\n>> were worried about in the discussion.\n>\n> Check the tests.  What am I missing?\n>\n>>    In the longer term, it is unmaintainable to make such users (like\n>>    this new code) of the stash mechanism manually do so, and we may\n>>    want to add a \"git stash __store\" subcommand, not meant for the\n>>    interactive use of end users.  The implementation of the stash\n>>    can later be changed without affecting such users by doing so.\n>\n> Yes, a \"store\" that stores a commit created with \"create\" would be\n> nice.  Why the horrible double-underscore though?  \"git stash create\"\n> is not meant for interactive use of end users either.\n\n\"create\" is not advertised very widely, but \"store\" is too close to\nwhat is already familiar to the people \"save\" and we really do not\nwant to confuse them.  \"store -m message commit\" sounds as if you\nare creating a stash to apply to the given $commit.\n"},{"id":"217176","messageId":"7vmwrzou4l.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"vpqobcfcmb8.fsf@grenoble-inp.fr","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T14:02:34Z","receivedAt":"2013-05-13T14:02:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> One benefit would be to avoid triggering rebuild (and editor reload) by\n> keeping the timestamps intact. But I agree it's probably not worth the\n> effort (and definitely isn't in the scope of this series).\n\nIt isn't in the scope, of course.  If rebase were done right, the\nseries will become much less necessary in the first place ;-).\n"},{"id":"217179","messageId":"CALkWK0kE9tvNjPW7jH10ZatLHEuqbH+XmovEpp3RPAh1koyvpg@mail.gmail.com","threadId":"33802","inReplyTo":"7vr4hbou7d.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-13T14:17:15Z","receivedAt":"2013-05-13T14:17:15Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> \"create\" is not advertised very widely, but \"store\" is too close to\n> what is already familiar to the people \"save\" and we really do not\n> want to confuse them.  \"store -m message commit\" sounds as if you\n> are creating a stash to apply to the given $commit.\n\nIn the store series I posted a few minutes ago, I use the format\n\"store <commit> <message>\".  I've not advertised it in the usage (like\ncreate), and documented it just like create.  Maybe we should add the\nline \"Not for end user interactive use\" to both descriptions?  We can\nget that double-underscore if you really want, but it'd stick out like\na sore thumb since we can't change create.\n"},{"id":"217190","messageId":"7vppwvnd1x.fsf@alter.siamese.dyndns.org","threadId":"33802","inReplyTo":"CALkWK0kE9tvNjPW7jH10ZatLHEuqbH+XmovEpp3RPAh1koyvpg@mail.gmail.com","subject":"Re: [PATCH v3 0/7] rebase.autostash completed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T14:56:42Z","receivedAt":"2013-05-13T14:56:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Maybe we should add the\n> line \"Not for end user interactive use\" to both descriptions?  We can\n> get that double-underscore if you really want, but it'd stick out like\n> a sore thumb since we can't change create.\n\nYeah, good point about the __name.\n\nIt was a mistake that the description of 'create' does not have\n\"This is probably not what you want to use; see 'save'\" there.\nLet's do that, and do the same for 'store' (that is, not advertise\nin 'git stash -h' output, describe in the manual for scripters, and\nmark it not for the end user in the description).\n"}]}