chiark / gitweb /
wip attributes, before move .gitattributes back into tree
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Jan 2012 10:36:08 +0000 (10:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Jan 2012 10:36:08 +0000 (10:36 +0000)
FORMAT
Topbloke.pm

diff --git a/FORMAT b/FORMAT
index 258e073205cb39874e446435c7eceb06fd19902e..5c22cc6f9104e74027f89442c22b0380c52ececd 100644 (file)
--- a/FORMAT
+++ b/FORMAT
@@ -22,6 +22,8 @@ In-tree, there are metadata files in .topbloke
                         otherwise fatal.  Currently defined flags:
                                Deleted         branch is deleted
 
+       .gitattributes  Sets the attributes
+
 
 <full-name> has the format:
        <email>@<domain.name>/<yyyy>-<mm>-<dd>T<hh><mm><ss>Z/<nickname-path>
index b8f21a026d776e574c2bec2fb899c7b4524d6f48..8979a6ed851d41171acecdc626d5b7577a55a7e2 100644 (file)
@@ -121,4 +121,19 @@ sub parse_branch_spec ($) {
     return $spec;
 }
 
+sub setup_config () {
+    my ($files) = (qw(msg deps included flags gitattributes));
+    my $version = 1;
+    foreach my $file ($files) {
+       my $cfgname = "merge.topbloke-$file.";
+       my $current = run_git_1line(qw(config), "$cfgname.driver");
+       next if $current =~ m/^topbloke-merge-driver --v$version /o;
+       debug("setting merge driver $file");
+       run_git_1line(qw(config), "$cfgname.name",
+                     "topbloke merge driver for $file");
+       run_git_1line(qw(config), "$cfgname.driver",
+                     "topbloke-merge-driver --v$version $file %O %A %B %L");
+    }
+}
+
 1;