git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly
@ 2006-07-07 10:55 Peter Baumann
  2006-07-09 23:12 ` Martin Langhoff (CatalystIT)
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Baumann @ 2006-07-07 10:55 UTC (permalink / raw)
  To: git; +Cc: Martin Langhoff, Junio C Hamano

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly
  2006-07-07 10:55 [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly Peter Baumann
@ 2006-07-09 23:12 ` Martin Langhoff (CatalystIT)
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Langhoff (CatalystIT) @ 2006-07-09 23:12 UTC (permalink / raw)
  To: Peter Baumann; +Cc: git, Junio C Hamano

Peter Baumann wrote:
> 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.
> 

Ack. Thanks for spotting this!


m
-- 
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224                              MOB: +64(21)364-017
       Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-09 23:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-07 10:55 [BUGFIX][RESEND]git-cvsexportcommit can't handle merge commits correctly Peter Baumann
2006-07-09 23:12 ` Martin Langhoff (CatalystIT)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).