{"thread":{"id":"43534","subject":"Re: [RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","startedAt":"2006-12-05T03:44:40Z","lastAt":"2006-12-05T09:03:51Z","messageCount":5,"participants":["Johannes Schindelin","Junio C Hamano","Andreas Ericsson","Luben Tuikov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"295482","messageId":"7v4psbknvb.fsf@assigned-by-dhcp.cox.net","threadId":"43534","inReplyTo":null,"subject":"[RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-05T03:44:40Z","receivedAt":"2006-12-05T03:44:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"An earlier commit a9cb3c6e changed git-commit to use the\ncontents of MERGE_MSG even when we do not have MERGE_HEAD (the\nrationale is in its log message).\n\nHowever, the change tricks the following sequence to include a\nmerge message in a completely unrelated commit:\n\n\t$ git pull somewhere\n\t: oops, the conflicts are too much.  forget it.\n        $ git reset --hard\n        : work work work\n        $ git commit\n\nTo fix this confusion, this patch makes \"git reset\" to remove\nthe leftover MERGE_MSG that was prepared when the user abandoned\nthe merge.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * Marked as RFC because I suspect I am missing a valid use case\n   where a user might want to say \"reset\" as part of continuing\n   the conflicted merge resolution, although I do not think of\n   any offhand...\n\n git-reset.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-reset.sh b/git-reset.sh\nindex 3133b5b..c0feb44 100755\n--- a/git-reset.sh\n+++ b/git-reset.sh\n@@ -63,6 +63,7 @@ case \"$reset_type\" in\n \t;;\n esac\n \n-rm -f \"$GIT_DIR/MERGE_HEAD\" \"$GIT_DIR/rr-cache/MERGE_RR\" \"$GIT_DIR/SQUASH_MSG\"\n+rm -f \"$GIT_DIR/MERGE_HEAD\" \"$GIT_DIR/rr-cache/MERGE_RR\" \\\n+\t\"$GIT_DIR/SQUASH_MSG\" \"$GIT_DIR/MERGE_MSG\"\n \n exit $update_ref_status\n\n"},{"id":"297016","messageId":"953031.74197.qm@web31806.mail.mud.yahoo.com","threadId":"43534","inReplyTo":"7v4psbknvb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-12-05T06:19:02Z","receivedAt":"2006-12-05T06:19:02Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> An earlier commit a9cb3c6e changed git-commit to use the\n> contents of MERGE_MSG even when we do not have MERGE_HEAD (the\n> rationale is in its log message).\n> \n> However, the change tricks the following sequence to include a\n> merge message in a completely unrelated commit:\n> \n> \t$ git pull somewhere\n> \t: oops, the conflicts are too much.  forget it.\n>         $ git reset --hard\n>         : work work work\n>         $ git commit\n> \n> To fix this confusion, this patch makes \"git reset\" to remove\n> the leftover MERGE_MSG that was prepared when the user abandoned\n> the merge.\n> \n> Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nAcked-by: Luben Tuikov <ltuikov@yahoo.com\n\n> \n> ---\n> \n>  * Marked as RFC because I suspect I am missing a valid use case\n>    where a user might want to say \"reset\" as part of continuing\n>    the conflicted merge resolution, although I do not think of\n>    any offhand...\n\nI also cannot think of any offhand.  Should be safe to commit.\n\n     Luben\n\n\n> \n>  git-reset.sh |    3 ++-\n>  1 files changed, 2 insertions(+), 1 deletions(-)\n> \n> diff --git a/git-reset.sh b/git-reset.sh\n> index 3133b5b..c0feb44 100755\n> --- a/git-reset.sh\n> +++ b/git-reset.sh\n> @@ -63,6 +63,7 @@ case \"$reset_type\" in\n>  \t;;\n>  esac\n>  \n> -rm -f \"$GIT_DIR/MERGE_HEAD\" \"$GIT_DIR/rr-cache/MERGE_RR\" \"$GIT_DIR/SQUASH_MSG\"\n> +rm -f \"$GIT_DIR/MERGE_HEAD\" \"$GIT_DIR/rr-cache/MERGE_RR\" \\\n> +\t\"$GIT_DIR/SQUASH_MSG\" \"$GIT_DIR/MERGE_MSG\"\n>  \n>  exit $update_ref_status\n> \n> \n> \n"},{"id":"295337","messageId":"Pine.LNX.4.63.0612050847340.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43534","inReplyTo":"7v4psbknvb.fsf@assigned-by-dhcp.cox.net","subject":"Re: [RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-05T08:22:16Z","receivedAt":"2006-12-05T08:22:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 4 Dec 2006, Junio C Hamano wrote:\n\n>  * Marked as RFC because I suspect I am missing a valid use case\n>    where a user might want to say \"reset\" as part of continuing\n>    the conflicted merge resolution, although I do not think of\n>    any offhand...\n\nI can only speak for myself, of course: When I use git-reset in a merge, \nmore often than not I use \"--hard\", in which case I want to try something \ndifferent. So yes, I like this patch.\n\nThe only possible exception I can think of: git-reset --mixed when a \nmerge failed.\n\nCiao,\nDscho\n"},{"id":"296444","messageId":"45752F8E.9020405@op5.se","threadId":"43534","inReplyTo":"Pine.LNX.4.63.0612050847340.28348@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-12-05T08:36:30Z","receivedAt":"2006-12-05T08:36:30Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 4 Dec 2006, Junio C Hamano wrote:\n> \n>>  * Marked as RFC because I suspect I am missing a valid use case\n>>    where a user might want to say \"reset\" as part of continuing\n>>    the conflicted merge resolution, although I do not think of\n>>    any offhand...\n> \n> I can only speak for myself, of course: When I use git-reset in a merge, \n> more often than not I use \"--hard\", in which case I want to try something \n> different. So yes, I like this patch.\n> \n> The only possible exception I can think of: git-reset --mixed when a \n> merge failed.\n> \n\nIndeed, but any invocation of git-reset means you'll quite likely have \nto re-do the merge to get all changes anyways.\n\nLike most others, I also use the --hard option most of the times when I \nhave merge-errors (usually because I've forgotten to create a \ntopic-branch to do my work in, so I create one from 'master', reset \nmaster to whatever it was last time I pulled and then try rebase'ing on \nto it).\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\n"},{"id":"298252","messageId":"Pine.LNX.4.63.0612051000280.28348@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43534","inReplyTo":"45752F8E.9020405@op5.se","subject":"Re: [RFC/PATCH] git-reset to remove \"$GIT_DIR/MERGE_MSG\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-05T09:03:51Z","receivedAt":"2006-12-05T09:03:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 5 Dec 2006, Andreas Ericsson wrote:\n\n> Johannes Schindelin wrote:\n> > \n> > The only possible exception I can think of: git-reset --mixed when a merge\n> > failed.\n> \n> Indeed, but any invocation of git-reset means you'll quite likely have \n> to re-do the merge to get all changes anyways.\n\nBut the working directory still contains the changes (and conflicts) with \n--mixed. A valid workflow would then be to compare to the index directly, \ninstead of having to ask \"git diff --ours\" all the time. And if I'm not \nmistaken, a commit (after cleaning up the conflicts) would not record the \nmerge as a merge.\n\nCiao,\nDscho\n"}]}