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

[PATCH] provide more errors for the "merge into empty head" case

From
Paolo Bonzini <bonzini@gnu.org>
Date
Aug 21, 2008, 12:14 UTC
Message-ID
<E1KW9N5-0003mA-CB@fencepost.gnu.org>

--squash merges are not supported yet. They could be implemented by building the index from the merged-from branch, and doing a single commit.

Non-fast-forward merges instead do not make sense, because you cannot make a merge commit if you don't have a base in the beginning.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
---
 builtin-merge.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/builtin-merge.c b/builtin-merge.c
index b4c7eda..a3b9b10 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -869,6 +869,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		if (argc != 1)
 			die("Can merge only exactly one commit into "
 				"empty head");
+		if (squash)
+			die("Squash commit into empty head not supported yet");
+		if (!allow_fast_forward)
+			die("Non-fast-forward commit does not make sense into "
+			    "an empty head");
 		remote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);
 		if (!remote_head)
 			die("%s - not something we can merge", argv[0]);
-- 
1.5.5
Message 1 of 1 in “provide more errors for the "merge into empty head" case”
  1. provide more errors for the "merge into empty head" casePaolo Bonzini, Aug 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.