{"thread":{"id":"13703","subject":"[PATCH] Completion: Hint whether amend is the right thing to do.","startedAt":"2008-05-28T14:08:01Z","lastAt":"2008-05-28T23:45:54Z","messageCount":6,"participants":["Robin Rosenberg","Junio C Hamano","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77933","messageId":"200805281608.02000.robin.rosenberg.lists@dewire.com","threadId":"13703","inReplyTo":null,"subject":"[PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-05-28T14:08:01Z","receivedAt":"2008-05-28T14:08:01Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"When you get a conflict during interactive rebase the next\nthing to do is not to amend, but to continue the rebase.\nWith this change you get a reminder in the prompt.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n contrib/completion/git-completion.bash |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\nI got a couple of broken rebases. Hence this fix.\n\n-- robin\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1698463..a606328 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -82,7 +82,12 @@ __git_ps1 ()\n \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n \t\telif [ -f \"$g/.dotest-merge/interactive\" ]\n \t\tthen\n-\t\t\tr=\"|REBASE-i\"\n+\t\t\tif [ -f \"$g/.dotest-merge/amend\" ]\n+\t\t\tthen\n+\t\t\t\tr=\"|REBASE-i-amend\"\n+\t\t\telse\n+\t\t\t\tr=\"|REBASE-i-continue\"\n+\t\t\tfi\n \t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n \t\telif [ -d \"$g/.dotest-merge\" ]\n \t\tthen\n-- \n1.5.5.1.178.g1f811\n"},{"id":"77945","messageId":"7v63sywhkr.fsf@gitster.siamese.dyndns.org","threadId":"13703","inReplyTo":"200805281608.02000.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-28T15:53:40Z","receivedAt":"2008-05-28T15:53:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> When you get a conflict during interactive rebase the next\n> thing to do is not to amend, but to continue the rebase.\n> With this change you get a reminder in the prompt.\n>\n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n>  contrib/completion/git-completion.bash |    7 ++++++-\n>  1 files changed, 6 insertions(+), 1 deletions(-)\n>\n> I got a couple of broken rebases. Hence this fix.\n>\n> -- robin\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 1698463..a606328 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -82,7 +82,12 @@ __git_ps1 ()\n>  \t\t\tb=\"$(git symbolic-ref HEAD 2>/dev/null)\"\n>  \t\telif [ -f \"$g/.dotest-merge/interactive\" ]\n>  \t\tthen\n> -\t\t\tr=\"|REBASE-i\"\n> +\t\t\tif [ -f \"$g/.dotest-merge/amend\" ]\n> +\t\t\tthen\n> +\t\t\t\tr=\"|REBASE-i-amend\"\n> +\t\t\telse\n> +\t\t\t\tr=\"|REBASE-i-continue\"\n> +\t\t\tfi\n>  \t\t\tb=\"$(cat \"$g/.dotest-merge/head-name\")\"\n>  \t\telif [ -d \"$g/.dotest-merge\" ]\n>  \t\tthen\n> -- \n> 1.5.5.1.178.g1f811\n\nHmm.  The \"|REBASE-blah\" prefix is already too long for my liking and this\nmakes it even longer X-<\n\nDoes this mean that it would help reduce mistakes if \"git commit --amend\"\nnoticed the presense of .dotest-merge but absense of .dotest-merge/amend\nand refused to operate, I have to wonder?\n"},{"id":"77986","messageId":"20080528231622.GL30245@spearce.org","threadId":"13703","inReplyTo":"7v63sywhkr.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-05-28T23:16:22Z","receivedAt":"2008-05-28T23:16:22Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n> \n> > When you get a conflict during interactive rebase the next\n> > thing to do is not to amend, but to continue the rebase.\n> > With this change you get a reminder in the prompt.\n...\n> Does this mean that it would help reduce mistakes if \"git commit --amend\"\n> noticed the presense of .dotest-merge but absense of .dotest-merge/amend\n> and refused to operate, I have to wonder?\n\nYea, even though rebase and commit are two different tools we\ndon't want the user to amend in the middle of a failed conflict\nfrom rebase.  Adding the safety valve to commit --amend makes\nmore sense to me than teaching bash to show you the state.  Not\nall of our users use bash.  Not all of our bash using users use\nthe bash completion package, or the _git_ps1 function we ship.\nEtc.\n\nI'd rather see the amend safety net than the bash prompt change.\n\n-- \nShawn.\n"},{"id":"77990","messageId":"200805290133.48490.robin.rosenberg.lists@dewire.com","threadId":"13703","inReplyTo":"7v63sywhkr.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-05-28T23:33:48Z","receivedAt":"2008-05-28T23:33:48Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdagen den 28 maj 2008 17.53.40 skrev Junio C Hamano:\n> Does this mean that it would help reduce mistakes if \"git commit --amend\"\n> noticed the presense of .dotest-merge but absense of .dotest-merge/amend\n> and refused to operate, I have to wonder?\n\nWell I found myself making these mistakes. That would probably be better. \nShouldn't one block commit without amend too then? And then rebase needs\nanother option to be able to commit. Fixing the prompt was easier at the time .)\n\n-- robin\n"},{"id":"77991","messageId":"7vlk1urob4.fsf@gitster.siamese.dyndns.org","threadId":"13703","inReplyTo":"200805290133.48490.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-28T23:39:27Z","receivedAt":"2008-05-28T23:39:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> onsdagen den 28 maj 2008 17.53.40 skrev Junio C Hamano:\n>> Does this mean that it would help reduce mistakes if \"git commit --amend\"\n>> noticed the presense of .dotest-merge but absense of .dotest-merge/amend\n>> and refused to operate, I have to wonder?\n>\n> Well I found myself making these mistakes. That would probably be better. \n> Shouldn't one block commit without amend too then?\n\nIf you mean to forbid \"git commit\" during rebase (perhaps interrupted by\ns/pick/edit/), I do not think that would fly -- it is the advertised way\nto split a commit into two, if I am not mistaken.\n"},{"id":"77992","messageId":"20080528234554.GO30245@spearce.org","threadId":"13703","inReplyTo":"7vlk1urob4.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Completion: Hint whether amend is the right thing to do.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-05-28T23:45:54Z","receivedAt":"2008-05-28T23:45:54Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n> \n> > onsdagen den 28 maj 2008 17.53.40 skrev Junio C Hamano:\n> >> Does this mean that it would help reduce mistakes if \"git commit --amend\"\n> >> noticed the presense of .dotest-merge but absense of .dotest-merge/amend\n> >> and refused to operate, I have to wonder?\n> >\n> > Well I found myself making these mistakes. That would probably be better. \n> > Shouldn't one block commit without amend too then?\n> \n> If you mean to forbid \"git commit\" during rebase (perhaps interrupted by\n> s/pick/edit/), I do not think that would fly -- it is the advertised way\n> to split a commit into two, if I am not mistaken.\n\nRight, you don't want to block commit if we stopped for an edit.\n\nBut if we stopped because merge-recursive failed due to merge\nconflicts we want the user to fix up the tree, stage the changes,\nand call `git rebase --continue` to let rebase continue further.\n\nIf further means finish the commit and then immediately stop (as\nwe had failed while picking an edit) , rebase will stop and let\nthe user edit.\n\nWe don't need a special flag for rebase to pass to commit, it can\njust delete the state flag that prevents commits just before it\ncalls commit.\n\n-- \nShawn.\n"}]}