[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756
vestbo at webkit.org
vestbo at webkit.org
Fri Feb 26 22:24:31 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 17e920a193cd134334ab13edd5e13535bf4a4919
Author: vestbo at webkit.org <vestbo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 18 15:51:35 2010 +0000
Teach resolve-ChangeLogs to act as a merge-driver for Git
Reviewed by Eric Seidel.
https://bugs.webkit.org/show_bug.cgi?id=28721
To enable automatic merging of ChangeLog files, use the following command:
git config merge.changelog.driver "resolve-ChangeLogs --merge-driver %O %A %B"
The driver always works in "downstream" merge mode, meaning
it will always put the user's changelog entries on top.
* Scripts/resolve-ChangeLogs:
* .gitattributes: Add instruction to use merge-driver for ChangeLogs
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/.gitattributes b/.gitattributes
index 46ca454..80386ae 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,3 +1,7 @@
+# To enable automatic merging of ChangeLog files, use the following command:
+# git config merge.changelog.driver "resolve-ChangeLogs --merge-driver %O %A %B"
+ChangeLog* merge=changelog
+
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.sln -crlf
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj -crlf
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops -crlf
diff --git a/ChangeLog b/ChangeLog
index 95b89cb..6a5de39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-18 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Add .gitattributes file for custom ChangeLog merge-driver
+
+ * .gitattributes: Added.
+
2010-02-17 Noam Rosenthal <noam.rosenthal at nokia.com>
Reviewed by Ariya Hidayat.
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 37de737..6771bc1 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-18 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Teach resolve-ChangeLogs to act as a merge-driver for Git
+
+ https://bugs.webkit.org/show_bug.cgi?id=28721
+
+ To enable automatic merging of ChangeLog files, use the following command:
+
+ git config merge.changelog.driver "resolve-ChangeLogs --merge-driver %O %A %B"
+
+ The driver always works in "downstream" merge mode, meaning
+ it will always put the user's changelog entries on top.
+
+ * Scripts/resolve-ChangeLogs:
+
2009-12-05 Gustavo Noronha Silva <gns at gnome.org>
Reviewed by Eric Seidel.
diff --git a/WebKitTools/Scripts/resolve-ChangeLogs b/WebKitTools/Scripts/resolve-ChangeLogs
index 1a2d2af..3238350 100755
--- a/WebKitTools/Scripts/resolve-ChangeLogs
+++ b/WebKitTools/Scripts/resolve-ChangeLogs
@@ -34,6 +34,7 @@ use FindBin;
use lib $FindBin::Bin;
use File::Basename;
+use File::Copy;
use File::Path;
use File::Spec;
use Getopt::Long;
@@ -64,28 +65,30 @@ my $GIT = "git";
my $fixMerged;
my $gitRebaseContinue = 0;
+my $mergeDriver = 0;
my $printWarnings = 1;
my $showHelp;
my $getOptionsResult = GetOptions(
- 'c|continue!' => \$gitRebaseContinue,
- 'f|fix-merged:s' => \&parseFixMerged,
- 'h|help' => \$showHelp,
- 'w|warnings!' => \$printWarnings,
+ 'c|continue!' => \$gitRebaseContinue,
+ 'f|fix-merged:s' => \&parseFixMerged,
+ 'm|merge-driver!' => \$mergeDriver,
+ 'h|help' => \$showHelp,
+ 'w|warnings!' => \$printWarnings,
);
my $relativePath = isInGitFilterBranch() ? '.' : chdirReturningRelativePath(determineVCSRoot());
my @changeLogFiles = removeChangeLogArguments($relativePath);
-if (!defined $fixMerged && scalar(@changeLogFiles) == 0) {
+if (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
@changeLogFiles = findUnmergedChangeLogs();
}
-if (scalar(@ARGV) > 0) {
+if (!$mergeDriver && scalar(@ARGV) > 0) {
print STDERR "ERROR: Files listed on command-line that are not ChangeLogs.\n";
undef $getOptionsResult;
-} elsif (!defined $fixMerged && scalar(@changeLogFiles) == 0) {
+} elsif (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
print STDERR "ERROR: No ChangeLog files listed on command-line or found unmerged.\n";
undef $getOptionsResult;
} elsif ($gitRebaseContinue && !$isGit) {
@@ -94,6 +97,12 @@ if (scalar(@ARGV) > 0) {
} elsif (defined $fixMerged && !$isGit) {
print STDERR "ERROR: --fix-merged may only be used with a git repository\n";
undef $getOptionsResult;
+} elsif ($mergeDriver && !$isGit) {
+ print STDERR "ERROR: --merge-driver may only be used with a git repository\n";
+ undef $getOptionsResult;
+} elsif ($mergeDriver && scalar(@ARGV) < 3) {
+ print STDERR "ERROR: --merge-driver expects %O %A %B as arguments\n";
+ undef $getOptionsResult;
}
sub usageAndExit()
@@ -104,6 +113,7 @@ Usage: @{[ basename($0) ]} [options] [path/to/ChangeLog] [path/to/another/Change
entries (default: --no-continue)
-f|--fix-merged [revision-range] fix git-merged ChangeLog entries; if a revision-range
is specified, run git filter-branch on the range
+ -m|--merge-driver %O %A %B act as a git merge-driver on files %O %A %B
-h|--help show this help message
-w|--[no-]warnings show or suppress warnings (default: show warnings)
__END__
@@ -118,6 +128,14 @@ if (defined $fixMerged && length($fixMerged) > 0) {
my $commitRange = $fixMerged;
$commitRange = $commitRange . "..HEAD" if index($commitRange, "..") < 0;
fixMergedChangeLogs($commitRange, @changeLogFiles);
+} elsif ($mergeDriver) {
+ my ($base, $theirs, $ours) = @ARGV;
+ if (mergeChanges($ours, $base, $theirs)) {
+ unlink($ours);
+ copy($theirs, $ours) or die $!;
+ } else {
+ exit 1;
+ }
} elsif (@changeLogFiles) {
for my $file (@changeLogFiles) {
if (defined $fixMerged) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list