{"thread":{"id":"25638","subject":"[PATCH] git-rebase--interactive.sh: Add new command \"shell\"","startedAt":"2010-11-04T05:17:16Z","lastAt":"2010-12-03T10:14:45Z","messageCount":39,"participants":["Kevin Ballard","Matthieu Moy","Ævar Arnfjörð Bjarmason","Erik Faye-Lund","Johannes Sixt","Yann Dirson","Eric Raible","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"155136","messageId":"1288847836-84882-1-git-send-email-kevin@sb.org","threadId":"25638","inReplyTo":null,"subject":"[PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T05:17:16Z","receivedAt":"2010-11-04T05:17:16Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Add a new command \"shell\", which takes an option commit. It simply exits\nto the shell with the commit (if given) and a message telling the user how\nto resume the rebase. This is effectively the same thing as \"x false\" but\nmuch friendlier to the user.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\nI discovered the need for this when I wanted to edit a commit, but apply\na fixup first. The only way with the existing tools was an exec command\nthat fails (e.g. \"x false\").\n\n git-rebase--interactive.sh |   21 +++++++++++++++++++++\n 1 files changed, 21 insertions(+), 0 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 9121bb6..3501757 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -566,6 +566,26 @@ do_next () {\n \t\t\texit 1\n \t\tfi\n \t\t;;\n+\t!|\"shell\")\n+\t\tread -r command comment < \"$TODO\"\n+\t\tmark_action_done\n+\t\t# can't use $sha1 here for same reason as \"exec\"\n+\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n+\t\tsha1=\"${line%% *}\"\n+\t\trest=\"${line#* }\"\n+\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\twarn \"Stopped at $sha1... $rest\"\n+\t\tif test -n \"$comment\"; then\n+\t\t\twarn\n+\t\t\twarn \"\t$comment\"\n+\t\tfi\n+\t\twarn\n+\t\twarn \"Once you are ready to continue, run\"\n+\t\twarn\n+\t\twarn \"\tgit rebase --continue\"\n+\t\twarn\n+\t\texit 0\n+\t\t;;\n \t*)\n \t\twarn \"Unknown command: $command $sha1 $rest\"\n \t\tif git rev-parse --verify -q \"$sha1\" >/dev/null\n@@ -1007,6 +1027,7 @@ first and then run 'git rebase --continue' again.\"\n #  s, squash = use commit, but meld into previous commit\n #  f, fixup = like \"squash\", but discard this commit's log message\n #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails\n+#  !, shell = Exit to the shell\n #\n # If you remove a line here THAT COMMIT WILL BE LOST.\n # However, if you remove everything, the rebase will be aborted.\n-- \n1.7.3.2.202.g3b863.dirty\n"},{"id":"155137","messageId":"3014427A-06FC-4EEB-B823-F3716E1DA4E5@sb.org","threadId":"25638","inReplyTo":"1288847836-84882-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T05:22:02Z","receivedAt":"2010-11-04T05:22:02Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 3, 2010, at 10:17 PM, Kevin Ballard wrote:\n\n> Add a new command \"shell\", which takes an option commit. It simply exits\n> to the shell with the commit (if given) and a message telling the user how\n> to resume the rebase. This is effectively the same thing as \"x false\" but\n> much friendlier to the user.\n\nThat was supposed to say \"optional comment\", not \"option commit\". And again\nbelow, \"comment\" not \"commit\".\n\n-Kevin Ballard\n"},{"id":"155139","messageId":"vpq39rhzdht.fsf@bauges.imag.fr","threadId":"25638","inReplyTo":"1288847836-84882-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-11-04T08:42:22Z","receivedAt":"2010-11-04T08:42:22Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> Add a new command \"shell\", which takes an option commit. It simply exits\n> to the shell with the commit (if given) and a message telling the user how\n> to resume the rebase.\n\n\"shell\" sounds like you're going to execute something in a shell, not\nthat you're going back to the shell. Looking at the commit message, I\nthought you had missed the \"exec\" command and re-implemented it.\n\nWhat about \"pause\", abbreviated as \"p\" for the command name?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"155141","messageId":"914D7AE3-22D5-4069-B815-2B11A2897BE9@sb.org","threadId":"25638","inReplyTo":"vpq39rhzdht.fsf@bauges.imag.fr","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T08:53:01Z","receivedAt":"2010-11-04T08:53:01Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 4, 2010, at 1:42 AM, Matthieu Moy wrote:\n\n> Kevin Ballard <kevin@sb.org> writes:\n> \n>> Add a new command \"shell\", which takes an option commit. It simply exits\n>> to the shell with the commit (if given) and a message telling the user how\n>> to resume the rebase.\n> \n> \"shell\" sounds like you're going to execute something in a shell, not\n> that you're going back to the shell. Looking at the commit message, I\n> thought you had missed the \"exec\" command and re-implemented it.\n> \n> What about \"pause\", abbreviated as \"p\" for the command name?\n\nThat sounds like a reasonable suggestion, except \"p\" is already taken by \"pick\".\nI suppose this command could simply omit the short version.\n\n---8<---\nSubject: git-rebase--interactive.sh: Add new command \"pause\"\n\nAdd a new command \"pause\", which takes an optional comment. It simply exits\nto the shell with the comment (if given) and a message telling the user how\nto resume the rebase. This is effectively the same thing as \"x false\" but\nmuch friendlier to the user.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n git-rebase--interactive.sh |   21 +++++++++++++++++++++\n 1 files changed, 21 insertions(+), 0 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex a27952d..e29fd91 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -566,6 +566,26 @@ do_next () {\n \t\t\texit 1\n \t\tfi\n \t\t;;\n+\tpause)\n+\t\tread -r command comment < \"$TODO\"\n+\t\tmark_action_done\n+\t\t# can't use $sha1 here for same reason as \"exec\"\n+\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n+\t\tsha1=\"${line%% *}\"\n+\t\trest=\"${line#* }\"\n+\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\twarn \"Stopped at $sha1... $rest\"\n+\t\tif test -n \"$comment\"; then\n+\t\t\twarn\n+\t\t\twarn \"\t$comment\"\n+\t\tfi\n+\t\twarn\n+\t\twarn \"Once you are ready to continue, run\"\n+\t\twarn\n+\t\twarn \"\tgit rebase --continue\"\n+\t\twarn\n+\t\texit 0\n+\t\t;;\n \t*)\n \t\twarn \"Unknown command: $command $sha1 $rest\"\n \t\tif git rev-parse --verify -q \"$sha1\" >/dev/null\n@@ -998,6 +1018,7 @@ first and then run 'git rebase --continue' again.\"\n #  s, squash = use commit, but meld into previous commit\n #  f, fixup = like \"squash\", but discard this commit's log message\n #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails\n+#  pause = exit to the shell\n #\n # If you remove a line here THAT COMMIT WILL BE LOST.\n # However, if you remove everything, the rebase will be aborted.\n-- \n1.7.3.2.195.gc69dde\n"},{"id":"155145","messageId":"AANLkTimzTzUvoHT9bHve-qvt8V_mvJHmQtgpqY6f_H3u@mail.gmail.com","threadId":"25638","inReplyTo":"914D7AE3-22D5-4069-B815-2B11A2897BE9@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-11-04T09:23:28Z","receivedAt":"2010-11-04T09:23:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Nov 4, 2010 at 09:53, Kevin Ballard <kevin@sb.org> wrote:\n> On Nov 4, 2010, at 1:42 AM, Matthieu Moy wrote:\n>\n>> Kevin Ballard <kevin@sb.org> writes:\n>>\n>>> Add a new command \"shell\", which takes an option commit. It simply exits\n>>> to the shell with the commit (if given) and a message telling the user how\n>>> to resume the rebase.\n>>\n>> \"shell\" sounds like you're going to execute something in a shell, not\n>> that you're going back to the shell. Looking at the commit message, I\n>> thought you had missed the \"exec\" command and re-implemented it.\n>>\n>> What about \"pause\", abbreviated as \"p\" for the command name?\n>\n> That sounds like a reasonable suggestion, except \"p\" is already taken by \"pick\".\n> I suppose this command could simply omit the short version.\n\nI thought \"shell\" would do exactly what your patch does. And it has\nthe \"s\" short version.\n\nSo +1 for \"shell\" from me and -1 for \"pause\", which *does* confuse me.\nI'd expect that\nto just sleep for a few seconds.\n"},{"id":"155146","messageId":"EE792829-6A68-44FB-8C8D-2365DB4E5A5D@sb.org","threadId":"25638","inReplyTo":"AANLkTimzTzUvoHT9bHve-qvt8V_mvJHmQtgpqY6f_H3u@mail.gmail.com","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T09:25:13Z","receivedAt":"2010-11-04T09:25:13Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 4, 2010, at 2:23 AM, Ævar Arnfjörð Bjarmason wrote:\n\n> On Thu, Nov 4, 2010 at 09:53, Kevin Ballard <kevin@sb.org> wrote:\n>> On Nov 4, 2010, at 1:42 AM, Matthieu Moy wrote:\n>> \n>>> Kevin Ballard <kevin@sb.org> writes:\n>>> \n>>>> Add a new command \"shell\", which takes an option commit. It simply exits\n>>>> to the shell with the commit (if given) and a message telling the user how\n>>>> to resume the rebase.\n>>> \n>>> \"shell\" sounds like you're going to execute something in a shell, not\n>>> that you're going back to the shell. Looking at the commit message, I\n>>> thought you had missed the \"exec\" command and re-implemented it.\n>>> \n>>> What about \"pause\", abbreviated as \"p\" for the command name?\n>> \n>> That sounds like a reasonable suggestion, except \"p\" is already taken by \"pick\".\n>> I suppose this command could simply omit the short version.\n> \n> I thought \"shell\" would do exactly what your patch does. And it has\n> the \"s\" short version.\n> \n> So +1 for \"shell\" from me and -1 for \"pause\", which *does* confuse me.\n> I'd expect that\n> to just sleep for a few seconds.\n\n\"s\" is actually taken by \"squash\". That's why my original patch used \"!\",\nthough a user might actually expect \"!\" to do what \"x\" does.\n\n-Kevin Ballard"},{"id":"155148","messageId":"AANLkTinmPF-Q9hy+s5qe_66hLaF=msTh_cFc5uZZQxs-@mail.gmail.com","threadId":"25638","inReplyTo":"EE792829-6A68-44FB-8C8D-2365DB4E5A5D@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-11-04T09:27:18Z","receivedAt":"2010-11-04T09:27:18Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Nov 4, 2010 at 10:25, Kevin Ballard <kevin@sb.org> wrote:\n>> I thought \"shell\" would do exactly what your patch does. And it has\n>> the \"s\" short version.\n>>\n>> So +1 for \"shell\" from me and -1 for \"pause\", which *does* confuse me.\n>> I'd expect that\n>> to just sleep for a few seconds.\n>\n> \"s\" is actually taken by \"squash\". That's why my original patch used \"!\",\n> though a user might actually expect \"!\" to do what \"x\" does.\n\nIndeed, eek!\n"},{"id":"155152","messageId":"AANLkTin7d-RJcy4CHmd5A6LaiphAvHEdbsxJExHt317_@mail.gmail.com","threadId":"25638","inReplyTo":"1288847836-84882-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-11-04T09:36:41Z","receivedAt":"2010-11-04T09:36:41Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Nov 4, 2010 at 6:17 AM, Kevin Ballard <kevin@sb.org> wrote:\n> Add a new command \"shell\", which takes an option commit. It simply exits\n> to the shell with the commit (if given) and a message telling the user how\n> to resume the rebase. This is effectively the same thing as \"x false\" but\n> much friendlier to the user.\n>\n\nI'm sorry if I'm missing something, but how is this different from \"edit\"?\n"},{"id":"155153","messageId":"9C0BAFB4-299E-459B-A64A-54D480C5445D@sb.org","threadId":"25638","inReplyTo":"AANLkTin7d-RJcy4CHmd5A6LaiphAvHEdbsxJExHt317_@mail.gmail.com","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T09:43:41Z","receivedAt":"2010-11-04T09:43:41Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 4, 2010, at 2:36 AM, Erik Faye-Lund wrote:\n\n> On Thu, Nov 4, 2010 at 6:17 AM, Kevin Ballard <kevin@sb.org> wrote:\n>> Add a new command \"shell\", which takes an option commit. It simply exits\n>> to the shell with the commit (if given) and a message telling the user how\n>> to resume the rebase. This is effectively the same thing as \"x false\" but\n>> much friendlier to the user.\n>> \n> \n> I'm sorry if I'm missing something, but how is this different from \"edit\"?\n\nEdit cherry-picks a commit, then exits to the shell. I needed to exit to the\nshell without cherry-picking a commit. As stated in the comments above the\ndiffstat on the patch, the original use case here was something along the\nlines of\n\n  edit 12345 some commit\n  fixup 23456 another commit\n  shell I want to amend the commit after the fixup\n\n-Kevin Ballard\n"},{"id":"155157","messageId":"4CD289EA.7050800@viscovery.net","threadId":"25638","inReplyTo":"914D7AE3-22D5-4069-B815-2B11A2897BE9@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-11-04T10:24:42Z","receivedAt":"2010-11-04T10:24:42Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 11/4/2010 9:53, schrieb Kevin Ballard:\n> +#  pause = exit to the shell\n\nThe short form could be just the dash -. I'd describe the command as\n\n#  pause,- = interrupt automatic processing of commits\n\nor similar to avoid the term \"shell\".\n\n-- Hannes\n"},{"id":"155158","messageId":"20101104112530.5c0e444a@chalon.bertin.fr","threadId":"25638","inReplyTo":"9C0BAFB4-299E-459B-A64A-54D480C5445D@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Yann Dirson","fromEmail":"dirson@bertin.fr","sentAt":"2010-11-04T10:25:30Z","receivedAt":"2010-11-04T10:25:30Z","isPatch":true,"sender":{"key":"dirson@bertin.fr","avatar":null},"body":">> I'm sorry if I'm missing something, but how is this different from\n>> \"edit\"?\n>\n>Edit cherry-picks a commit, then exits to the shell. I needed to exit\n>to the shell without cherry-picking a commit.\n\nIndeed, before \"x false\" was available, I had found out that \"edit\"\nwithout an argument fails with a harmless error and indeed achieves that\n\"pause\" mechanism which was really missing.\n\nWhat about just fixing this so we can use \"edit\" ?  Do we really need\nanother command here ?\n\n-- \nYann Dirson - Bertin Technologies\n"},{"id":"155159","messageId":"AANLkTikbrab3kmDqTCLo_tPeZWm_c-5Yux0FnVmwQE85@mail.gmail.com","threadId":"25638","inReplyTo":"20101104112530.5c0e444a@chalon.bertin.fr","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-11-04T10:40:19Z","receivedAt":"2010-11-04T10:40:19Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Nov 4, 2010 at 11:25 AM, Yann Dirson <dirson@bertin.fr> wrote:\n>>> I'm sorry if I'm missing something, but how is this different from\n>>> \"edit\"?\n>>\n>>Edit cherry-picks a commit, then exits to the shell. I needed to exit\n>>to the shell without cherry-picking a commit.\n>\n\nThen you do \"edit\" on the preceding commit instead, no?\n\n> Indeed, before \"x false\" was available, I had found out that \"edit\"\n> without an argument fails with a harmless error and indeed achieves that\n> \"pause\" mechanism which was really missing.\n>\n> What about just fixing this so we can use \"edit\" ?  Do we really need\n> another command here ?\n>\n\nHaving an parameter-less \"edit\" would indeed be a bit more convenient.\n"},{"id":"155177","messageId":"4CD2E7B4.3000908@nextest.com","threadId":"25638","inReplyTo":"20101104112530.5c0e444a@chalon.bertin.fr","subject":"Re: Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Eric Raible","fromEmail":"raible@nextest.com","sentAt":"2010-11-04T17:04:52Z","receivedAt":"2010-11-04T17:04:52Z","isPatch":true,"sender":{"key":"raible@nextest.com","avatar":null},"body":"On 11:59 AM, Yann Dirson wrote:\n>>> I'm sorry if I'm missing something, but how is this different from\n>>> \"edit\"?\n>>\n>> Edit cherry-picks a commit, then exits to the shell. I needed to exit\n>> to the shell without cherry-picking a commit.\n> \n> Indeed, before \"x false\" was available, I had found out that \"edit\"\n> without an argument fails with a harmless error and indeed achieves that\n> \"pause\" mechanism which was really missing.\n> \n> What about just fixing this so we can use \"edit\" ?  Do we really need\n> another command here ?\n\nFWIW: +1 for edit.\n"},{"id":"155183","messageId":"vpq62wddmc0.fsf@bauges.imag.fr","threadId":"25638","inReplyTo":"4CD2E7B4.3000908@nextest.com","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-11-04T17:34:39Z","receivedAt":"2010-11-04T17:34:39Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Eric Raible <raible@nextest.com> writes:\n\n> On 11:59 AM, Yann Dirson wrote:\n>>>> I'm sorry if I'm missing something, but how is this different from\n>>>> \"edit\"?\n>>>\n>>> Edit cherry-picks a commit, then exits to the shell. I needed to exit\n>>> to the shell without cherry-picking a commit.\n>> \n>> Indeed, before \"x false\" was available, I had found out that \"edit\"\n>> without an argument fails with a harmless error and indeed achieves that\n>> \"pause\" mechanism which was really missing.\n>> \n>> What about just fixing this so we can use \"edit\" ?  Do we really need\n>> another command here ?\n>\n> FWIW: +1 for edit.\n\nI like the idea (and I won't fight for my \"pause\" proposal if others\ndon't find it intuitive), but I'm wondering how to write the quick\ndocumentation (in the todo-list). And if we don't find a concise way\nto document it, it may reveal that it's a bad idea ...\n\nMaybe:\n\n#  e <commit>, edit <commit> = use commit, but stop for amending\n#  e, edit = stop for amending\n\nbut I find this rather ugly.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"155184","messageId":"4CD2F0B0.5060501@nextest.com","threadId":"25638","inReplyTo":"vpq62wddmc0.fsf@bauges.imag.fr","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Eric Raible","fromEmail":"raible@nextest.com","sentAt":"2010-11-04T17:43:12Z","receivedAt":"2010-11-04T17:43:12Z","isPatch":true,"sender":{"key":"raible@nextest.com","avatar":null},"body":"On 11/4/2010 10:34 AM, Matthieu Moy wrote:\n\n> ... And if we don't find a concise way\n> to document it, it may reveal that it's a bad idea ...\n> \n> Maybe:\n> \n> #  e <commit>, edit <commit> = use commit, but stop for amending\n> #  e, edit = stop for amending\n> \n> but I find this rather ugly.\n\nHow about:\n\n#  e [<commit>], edit [<commit>] = use commit (if present) but pause to amend\n"},{"id":"155187","messageId":"20101104181020.GB16431@burratino","threadId":"25638","inReplyTo":"vpq62wddmc0.fsf@bauges.imag.fr","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-04T18:10:20Z","receivedAt":"2010-11-04T18:10:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Matthieu Moy wrote:\n\n> #  e <commit>, edit <commit> = use commit, but stop for amending\n> #  e, edit = stop for amending\n\nBefore it said:\n\n# Commands:\n#  p, pick = use commit\n#  r, reword = use commit, but edit the commit message\n#  e, edit = use commit, but stop for amending\n#  s, squash = use commit, but meld into previous commit\n#  f, fixup = like \"squash\", but discard this commit's log message\n#  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails\n#\n# If you remove a line here THAT COMMIT WILL BE LOST.\n# However, if you remove everything, the rebase will be aborted.\n\nHow about:\n\n# Commands:\n#  p, pick = use commit\n#  r, reword = use commit, but edit the commit message\n#  e, edit = use commit, but stop for amending\n#  s, squash = use commit, but meld into previous commit\n#  f, fixup = like \"squash\", but discard this commit's log message\n#  x, exec = run command using shell, and stop if it fails\n#\n# The argument to edit is optional; if left out, it means to\n# stop to examine or amend the previous commit.\n#\n# If you remove a line here, THAT COMMIT WILL BE LOST.\n# However, if you remove everything, the rebase will be aborted.\n# Use the noop command if you really want to remove all commits.\n\nCiao,\nJonathan\nwho is happy to help paint today\n"},{"id":"155210","messageId":"20101104205307.GA8911@home.lan","threadId":"25638","inReplyTo":"20101104181020.GB16431@burratino","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-04T20:53:08Z","receivedAt":"2010-11-04T20:53:08Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"On Thu, Nov 04, 2010 at 01:10:20PM -0500, Jonathan Nieder wrote:\n> How about:\n> \n> # Commands:\n> #  p, pick = use commit\n> #  r, reword = use commit, but edit the commit message\n> #  e, edit = use commit, but stop for amending\n> #  s, squash = use commit, but meld into previous commit\n> #  f, fixup = like \"squash\", but discard this commit's log message\n> #  x, exec = run command using shell, and stop if it fails\n> #\n> # The argument to edit is optional; if left out, it means to\n> # stop to examine or amend the previous commit.\n> #\n> # If you remove a line here, THAT COMMIT WILL BE LOST.\n> # However, if you remove everything, the rebase will be aborted.\n> # Use the noop command if you really want to remove all commits.\n\nThat may be too far from the \"edit\" line, although I do like the idea\nof mentionning other uses than \"amend\".\n\nEric Raible suggested:\n> How about:\n>\n> #  e [<commit>], edit [<commit>] = use commit (if present) but pause to amend\n\nOther commands do not mention commit (or other things) as a synopsis would.\nWhat about:\n\n#  e, edit = use commit (if specified) but pause to amend/examine/test\n"},{"id":"155212","messageId":"4CD32034.4030104@nextest.com","threadId":"25638","inReplyTo":"20101104205307.GA8911@home.lan","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Eric Raible","fromEmail":"raible@nextest.com","sentAt":"2010-11-04T21:05:56Z","receivedAt":"2010-11-04T21:05:56Z","isPatch":true,"sender":{"key":"raible@nextest.com","avatar":null},"body":"On 11/4/2010 1:53 PM, Yann Dirson wrote:\n\n> Eric Raible suggested:\n>> How about:\n>>\n>> #  e [<commit>], edit [<commit>] = use commit (if present) but pause to amend\n> \n> Other commands do not mention commit (or other things) as a synopsis would.\n> What about:\n> \n> #  e, edit = use commit (if specified) but pause to amend/examine/test\n> .\n\nI like that color better.\n"},{"id":"155218","messageId":"3B610A5B-DE74-4DB1-A61D-13AAF167E36C@sb.org","threadId":"25638","inReplyTo":"20101104205307.GA8911@home.lan","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T21:33:35Z","receivedAt":"2010-11-04T21:33:35Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 4, 2010, at 1:53 PM, Yann Dirson wrote:\n\n> Eric Raible suggested:\n>> How about:\n>> \n>> #  e [<commit>], edit [<commit>] = use commit (if present) but pause to amend\n> \n> Other commands do not mention commit (or other things) as a synopsis would.\n> What about:\n> \n> #  e, edit = use commit (if specified) but pause to amend/examine/test\n\nI like this. My only remaining concern is the original \"shell\" version let you\nput in a comment (though this was not yet documented) that would be printed when\nyou were sent back to the shell. This was a useful reminder as to what step you\nwere on. But when we overload \"edit\", this functionality is lost. I won't fight\nfor it if nobody else here thinks it's worthwhile, but I did want to point that\nout.\n\n-Kevin Ballard"},{"id":"155227","messageId":"1288908086-91520-1-git-send-email-kevin@sb.org","threadId":"25638","inReplyTo":"4CD32034.4030104@nextest.com","subject":"[PATCHv2] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-04T22:01:26Z","receivedAt":"2010-11-04T22:01:26Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Extend the \"edit\" command to simply stop for editing if no sha1 is\ngiven. This behaves the same as \"x false\" but is a bit friendlier\nfor the user.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n git-rebase--interactive.sh |   19 ++++++++++++++-----\n 1 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 9121bb6..a8e00a2 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -477,10 +477,19 @@ do_next () {\n \t\tcomment_for_reflog edit\n \n \t\tmark_action_done\n-\t\tpick_one $sha1 ||\n-\t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n-\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n-\t\tmake_patch $sha1\n+\t\tif test -n \"$sha1\"; then\n+\t\t\tpick_one $sha1 ||\n+\t\t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n+\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\t\tmake_patch $sha1\n+\t\telse\n+\t\t\t# we just want to exit to the shell\n+\t\t\t# we don't have a $sha1 or $rest, so recreate that\n+\t\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n+\t\t\tsha1=\"${line%% *}\"\n+\t\t\trest=\"${line#* }\"\n+\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\tfi\n \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n \t\twarn \"Stopped at $sha1... $rest\"\n \t\twarn \"You can amend the commit now, with\"\n@@ -1003,7 +1012,7 @@ first and then run 'git rebase --continue' again.\"\n # Commands:\n #  p, pick = use commit\n #  r, reword = use commit, but edit the commit message\n-#  e, edit = use commit, but stop for amending\n+#  e, edit = use commit (if specified), but pause to amend/examine/test\n #  s, squash = use commit, but meld into previous commit\n #  f, fixup = like \"squash\", but discard this commit's log message\n #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails\n-- \n1.7.3.2.203.gd142e\n"},{"id":"155246","messageId":"4CD3B35B.3010404@viscovery.net","threadId":"25638","inReplyTo":"20101104205307.GA8911@home.lan","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-11-05T07:33:47Z","receivedAt":"2010-11-05T07:33:47Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 11/4/2010 21:53, schrieb Yann Dirson:\n> #  e, edit = use commit (if specified) but pause to amend/examine/test\n\nThat's fine. But how would you determine the \"if specified\"? In\nparticular, I like to replace the commit subject by instructions that\nremember me what I intended to do after rebase stopped, and I would like\nto do that in either of these two forms:\n\ne merge foo-topic!\n\nor\n\ne - merge foo-topic!\n\n-- Hannes\n"},{"id":"155251","messageId":"9290474C-CD01-4C28-8B3B-3A577D569FC7@sb.org","threadId":"25638","inReplyTo":"4CD3B35B.3010404@viscovery.net","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-05T08:39:37Z","receivedAt":"2010-11-05T08:39:37Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 5, 2010, at 12:33 AM, Johannes Sixt wrote:\n\n> Am 11/4/2010 21:53, schrieb Yann Dirson:\n>> #  e, edit = use commit (if specified) but pause to amend/examine/test\n> \n> That's fine. But how would you determine the \"if specified\"? In\n> particular, I like to replace the commit subject by instructions that\n> remember me what I intended to do after rebase stopped, and I would like\n> to do that in either of these two forms:\n> \n> e merge foo-topic!\n> \n> or\n> \n> e - merge foo-topic!\n\nThis was my complaint about overriding \"edit\" as well, but I kind of like\nyour second example. Can you come up with a simple way to explain it in\nthe instructions?\n\n-Kevin Ballard\n"},{"id":"155409","messageId":"7vd3qfr7ki.fsf@alter.siamese.dyndns.org","threadId":"25638","inReplyTo":"20101104205307.GA8911@home.lan","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-08T18:31:09Z","receivedAt":"2010-11-08T18:31:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Dirson <ydirson@free.fr> writes:\n\n> #  e, edit = use commit (if specified) but pause to amend/examine/test\n\nWhen an end user is given\n\n    pick one\n    pick two\n    pick three\n    ...\n\nand told the above, would it be crystal clear that, if he changed the insn\nsheet to\n\n    pick one\n    edit\n    pick three\n    ...\n\nthen he will _lose_ the change made by foo, or will the user come back\nhere and complain that a precious change \"two\" is lost and it is git's\nfault?\n"},{"id":"155437","messageId":"663A3F43-5F64-41F0-B272-64EEE9775250@sb.org","threadId":"25638","inReplyTo":"7vd3qfr7ki.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-08T21:49:44Z","receivedAt":"2010-11-08T21:49:44Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 8, 2010, at 10:31 AM, Junio C Hamano wrote:\n\n> Yann Dirson <ydirson@free.fr> writes:\n> \n>> #  e, edit = use commit (if specified) but pause to amend/examine/test\n> \n> When an end user is given\n> \n>    pick one\n>    pick two\n>    pick three\n>    ...\n> \n> and told the above, would it be crystal clear that, if he changed the insn\n> sheet to\n> \n>    pick one\n>    edit\n>    pick three\n>    ...\n> \n> then he will _lose_ the change made by foo, or will the user come back\n> here and complain that a precious change \"two\" is lost and it is git's\n> fault?\n\nOn the one hand, once someone understands what the todo list is actually\ndoing, then it should be instantly obvious that removing the reference to\na commit will remove that commit entirely. On the other hand, I agree it\nmay be confusing to new git users (or new rebase users). Do you have an\nalternative solution in mind?\n\n-Kevin Ballard\n"},{"id":"155441","messageId":"20101108222937.GH3167@home.lan","threadId":"25638","inReplyTo":"663A3F43-5F64-41F0-B272-64EEE9775250@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Yann Dirson","fromEmail":"ydirson@free.fr","sentAt":"2010-11-08T22:29:37Z","receivedAt":"2010-11-08T22:29:37Z","isPatch":true,"sender":{"key":"ydirson@free.fr","avatar":null},"body":"On Mon, Nov 08, 2010 at 01:49:44PM -0800, Kevin Ballard wrote:\n> On Nov 8, 2010, at 10:31 AM, Junio C Hamano wrote:\n> \n> > Yann Dirson <ydirson@free.fr> writes:\n> > \n> >> #  e, edit = use commit (if specified) but pause to amend/examine/test\n> > \n> > When an end user is given\n> > \n> >    pick one\n> >    pick two\n> >    pick three\n> >    ...\n> > \n> > and told the above, would it be crystal clear that, if he changed the insn\n> > sheet to\n> > \n> >    pick one\n> >    edit\n> >    pick three\n> >    ...\n> > \n> > then he will _lose_ the change made by foo, or will the user come back\n> > here and complain that a precious change \"two\" is lost and it is git's\n> > fault?\n> \n> On the one hand, once someone understands what the todo list is actually\n> doing, then it should be instantly obvious that removing the reference to\n> a commit will remove that commit entirely. On the other hand, I agree it\n> may be confusing to new git users (or new rebase users). Do you have an\n> alternative solution in mind?\n\nMaybe restating in an explanatory paragraph something like:\n\n|Keep in mind that any commit in the original todo list, that would\n|not be there after your edits, would not be included in the resulting\n|rebased branch.  In case you realize afterwards that you need such a\n|commit, you can still access it as an ancestor of @{1}, see\n|git-reflog(1) for details.\n\nMaybe we could list a copy of the todo list in the comments, as a\nreference for double-checking.  Such a list could even be used for a\nfinal check before applying, that would ask confirmation if the set of\npatches has changed, and offer to edit again.  The same config item\n(eg. advice.interactiveRebase ?) could be used to hide the note and\nthe check.\n\nNow making \"rebase -i\" possibly interactive may cause problems, for\nany porcelain scripts above it.  Not sure it'd be the way to do it.\nMaybe add a \"check\" command to be inserted at bottom of todo list to\nactivate it, that would be here by default but commented out ?\n"},{"id":"155558","messageId":"20101110014215.GA1503@burratino","threadId":"25638","inReplyTo":"20101108222937.GH3167@home.lan","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-10T01:42:15Z","receivedAt":"2010-11-10T01:42:15Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Yann Dirson wrote:\n\n> |Keep in mind that any commit in the original todo list, that would\n> |not be there after your edits, would not be included in the resulting\n> |rebased branch.  In case you realize afterwards that you need such a\n> |commit, you can still access it as an ancestor of @{1}, see\n> |git-reflog(1) for details.\n\nDo you mean @{-1}?\n\n> Maybe we could list a copy of the todo list in the comments, as a\n> reference for double-checking.  Such a list could even be used for a\n> final check before applying, that would ask confirmation if the set of\n> patches has changed, and offer to edit again.  The same config item\n> (eg. advice.interactiveRebase ?) could be used to hide the note and\n> the check.\n\nMm, but intentionally dropping commits is common, no?\n\nWhat would be nice is to be able to do\n\n\tgit rebase --change-of-plans\n\nand somehow get my editor of choice to open with the original todo\nlist (read-only) and the current todo list (read/write).\n\nWell, a person can dream. :)\n"},{"id":"155560","messageId":"833D47AD-041C-47BF-9AF3-69FD97F42712@sb.org","threadId":"25638","inReplyTo":"20101110014215.GA1503@burratino","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-10T01:46:44Z","receivedAt":"2010-11-10T01:46:44Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 9, 2010, at 5:42 PM, Jonathan Nieder wrote:\n\n> Yann Dirson wrote:\n> \n>> |Keep in mind that any commit in the original todo list, that would\n>> |not be there after your edits, would not be included in the resulting\n>> |rebased branch.  In case you realize afterwards that you need such a\n>> |commit, you can still access it as an ancestor of @{1}, see\n>> |git-reflog(1) for details.\n> \n> Do you mean @{-1}?\n\n@{-1} is the previously-checked-out branch. @{1} is the previous commit\nthat the current branch was pointing to. I believe @{1} is correct here.\n\n>> Maybe we could list a copy of the todo list in the comments, as a\n>> reference for double-checking.  Such a list could even be used for a\n>> final check before applying, that would ask confirmation if the set of\n>> patches has changed, and offer to edit again.  The same config item\n>> (eg. advice.interactiveRebase ?) could be used to hide the note and\n>> the check.\n> \n> Mm, but intentionally dropping commits is common, no?\n> \n> What would be nice is to be able to do\n> \n> \tgit rebase --change-of-plans\n> \n> and somehow get my editor of choice to open with the original todo\n> list (read-only) and the current todo list (read/write).\n> \n> Well, a person can dream. :)\n\nNot a bad idea. It would be especially nice if you could then selectively\nroll back to the state after previous entries in your todo list so you\ncould change something you've done without having to start all over again.\n\n-Kevin Ballard\n"},{"id":"155561","messageId":"20101110015327.GB1503@burratino","threadId":"25638","inReplyTo":"7vd3qfr7ki.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-10T01:53:27Z","receivedAt":"2010-11-10T01:53:27Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Yann Dirson <ydirson@free.fr> writes:\n\n>> #  e, edit = use commit (if specified) but pause to amend/examine/test\n[...]\n>                     would it be crystal clear that, if he changed the insn\n> sheet to\n> \n>     pick one\n>     edit\n>     pick three\n>     ...\n> \n> then he will _lose_ the change made by foo, or will the user come back\n> here and complain that a precious change \"two\" is lost and it is git's\n> fault?\n\nIf we explain it clearly then I think yes, the end user would not\nbe confused.\n\nThe above description (that starts with \"e, edit\") looks more like a\nreminder than a full explanation.  Can we rely on the perplexed\noperator to read the text after the command list?\n\nIf so, some trailing explanation[1] might help.\n\n# Commands:\n#  p, pick = use commit\n#  r, reword = use commit, but edit the commit message\n#  e, edit = use commit (if specified), but stop to amend/examine/test\n#  s, squash = use commit, but meld into previous commit\n#  f, fixup = like \"squash\", but discard this commit's log message\n#  x, exec = run command using shell, and stop if it fails\n#\n# The argument to edit is optional; if left out or equal to \"-\",\n# it means to stop to examine or amend the previous commit.\n#\n# If you remove a line here, THAT COMMIT WILL BE LOST.\n# However, if you remove everything, the rebase will be aborted.\n# Use the noop command if you really want to remove all commits.\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/160691/focus=160742\n"},{"id":"155562","messageId":"20101110015623.GC1503@burratino","threadId":"25638","inReplyTo":"833D47AD-041C-47BF-9AF3-69FD97F42712@sb.org","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-11-10T01:56:23Z","receivedAt":"2010-11-10T01:56:23Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Kevin Ballard wrote:\n> On Nov 9, 2010, at 5:42 PM, Jonathan Nieder wrote:\n>> Yann Dirson wrote:\n\n>>> |Keep in mind that any commit in the original todo list, that would\n>>> |not be there after your edits, would not be included in the resulting\n>>> |rebased branch.  In case you realize afterwards that you need such a\n>>> |commit, you can still access it as an ancestor of @{1}, see\n>>> |git-reflog(1) for details.\n>> \n>> Do you mean @{-1}?\n>\n> @{-1} is the previously-checked-out branch. @{1} is the previous commit\n> that the current branch was pointing to. I believe @{1} is correct here.\n\nAh, this is after a successful rebase, so @{1} is a synonym for ORIG_HEAD.\nSorry for the noise.\n"},{"id":"155563","messageId":"6F2D0BEA-187E-4683-826C-D8582AC16D8F@sb.org","threadId":"25638","inReplyTo":"20101110015327.GB1503@burratino","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-10T02:14:32Z","receivedAt":"2010-11-10T02:14:32Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Nov 9, 2010, at 5:53 PM, Jonathan Nieder wrote:\n\n> Junio C Hamano wrote:\n>> Yann Dirson <ydirson@free.fr> writes:\n> \n>>> #  e, edit = use commit (if specified) but pause to amend/examine/test\n> [...]\n>>                    would it be crystal clear that, if he changed the insn\n>> sheet to\n>> \n>>    pick one\n>>    edit\n>>    pick three\n>>    ...\n>> \n>> then he will _lose_ the change made by foo, or will the user come back\n>> here and complain that a precious change \"two\" is lost and it is git's\n>> fault?\n> \n> If we explain it clearly then I think yes, the end user would not\n> be confused.\n> \n> The above description (that starts with \"e, edit\") looks more like a\n> reminder than a full explanation.  Can we rely on the perplexed\n> operator to read the text after the command list?\n> \n> If so, some trailing explanation[1] might help.\n> \n> # Commands:\n> #  p, pick = use commit\n> #  r, reword = use commit, but edit the commit message\n> #  e, edit = use commit (if specified), but stop to amend/examine/test\n> #  s, squash = use commit, but meld into previous commit\n> #  f, fixup = like \"squash\", but discard this commit's log message\n> #  x, exec = run command using shell, and stop if it fails\n> #\n> # The argument to edit is optional; if left out or equal to \"-\",\n> # it means to stop to examine or amend the previous commit.\n> #\n> # If you remove a line here, THAT COMMIT WILL BE LOST.\n> # However, if you remove everything, the rebase will be aborted.\n> # Use the noop command if you really want to remove all commits.\n\nI like it. Especially because if we support \"-\" in place of a sha1, then\nwe can treat the rest of the line like a comment and display it when\nstopped, as the old \"shell\" version did.\n\n-Kevin Ballard\n"},{"id":"155576","messageId":"20101110084343.0c519764@chalon.bertin.fr","threadId":"25638","inReplyTo":"20101110014215.GA1503@burratino","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Yann Dirson","fromEmail":"dirson@bertin.fr","sentAt":"2010-11-10T07:43:43Z","receivedAt":"2010-11-10T07:43:43Z","isPatch":true,"sender":{"key":"dirson@bertin.fr","avatar":null},"body":"On Tue, 09 Nov 2010 19:42:15 -0600\nJonathan Nieder <jrnieder@gmail.com> wrote:\n\n> Yann Dirson wrote:\n> \n> > |Keep in mind that any commit in the original todo list, that would\n> > |not be there after your edits, would not be included in the\n> > resulting |rebased branch.  In case you realize afterwards that you\n> > need such a |commit, you can still access it as an ancestor of\n> > @{1}, see |git-reflog(1) for details.\n> \n> Do you mean @{-1}?\n> \n> > Maybe we could list a copy of the todo list in the comments, as a\n> > reference for double-checking.  Such a list could even be used for a\n> > final check before applying, that would ask confirmation if the set\n> > of patches has changed, and offer to edit again.  The same config\n> > item (eg. advice.interactiveRebase ?) could be used to hide the\n> > note and the check.\n> \n> Mm, but intentionally dropping commits is common, no?\n\nYes, but for people new to the feature, who may not feel at ease right\naway with it, it may make sense to get warned when some change will get\nlost.\n\nBTW, about people feeling at ease with \"rebase -i\", I often feel not\nquite comfortable to explain why to reorder commits you have to use\nthis \"rebase\" feature which sounds so strange in itself to people used\nto centralized VCS.  Would that make sense to have a standard command\nto reduce some confusion, like (untested):\n\nalias.reroll = rebase -i $(git merge-base HEAD @{upstream})\n\n> What would be nice is to be able to do\n> \n> \tgit rebase --change-of-plans\n> \n> and somehow get my editor of choice to open with the original todo\n> list (read-only) and the current todo list (read/write).\n> \n> Well, a person can dream. :)\n\nWell, that's not far from my own dreams of --back, --next and the\nlike :)\n\n-- \nYann Dirson - Bertin Technologies\n"},{"id":"155595","messageId":"vpqtyjpw4m9.fsf@bauges.imag.fr","threadId":"25638","inReplyTo":"20101110084343.0c519764@chalon.bertin.fr","subject":"Re: [PATCH] git-rebase--interactive.sh: Add new command \"shell\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-11-10T16:00:30Z","receivedAt":"2010-11-10T16:00:30Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Yann Dirson <dirson@bertin.fr> writes:\n\n> BTW, about people feeling at ease with \"rebase -i\", I often feel not\n> quite comfortable to explain why to reorder commits you have to use\n> this \"rebase\" feature\n\nI feel a bit the same. Actually, I don't think I ever used \"rebase -i\"\nto actually perform a rebase. I usually \"git pull --rebase\" to rebase,\nand \"rebase -i\" to rewrite history without changing the origin of the\nbranch.\n\n> alias.reroll = rebase -i $(git merge-base HEAD @{upstream})\n\nMercurial calls this \"histedit\" for example.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"156497","messageId":"1290629960-60917-1-git-send-email-kevin@sb.org","threadId":"25638","inReplyTo":"20101110015327.GB1503@burratino","subject":"[PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-11-24T20:19:20Z","receivedAt":"2010-11-24T20:19:20Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Extend the \"edit\" command to simply stop for editing if no sha1 is\ngiven or if the sha1 is equal to \"-\". This behaves the same as \"x false\"\nbut is a bit friendlier for the user.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n\nTwo changes since the last patch:\n* Picked up the extended explanation suggested by Jonathan Nieder.\n  I left off the last line about \"noop\" as that doesn't seem related.\n* If the line given is \"edit - some comments\", emit \"some comments\" when\n  stopped. This is undocumented, so if anyone has any suggestions for how\n  it should be documented I'm all ears. I'm also not sure if it should use\n  the output format I selected now, or if it should just emit the comment\n  in place of the commit summary (e.g. Stopped at $sha1... $comment).\n\n git-rebase--interactive.sh |   30 +++++++++++++++++++++++++-----\n 1 files changed, 25 insertions(+), 5 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 5934b97..176f735 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -469,12 +469,29 @@ do_next () {\n \t\tcomment_for_reflog edit\n \n \t\tmark_action_done\n-\t\tpick_one $sha1 ||\n-\t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n-\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n-\t\tmake_patch $sha1\n+\t\tcomment=''\n+\t\tif test -n \"$sha1\" -a \"$sha1\" != \"-\"; then\n+\t\t\tpick_one $sha1 ||\n+\t\t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n+\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\t\tmake_patch $sha1\n+\t\telse\n+\t\t\t# we just want to exit to the shell\n+\t\t\t# we don't have a valid $sha1 or $rest, so recreate that\n+\t\t\t# save the original $rest to a comment for later\n+\t\t\tcomment=\"$rest\"\n+\t\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n+\t\t\tsha1=\"${line%% *}\"\n+\t\t\trest=\"${line#* }\"\n+\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n+\t\tfi\n \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n \t\twarn \"Stopped at $sha1... $rest\"\n+\t\tif test -n \"$comment\"; then\n+\t\t\twarn\n+\t\t\twarn \"\t$comment\"\n+\t\t\twarn\n+\t\tfi\n \t\twarn \"You can amend the commit now, with\"\n \t\twarn\n \t\twarn \"\tgit commit --amend\"\n@@ -1016,11 +1033,14 @@ first and then run 'git rebase --continue' again.\"\n # Commands:\n #  p, pick = use commit\n #  r, reword = use commit, but edit the commit message\n-#  e, edit = use commit, but stop for amending\n+#  e, edit = use commit (if specified), but stop to amend/examine/test\n #  s, squash = use commit, but meld into previous commit\n #  f, fixup = like \"squash\", but discard this commit's log message\n #  x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails\n #\n+# The argument to edit is optional; if left out or equal to \"-\",\n+# it means to stop to examine or amend the previous commit.\n+#\n # If you remove a line here THAT COMMIT WILL BE LOST.\n # However, if you remove everything, the rebase will be aborted.\n #\n-- \n1.7.3.2.488.gc5e8\n"},{"id":"157177","messageId":"20101203080603.GC18202@burratino","threadId":"25638","inReplyTo":"1290629960-60917-1-git-send-email-kevin@sb.org","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-03T08:06:03Z","receivedAt":"2010-12-03T08:06:03Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nKevin Ballard wrote:\n\n> [Subject: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful\n\nMaybe something like\n\n\trebase-i: treat \"edit\" without sha1 as a request to amend previous commit\n\nwould make the meaning more obvious in a shortlog.\n\n> Extend the \"edit\" command to simply stop for editing if no sha1 is\n> given or if the sha1 is equal to \"-\". This behaves the same as \"x false\"\n> but is a bit friendlier for the user.\n\nNice.  I like the semantics.\n\n> * Picked up the extended explanation suggested by Jonathan Nieder.\n>   I left off the last line about \"noop\" as that doesn't seem related.\n\nRight, please feel free to remind me if I forget to pick that up again.\n\n> * If the line given is \"edit - some comments\", emit \"some comments\" when\n>   stopped. This is undocumented\n\nI think that's okay for now (though of course it would be best to explain\nsome example uses in Documentation/git-rebase.txt in the form of examples).\n\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -469,12 +469,29 @@ do_next () {\n> +\t\t\tcomment=\"$rest\"\n> +\t\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n\nHmm, the script seems to assume rev-list will not fail throughout.  :/\nOk.\n\n> +\t\t\tsha1=\"${line%% *}\"\n> +\t\t\trest=\"${line#* }\"\n> +\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n\nMaybe this can be done without relying on details of --pretty=oneline\nformat?\n\n\t\t\tsha1=$(git rev-parse --short HEAD)\n\t\t\trest=$(git show -s --format=%s HEAD)\n\n(Yes, elsewhere the script uses\n\n\tgit rev-list --no-merges --pretty=oneline --abbrev-commit \\\n\t\t--abbrev=7 --reverse --left-right --topo-order \"$@\" |\n\tsed -n \"s/^>//p\" |\n\twhile read -r shortsha1 rest\n\nbut in that loop, avoiding an extra exec seems more important.)\n\n> +\t\tfi\n>  \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n>  \t\twarn \"Stopped at $sha1... $rest\"\n> +\t\tif test -n \"$comment\"; then\n> +\t\t\twarn\n> +\t\t\twarn \"\t$comment\"\n> +\t\t\twarn\n\nThanks, looks good to me.\n\nIdeas for tests?  (see t3404 for inspiration)\n"},{"id":"157178","messageId":"048EACFB-2038-4D49-B6C3-7E7354F62171@sb.org","threadId":"25638","inReplyTo":"20101203080603.GC18202@burratino","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-12-03T08:16:21Z","receivedAt":"2010-12-03T08:16:21Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Dec 3, 2010, at 12:06 AM, Jonathan Nieder wrote:\n\n> Hi,\n> \n> Kevin Ballard wrote:\n> \n>> [Subject: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful\n> \n> Maybe something like\n> \n> \trebase-i: treat \"edit\" without sha1 as a request to amend previous commit\n> \n> would make the meaning more obvious in a shortlog.\n\nThat seems a bit misleading, though. This command really has nothing to do with\namending the previous commit. You can do anything you want once you break back to\nthe shell. I personally used it to run git-merge at that point in the history.\nFor this reason I'm a bit uneasy about overloading \"edit\", but it does have the\nbenefit that people already know \"edit\" brings them to the shell.\n\n>> Extend the \"edit\" command to simply stop for editing if no sha1 is\n>> given or if the sha1 is equal to \"-\". This behaves the same as \"x false\"\n>> but is a bit friendlier for the user.\n> \n> Nice.  I like the semantics.\n> \n>> * Picked up the extended explanation suggested by Jonathan Nieder.\n>>  I left off the last line about \"noop\" as that doesn't seem related.\n> \n> Right, please feel free to remind me if I forget to pick that up again.\n> \n>> * If the line given is \"edit - some comments\", emit \"some comments\" when\n>>  stopped. This is undocumented\n> \n> I think that's okay for now (though of course it would be best to explain\n> some example uses in Documentation/git-rebase.txt in the form of examples).\n\nYep, I definitely need to add documentation.\n\n>> --- a/git-rebase--interactive.sh\n>> +++ b/git-rebase--interactive.sh\n>> @@ -469,12 +469,29 @@ do_next () {\n>> +\t\t\tcomment=\"$rest\"\n>> +\t\t\tline=$(git rev-list --pretty=oneline -1 --abbrev-commit --abbrev=7 HEAD)\n> \n> Hmm, the script seems to assume rev-list will not fail throughout.  :/\n> Ok.\n> \n>> +\t\t\tsha1=\"${line%% *}\"\n>> +\t\t\trest=\"${line#* }\"\n>> +\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n> \n> Maybe this can be done without relying on details of --pretty=oneline\n> format?\n> \n> \t\t\tsha1=$(git rev-parse --short HEAD)\n> \t\t\trest=$(git show -s --format=%s HEAD)\n\nDoes this not similarly assume that rev-parse and show will not fail? Or was\nthe above comment only meant to point out this potential issue without\nsuggesting that it needed to be fixed?\n\n> (Yes, elsewhere the script uses\n> \n> \tgit rev-list --no-merges --pretty=oneline --abbrev-commit \\\n> \t\t--abbrev=7 --reverse --left-right --topo-order \"$@\" |\n> \tsed -n \"s/^>//p\" |\n> \twhile read -r shortsha1 rest\n> \n> but in that loop, avoiding an extra exec seems more important.)\n> \n>> +\t\tfi\n>> \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n>> \t\twarn \"Stopped at $sha1... $rest\"\n>> +\t\tif test -n \"$comment\"; then\n>> +\t\t\twarn\n>> +\t\t\twarn \"\t$comment\"\n>> +\t\t\twarn\n> \n> Thanks, looks good to me.\n> \n> Ideas for tests?  (see t3404 for inspiration)\n\nI'll look into that. I wasn't really sure how to test this before, but t3404\ndoes have some examples of testing the edit command already.\n\n-Kevin Ballard"},{"id":"157185","messageId":"20101203085528.GE18202@burratino","threadId":"25638","inReplyTo":"048EACFB-2038-4D49-B6C3-7E7354F62171@sb.org","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-03T08:55:28Z","receivedAt":"2010-12-03T08:55:28Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Kevin Ballard wrote:\n> On Dec 3, 2010, at 12:06 AM, Jonathan Nieder wrote:\n\n>> Maybe something like\n>> \n>> \trebase-i: treat \"edit\" without sha1 as a request to amend previous commit\n>> \n>> would make the meaning more obvious in a shortlog.\n>\n> That seems a bit misleading, though. This command really has nothing to do with\n> amending the previous commit.\n\nOkay, maybe\n\n\trebase-i: extend \"edit\" to allow stopping without a commit to amend\n\nOr something else entirely; I only meant that \"to be more useful\" is\na bit vague (it could be cut out without loss of meaning).\n\n>> Maybe this can be done without relying on details of --pretty=oneline\n>> format?\n>> \n>> \t\t\tsha1=$(git rev-parse --short HEAD)\n>> \t\t\trest=$(git show -s --format=%s HEAD)\n>\n> Does this not similarly assume that rev-parse and show will not fail? Or was\n> the above comment only meant to point out this potential issue without\n> suggesting that it needed to be fixed?\n\nYes, that's right.  The exit status from rev-list is ignored\nthroughout the script; making that more robust is a separate topic.\n\nBTW this suggestion about avoiding --pretty=oneline was nonsense ---\nthe output format from\n\n\tgit rev-list --pretty=oneline\n\nis guaranteed to stay the same because rev-list is plumbing.  Sorry\nfor the noise.\n\nGood night,\nJonathan\n"},{"id":"157192","messageId":"4CF8BE8E.4090100@viscovery.net","threadId":"25638","inReplyTo":"20101203080603.GC18202@burratino","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-12-03T09:55:26Z","receivedAt":"2010-12-03T09:55:26Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 12/3/2010 9:06, schrieb Jonathan Nieder:\n> Kevin Ballard wrote:\n>> +\t\t\tsha1=\"${line%% *}\"\n>> +\t\t\trest=\"${line#* }\"\n>> +\t\t\techo \"$sha1\" > \"$DOTEST\"/stopped-sha\n> \n> Maybe this can be done without relying on details of --pretty=oneline\n> format?\n\nNo. This is a matter of the syntax of the recipe file. If the details of\n--pretty=oneline ever changed, then the way how the boilerplate recipe\nfile is generated would have to be changed accordingly.\n\n> \n> \t\t\tsha1=$(git rev-parse --short HEAD)\n> \t\t\trest=$(git show -s --format=%s HEAD)\n\nShouldn't $sha1 be the one given in the recipe rather than current HEAD?\n\nBut most importantly, since $rest is echoed on the terminal, it MUST be\nderived from the recipe ($line). Rationale: I replace the commit subject\nin the recipe by a reminder what I intend to do when the \"edit\" command\nstops---I don't care so much what the commit subject is.\n\n-- Hannes\n"},{"id":"157193","messageId":"20101203100059.GA12043@burratino","threadId":"25638","inReplyTo":"4CF8BE8E.4090100@viscovery.net","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-03T10:00:59Z","receivedAt":"2010-12-03T10:00:59Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Sixt wrote:\n> Am 12/3/2010 9:06, schrieb Jonathan Nieder:\n\n>> Maybe this can be done without relying on details of --pretty=oneline\n>> format?\n>\n> No. This is a matter of the syntax of the recipe file.\n\nMy suggestion was nonsense for other reasons, too.\n\n>> \n>> \t\t\tsha1=$(git rev-parse --short HEAD)\n>> \t\t\trest=$(git show -s --format=%s HEAD)\n>\n> Shouldn't $sha1 be the one given in the recipe rather than current HEAD?\n\nThis code branch is about mentally rewriting\n\n\tpick 87a78c\n\tfixup 987ca\n\tedit - time to test\n\nto\n\n\tpick 87a78c\n\tfixup 987ca\n\tedit <whatever is HEAD at that moment>\n\nand printing \"time to test\" as a reminder to the user.\n\n> But most importantly, since $rest is echoed on the terminal, it MUST be\n> derived from the recipe ($line). Rationale: I replace the commit subject\n> in the recipe by a reminder what I intend to do when the \"edit\" command\n> stops---I don't care so much what the commit subject is.\n\nKevin, this sounds like a vote for the \"replace commit message\" output\nformat.\n\nThanks, that was useful.\nJonathan\n"},{"id":"157194","messageId":"85DF30E1-E823-41D9-BAD7-4A11BD0D03C7@sb.org","threadId":"25638","inReplyTo":"20101203100059.GA12043@burratino","subject":"Re: [PATCHv3] git-rebase--interactive.sh: extend \"edit\" command to be more useful","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2010-12-03T10:14:45Z","receivedAt":"2010-12-03T10:14:45Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On Dec 3, 2010, at 2:00 AM, Jonathan Nieder wrote:\n\n>> But most importantly, since $rest is echoed on the terminal, it MUST be\n>> derived from the recipe ($line). Rationale: I replace the commit subject\n>> in the recipe by a reminder what I intend to do when the \"edit\" command\n>> stops---I don't care so much what the commit subject is.\n> \n> Kevin, this sounds like a vote for the \"replace commit message\" output\n> format.\n\nThe v3 patch will emit both a description of the commit it stopped on, as well\nas the comment. The rationale for extracting the first line of HEAD is for when\nthe user doesn't provide any comment - e.g. they just add \"edit\". It may be\nworth doing this only in that case, and if the user did provide a comment,\nemit it in place of the first line of HEAD.\n\nGiven the recipe\n\n\tpick bc17bb7 git-rebase--interactive.sh: extend \"edit\" command to be more useful\n\tedit - foo\n\nthe edit command would print\n\n\tStopped at bc17bb7... git-rebase--interactive.sh: extend \"edit\" command to be more useful\n\t\n\t\tfoo\n\t\n\tYou can amend the commit now...\n\nThe alternative is to make that same recipe emit\n\n\tStopped at bc17bb7... foo\n\t\n\tYou can amend the commit now...\n\nI'm leaning towards making that change right now, but I'm not certain.\nDo either of you have a preference?\n\n-Kevin Ballard"}]}