All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: <git@vger.kernel.org>
Subject: [PATCH] provide more errors for the "merge into empty head" case
Date: Thu, 21 Aug 2008 14:14:18 +0200	[thread overview]
Message-ID: <E1KW9N5-0003mA-CB@fencepost.gnu.org> (raw)

--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

                 reply	other threads:[~2008-08-21 12:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1KW9N5-0003mA-CB@fencepost.gnu.org \
    --to=bonzini@gnu.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.