chiark / gitweb /
dgit: Provide print-unapplied-treeish subcommand.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Aug 2018 11:18:00 +0000 (12:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Aug 2018 12:59:13 +0000 (13:59 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit
dgit.1

index 4ea57ef27f9625c155ffa18e00d1299a1ecd2371..791066d03d49a713669b22219cbb5899ee6fb58e 100644 (file)
@@ -3,6 +3,7 @@ dgit (6.5~) unstable; urgency=medium
   * test suite: Add t-tstunt-parsechangelog to many gdr tests.
   * test suite: editing a test script overrides DGIT_TESTS_PROGRESSIVE.
   * dgit: Rename --dgit-view-save to --save-dgit-view, leaving an alias.
   * test suite: Add t-tstunt-parsechangelog to many gdr tests.
   * test suite: editing a test script overrides DGIT_TESTS_PROGRESSIVE.
   * dgit: Rename --dgit-view-save to --save-dgit-view, leaving an alias.
+  * dgit: Provide print-unapplied-treeish subcommand.
 
  --
 
 
  --
 
diff --git a/dgit b/dgit
index 777532ebf2bf7d8caa0a6999a66d4ea5066454a2..48feca950dbf3ab556bc0185970d58c135716b02 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6558,6 +6558,24 @@ sub cmd_quilt_fixup {
     build_maybe_quilt_fixup();
 }
 
     build_maybe_quilt_fixup();
 }
 
+sub cmd_print_unapplied_treeish {
+    badusage "incorrect arguments to dgit print-unapplied-treeish" if @ARGV;
+    my $headref = git_rev_parse('HEAD');
+    my $clogp = commit_getclogp $headref;
+    $package = getfield $clogp, 'Source';
+    $version = getfield $clogp, 'Version';
+    $isuite = getfield $clogp, 'Distribution';
+    $csuite = $isuite; # we want this to be offline!
+    notpushing();
+
+    prep_ud();
+    changedir $playground;
+    my $uv = upstreamversion $version;
+    quilt_make_fake_dsc($uv);
+    my $u = quilt_fakedsc2unapplied($headref, $uv);
+    print $u, "\n" or die $!;
+}
+
 sub import_dsc_result {
     my ($dstref, $newhash, $what_log, $what_msg) = @_;
     my @cmd = (git_update_ref_cmd $what_log, $dstref, $newhash);
 sub import_dsc_result {
     my ($dstref, $newhash, $what_log, $what_msg) = @_;
     my @cmd = (git_update_ref_cmd $what_log, $dstref, $newhash);
diff --git a/dgit.1 b/dgit.1
index 4ea34da50a8f975879e0112be509cb98342b9717..a21f212dc94382ae528a028254122585a7b15937 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -471,6 +471,26 @@ to cause it to exclude exactly the .git diredcory
 and nothing else.
 The separate arguments are unquoted, separated by spaces,
 and do not contain spaces.
 and nothing else.
 The separate arguments are unquoted, separated by spaces,
 and do not contain spaces.
+.TP
+.B dgit print-unapplied-treeish
+Constructs a tree-ish approximating the patches-unapplied state
+of your 3.0 (quilt) package,
+and prints the git object name to stdout.
+This requires appropriate .orig tarballs.
+This tree object is identical to your .origs
+as regards upstream files.
+The contents of the debian subdirectory is not interesting
+and should not be inspected;
+except that debian/patches will be identical to your HEAD.
+
+To make this operate off-line,
+the access configuration key
+which is used to determine the build-products-dir
+is the uncanonicalised version of the suite name from the changelog,
+or (of course) dgit.default.build-products-dir.
+See ACCESS CONFIGURATION, below.
+
+This function is primarily provided for the benefit of git-debrebase.
 .SH OPTIONS
 .TP
 .BR --dry-run " | " -n
 .SH OPTIONS
 .TP
 .BR --dry-run " | " -n