chiark / gitweb /
wip; tidy; check no unwanted metadata
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Jan 2012 18:06:32 +0000 (18:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Jan 2012 18:06:32 +0000 (18:06 +0000)
Topbloke.pm
tb-create.pl
topbloke-gitattributes [deleted file]

index 79c47b87ad5d522004c289499284a77164fb730b..2c9abe4210641ed0446ee003c97d895d3e0af0a3 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
     @EXPORT      = qw(parse_branch_spec current_tb_branch run_git_1line
-                      setup_config);
+                      setup_config check_no_unwanted_metadata);
     %EXPORT_TAGS = ( );
     @EXPORT_OK   = qw();
 }
@@ -188,7 +188,6 @@ sub setup_config () {
                    die $! if OA->error;
                    die $! unless close OA;
                }
-                       
            }
            print $newattrs "$path\tmerge=$want\n" or die $!;
        }
@@ -198,4 +197,17 @@ sub setup_config () {
     }
 }
 
+sub check_no_unwanted_metadata ($) {
+    my ($gitbranch) = @_;
+    open GIT, "-|", 'git', qw(ls-tree --name-status),
+        "$gitbranch:", qw(.topbloke/included .topbloke/flags)
+           or die $!;
+    while (<GIT>) {
+       chomp or die;
+       die "foreign unexpectedly contains $_\n";
+    }
+    GIT->error and die $!;
+    close GIT or die $!;
+}
+
 1;
index 15b22086c5d7bd9f55e06c74da5590183786e74b..79d42749015088e8e6c883348733bad87dcbc7af 100755 (executable)
@@ -41,7 +41,8 @@ if (!defined $spec->{Date}) {
 
 length($spec->{Date})==18 or die "partial date specified, not supported\n";
 
-fixme check foreign base branch for unwanted topbloke files
+check_no_unwanted_metadata('HEAD')
+    if $current->{Kind} ne 'tip';
 
 my $newbranch = "$spec->{Email}\@$spec->{Domain}/$spec->{Date}/$spec->{Nick}";
 
@@ -50,3 +51,4 @@ $newbranch = run_git_1line(qw(check-ref-format --print), $newbranch);
 printf "creating %s\n", $newbranch;
 
 setup_config();
+
diff --git a/topbloke-gitattributes b/topbloke-gitattributes
deleted file mode 100644 (file)
index 65ec3a8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# v1
-msg    merge=topbloke-msg
-deps   merge=topbloke-deps