Re: Recovering from commit --amend in rebase --interactive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 1, 2010 at 09:57, Jan Krüger <jk@xxxxx> wrote:
> Peter Krefting <peter@xxxxxxxxxxxxxxxx> wrote:
>
>> Last time this happened to me, I *did* notice my mistake as I entered
>> the editor, since it came up with the previous commit's message.
>> However, as the commit message file was in a good shape, I found no
>> way to break out of the amend.
>
> It might be easy to miss, but it's there, right in the editor:
>
> # Please enter the commit message for your changes. Lines starting
> # with '#' will be ignored, and *an empty message aborts the commit*.
> (Emphasis added)
>
> In general, it might be helpful to warn very loudly upon doing a commit
> --amend after fixing conflicts, but an implementation would probably be
> ugly and for all I know, there might be people who frequently cause
> conflicts while amending; those guys would probably be quite annoyed at
> such a warning.

I've also introduced the error Peter describes into my history because
I wasn't careful. That required some splitting / reflog fixes later.

Perhaps the best way to solve this would be to change the content of
COMMIT_EDITMSG in cases like these so it gives you an explicit warning
about what you're about to do.

We already do this for merges, from builtin/commit.c:

		if (in_merge)
			fprintf(fp,
				"#\n"
				"# It looks like you may be committing a MERGE.\n"
				"# If this is not correct, please remove the file\n"
				"#	%s\n"
				"# and try again.\n"
				"#\n",
				git_path("MERGE_HEAD"));

		fprintf(fp,
			"\n"
			"# Please enter the commit message for your changes.");
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]