All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
To: git@vger.kernel.org
Cc: Martin Langhoff <martin@catalyst.net.nz>,
	Junio C Hamano <junkio@cox.net>
Subject: [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly
Date: Fri, 7 Jul 2006 12:55:41 +0200	[thread overview]
Message-ID: <20060707105541.GA17004@xp.machine.xx> (raw)

git-cvsexportcommit should check if the parent (supplied on the cmdline) to use
for a merge commit is one of the real parents of the merge.

But it errors out if the _first_ parent doesn't match and never checks
the other parents.

Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
---
This is a resend with an improved description, because my first attempt
didn't generate enough attention :-)

 git-cvsexportcommit.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index d1051d0..5dcb2f9 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -63,15 +63,15 @@ foreach my $p (@commit) {
 }
 
 if ($parent) {
+    my $found;
     # double check that it's a valid parent
     foreach my $p (@parents) {
-	my $found;
 	if ($p eq $parent) {
 	    $found = 1;
 	    last;
 	}; # found it
-	die "Did not find $parent in the parents for this commit!";
     }
+    die "Did not find $parent in the parents for this commit!" if !$found;
 } else { # we don't have a parent from the cmdline...
     if (@parents == 1) { # it's safe to get it from the commit
 	$parent = $parents[0];
-- 
1.4.0

             reply	other threads:[~2006-07-07 10:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 10:55 Peter Baumann [this message]
2006-07-09 23:12 ` [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly Martin Langhoff (CatalystIT)

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=20060707105541.GA17004@xp.machine.xx \
    --to=siprbaum@stud.informatik.uni-erlangen.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=martin@catalyst.net.nz \
    /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.