From: Ian Jackson Date: Fri, 3 Aug 2018 11:18:00 +0000 (+0100) Subject: dgit: Provide print-unapplied-treeish subcommand. X-Git-Tag: archive/debian/6.5~25 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=51a3f746ef8525c1a24085b97e28cc36c85b1268 dgit: Provide print-unapplied-treeish subcommand. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index 4ea57ef2..791066d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. + * dgit: Provide print-unapplied-treeish subcommand. -- diff --git a/dgit b/dgit index 777532eb..48feca95 100755 --- a/dgit +++ b/dgit @@ -6558,6 +6558,24 @@ sub cmd_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); diff --git a/dgit.1 b/dgit.1 index 4ea34da5..a21f212d 100644 --- 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. +.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