{"thread":{"id":"15131","subject":"[PATCH] provide more errors for the \"merge into empty head\" case","startedAt":"2008-08-21T12:14:18Z","lastAt":"2008-08-21T12:14:18Z","messageCount":1,"participants":["Paolo Bonzini"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"87974","messageId":"E1KW9N5-0003mA-CB@fencepost.gnu.org","threadId":"15131","inReplyTo":null,"subject":"[PATCH] provide more errors for the \"merge into empty head\" case","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2008-08-21T12:14:18Z","receivedAt":"2008-08-21T12:14:18Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"--squash merges are not supported yet.  They could be implemented\nby building the index from the merged-from branch, and doing a\nsingle commit.\n\nNon-fast-forward merges instead do not make sense, because you\ncannot make a merge commit if you don't have a base in the\nbeginning.\n\nSigned-off-by: Paolo Bonzini <bonzini@gnu.org>\n---\n builtin-merge.c |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex b4c7eda..a3b9b10 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -869,6 +869,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\tif (argc != 1)\n \t\t\tdie(\"Can merge only exactly one commit into \"\n \t\t\t\t\"empty head\");\n+\t\tif (squash)\n+\t\t\tdie(\"Squash commit into empty head not supported yet\");\n+\t\tif (!allow_fast_forward)\n+\t\t\tdie(\"Non-fast-forward commit does not make sense into \"\n+\t\t\t    \"an empty head\");\n \t\tremote_head = peel_to_type(argv[0], 0, NULL, OBJ_COMMIT);\n \t\tif (!remote_head)\n \t\t\tdie(\"%s - not something we can merge\", argv[0]);\n-- \n1.5.5\n"}]}