+2007-10-29 David Kilzer <ddkilzer@webkit.org>
+
+ Fixed showStatus() to print status for successfully resolved conflicts when using git.
+
+ Reviewed by Mark Rowe.
+
+ Previously showStatus() would run "git diff --name-status" after a ChangeLog conflict
+ was successfully resolved, but this would not show any status because the change had
+ already been cached in the index using "git add". The solution is to add an optional
+ second argument to showStatus() which adds the "--cached" switch to the command.
+
+ * Scripts/resolve-ChangeLogs:
+ (showStatus):
+
2007-10-28 Eric Seidel <eric@webkit.org>
Reviewed by Maciej and Geoff, in unison.
sub fixChangeLogPatch($);
sub mergeChanges($$$);
sub resolveConflict($);
-sub showStatus($);
+sub showStatus($;$);
my $SVN = "svn";
my $GIT = "git";
rename($fileNewer, $file) || die;
unlink($fileMine, $fileOlder);
resolveConflict($file);
- showStatus($file);
+ showStatus($file, 1);
} else {
showStatus($file);
print STDERR "WARNING: ${file} could not be merged using fuzz level 3.\n" if $printWarnings;
}
}
-sub showStatus($)
+sub showStatus($;$)
{
- my ($file) = @_;
+ my ($file, $isConflictResolved) = @_;
if (isSVN()) {
system($SVN, "status", $file);
} elsif (isGit()) {
- system($GIT, "diff", "--name-status", $file);
+ my @args = qw(--name-status);
+ unshift @args, qw(--cached) if $isConflictResolved;
+ system($GIT, "diff", @args, $file);
} else {
die "Unknown version control system";
}