chiark / gitweb /
Provide dgit setup-new-tree (like dpkg-setup-mergechangelogs but only does it if...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2015 20:41:49 +0000 (21:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 27 Jul 2015 02:51:29 +0000 (03:51 +0100)
debian/changelog
dgit
dgit.1

index 8d3cca93831cbdf3d248e1cba0774955c8a430b9..5c9b4f90ccc181665b0b507e348665477709ef44 100644 (file)
@@ -43,6 +43,8 @@ dgit (1.1~~) unstable; urgency=low
   * With -DDDD, print out all gitcfg references (copious!)
   * Fix a debug message in the obsolete sshpsql archive access driver.
   * Make configuration able to prevent dpkg-mergechangelogs setup.
+  * Provide dgit setup-new-tree (like dpkg-setup-mergechangelogs
+    but only does it if not disabled in config).
 
  --
 
diff --git a/dgit b/dgit
index a935cbfacb470e103ca0d05497ec2f44cdf908c2..d8a49dbc60351c60d3bee80e1b963b79b335e10f 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1668,6 +1668,10 @@ sub setup_mergechangelogs (;$) {
     rename "$attrs.new", "$attrs" or die "$attrs: $!";
 }
 
+sub setup_new_tree () {
+    setup_mergechangelogs();
+}
+
 sub clone ($) {
     my ($dstdir) = @_;
     canonicalise_suite();
@@ -1697,7 +1701,7 @@ sub clone ($) {
        $vcsgiturl =~ s/\s+-b\s+\S+//g;
        runcmd @git, qw(remote add vcs-git), $vcsgiturl;
     }
-    setup_mergechangelogs();
+    setup_new_tree();
     runcmd @git, qw(reset --hard), lrref();
     printdone "ready for work in $dstdir";
 }
@@ -3027,6 +3031,11 @@ sub cmd_setup_mergechangelogs {
     setup_mergechangelogs(1);
 }
 
+sub cmd_setup_new_tree {
+    badusage "no arguments allowed to dgit setup-tree" if @ARGV;
+    setup_new_tree();
+}
+
 #---------- argument parsing and main program ----------
 
 sub cmd_version {
diff --git a/dgit.1 b/dgit.1
index 2b626a1408c48f6d2ef983545c7529d2cc4300b4..c0c14504abb1bb13a6221bb0cb7bec768b02bfb9 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -198,6 +198,11 @@ You will need similar enough versions of dgit on the build-host and
 the invocation host.  The build-host needs gnupg installed, with your
 public key in its keyring (but not your private key, obviously).
 .TP
+.B dgit setup-new-tree
+Configure the current working tree the way that dgit clone would have
+set it up.  Like running dgit setup-mergechangelogs (but only does it
+if dgit is configured to do it automatically).
+.TP
 .B dgit setup-mergechangelogs
 Configures a git merge helper for the file
 .B debian/changelog