Re: [PATCH] Make git revert warn the user when reverting a merge commit.

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

 



Hi,

On Thu, 18 Dec 2008, Boyd Stephen Smith Jr. wrote:

> +		do {
> +			switch (action) {
> +			case REVERT:
> +				warning("revert on a merge commit may not do what you expect.");
> +				continue;
> +			case CHERRY_PICK:
> +				/* Cherry picking a merge doesn't merge the history, but
> +				 * I don't think many people expect that.
> +				 */
> +				continue;
> +			}
> +			/* Unhandled enum member. */
> +			die("Unknown action on a merge commit.");
> +		} while (0);
> +

Wow.  That must be one of the, uhm, less beautiful ways to write

		if (action == REVERT)
			warning("revert on a merge commit may not do what you "
				"expect.");
		else if (action != CHERRY_PICK)
			die("Unknown action on a merge commit.");

Besides, I am actually pretty much against this change.  You already have 
to ask very explicitely to revert a merge, by specifying a parent number.  
If I ask for something explicitely, I do not want the tool to tell me that 
it's dangerous.  I know that already, thankyouverymuch.

Ciao,
Dscho
--
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]

  Powered by Linux