git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 19, 2008, 02:57 UTC
Message-ID
<alpine.DEB.1.00.0812190353520.14632@racer>
In-Reply-To
<200812182039.15169.bss@iguanasuicide.net>
Hi,
On Thu, 18 Dec 2008, Boyd Stephen Smith Jr. wrote:
Show 15 quoted lines
> +		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

Previous: Boyd Stephen Smith Jr.Next: Junio C Hamano
Message 2 of 24 in “Make git revert warn the user when reverting a merge commit.”
  1. Make git revert warn the user when reverting a merge commit.Boyd Stephen Smith Jr., Dec 19, 2008
  2. Johannes SchindelinDec 19, 2008
  3. Junio C HamanoDec 19, 2008
  4. Boyd Stephen Smith Jr.Dec 19, 2008
  5. Jay SoffianDec 19, 2008
  6. Boyd Stephen Smith Jr.Dec 19, 2008
  7. Junio C HamanoDec 19, 2008
  8. AlanDec 19, 2008
  9. Boyd Stephen Smith Jr.Dec 19, 2008
  10. Robin RosenbergDec 20, 2008
  11. Boyd Stephen Smith Jr.Dec 20, 2008
  12. Robin RosenbergDec 20, 2008
  13. Junio C HamanoDec 21, 2008
  14. Boyd Stephen Smith Jr.Dec 21, 2008
  15. Robin RosenbergDec 21, 2008
  16. Junio C HamanoDec 21, 2008
  17. Boyd Stephen Smith Jr.Dec 21, 2008
  18. Junio C HamanoDec 21, 2008
  19. Boyd Stephen Smith Jr.Dec 21, 2008
  20. Junio C HamanoDec 21, 2008
  21. Junio C HamanoDec 21, 2008
  22. Robin RosenbergDec 21, 2008
  23. Junio C HamanoDec 21, 2008
  24. Robin RosenbergDec 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.