summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog54
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules7
-rwxr-xr-xdgit222
-rw-r--r--dgit.1356
5 files changed, 413 insertions, 228 deletions
diff --git a/debian/changelog b/debian/changelog
index d982788..e473f2b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,20 +1,50 @@
-dgit (0.13~experimental2) experimental; urgency=low
+dgit (0.16~experimental1) experimental; urgency=low
- * Upload to experimental to test dgit push.
+ * WIP remote functionality. Untested, do not use.
- -- Ian Jackson <ijackson@chiark.greenend.org.uk> Wed, 28 Aug 2013 23:33:01 +0100
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Tue, 24 Sep 2013 23:08:27 +0100
-dgit (0.13~experimental1) experimental; urgency=low
+dgit (0.15) unstable; urgency=low
+
+ * Better handling of packages pushed using dgit and stuck in NEW.
+ (And, use of `--new' is not needed with fetch.) Closes: #722199.
+ * More comprehensive warnings in many cases of archive skew.
+ * Implement `dgit help' as well as `--help'. Closes: #721661.
+ * Provide `dgit version' and `--version'. Closes: #721654.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Thu, 12 Sep 2013 00:14:05 +0100
+
+dgit (0.14) unstable; urgency=low
+
+ * Include package name in tag message.
+ * Create directory .git/dgit when needed during build. Closes: #721428.
+ * Add Vcs-Git and Vcs-Browser [Richard Hartmann]. Closes: #721404.
+ These fields refer to the development branch, "master", on alioth,
+ not to the dgit suite refs (which are not accessible to git clone).
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Sun, 01 Sep 2013 18:30:44 +0100
+
+dgit (0.13) unstable; urgency=low
- * Upload to experimental to test dgit push.
* Reuse already-downloaded .orig files after checking their hashes.
- Closes: #720526. (This introduces a dependency on the Digest::SHA.)
+ Closes: #720526. (This introduces a dependency on Digest::SHA.)
* Do not always pointlessly fetch the .dsc twice. (That code was
erroneously duplicated during editing, apparently.)
* Remove DGET_UNPACK from the environment in case the user has set it.
* Remove scary warning from Description.
-
- -- Ian Jackson <ijackson@chiark.greenend.org.uk> Wed, 28 Aug 2013 23:19:09 +0100
+ * When uploading to Debian, tell dput to upload to "ftp-master". This
+ avoids problems with derivatives whose dput has a different default.
+ Closes: #720958.
+ * Fix some bugs in dgit fetch --dry-run which made dgit push
+ --dry-run often not work at all.
+ * Update the local tracking branch for the dgit remote, when pushing.
+ Closes: #720956.
+ * Fix references in manpage to old Vcs-Dgit-Master field name.
+ * Reorganise manpage sections to be in a more conventional order.
+ * New manpage section on FILES IN THE SOURCE PACKAGE BUT NOT IN GIT.
+ Closes: #721186.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Thu, 29 Aug 2013 00:27:23 +0100
dgit (0.12) unstable; urgency=low
@@ -72,14 +102,6 @@ dgit (0.9) unstable; urgency=low
-- Ian Jackson <ijackson@chiark.greenend.org.uk> Sat, 24 Aug 2013 18:49:02 +0100
-dgit (0.8+nmu1) experimental; urgency=low
-
- * Non-maintainer upload.
- (This is a test NMU with no changes, to verify #720522 has been fixed
- and NMUing in general works.)
-
- -- Joey Hess <joeyh@debian.org> Fri, 23 Aug 2013 11:55:35 -0400
-
dgit (0.8) unstable; urgency=low
* Fix comparison of archive's .dsc's hash and git branch head
diff --git a/debian/control b/debian/control
index 8f15413..a90b6ff 100644
--- a/debian/control
+++ b/debian/control
@@ -4,6 +4,8 @@ Priority: optional
Maintainer: Ian Jackson <ijackson@chiark.greenend.org.uk>
Standards-Version: 3.9.4.0
Build-Depends: debhelper (>= 9)
+Vcs-Git: git://anonscm.debian.org/dgit-repos/repos/dgit.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=dgit-repos/repos/dgit.git
Package: dgit
Depends: perl, libwww-perl, libdpkg-perl, git-core, devscripts, dpkg-dev,
diff --git a/debian/rules b/debian/rules
index e4a2460..fece672 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,3 +22,10 @@ export prefix=/usr
%:
dh $@
+
+override_dh_gencontrol:
+ dh_gencontrol
+ set -e; \
+ cd debian/dgit; \
+ v=$$(perl -ne 'print if s/^version:\s+//i' DEBIAN/control); \
+ perl -i -pe "s/UNRELEASED/$$v/g if m/###substituted###/" usr/bin/dgit
diff --git a/dgit b/dgit
index 9d1570c..3a91929 100755
--- a/dgit
+++ b/dgit
@@ -28,6 +28,8 @@ use File::Basename;
use Dpkg::Version;
use POSIX;
+our $our_version = 'UNRELEASED'; ###substituted###
+
our $isuite = 'unstable';
our $idistro;
our $package;
@@ -47,6 +49,7 @@ our (@git) = qw(git);
our (@dget) = qw(dget);
our (@dput) = qw(dput);
our (@debsign) = qw(debsign);
+our (@gpg) = qw(gpg);
our (@sbuild) = qw(sbuild -A);
our (@dpkgbuildpackage) = qw(dpkg-buildpackage -i\.git/ -I.git);
our (@dpkgsource) = qw(dpkg-source -i\.git/ -I.git);
@@ -57,6 +60,7 @@ our (@changesopts) = ('');
our %opts_opt_map = ('dget' => \@dget,
'dput' => \@dput,
'debsign' => \@debsign,
+ 'gpg' => \@gpg,
'sbuild' => \@sbuild,
'dpkg-source' => \@dpkgsource,
'dpkg-buildpackage' => \@dpkgbuildpackage,
@@ -129,7 +133,7 @@ sub url_get {
return $r->decoded_content();
}
-our ($dscdata,$dscurl,$dsc);
+our ($dscdata,$dscurl,$dsc,$skew_warning_vsn);
sub printcmd {
my $fh = shift @_;
@@ -207,6 +211,11 @@ sub runcmd_ordryrun {
}
}
+sub shell_cmd {
+ my ($first_shell, @cmd) = @_;
+ return qw(sh -ec), $first_shell.'; exec "$@"', 'x', @cmd;
+}
+
our $helpmsg = <<END;
main usages:
dgit [dgit-opts] clone [dgit-opts] package [suite] [./dir|/dir]
@@ -230,7 +239,7 @@ sub badusage {
exit 8;
}
-sub helponly () {
+sub cmd_help () {
print $helpmsg or die $!;
exit 0;
}
@@ -247,6 +256,7 @@ our %defcfg = ('dgit.default.distro' => 'debian',
'dgit-distro.debian.sshdakls-host' => 'coccia.debian.org',
'dgit-distro.debian.sshdakls-dir' =>
'/srv/ftp-master.debian.org/ftp/dists',
+ 'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/');
sub cfg {
@@ -332,7 +342,7 @@ sub getfield ($$) {
sub parsechangelog {
my $c = Dpkg::Control::Hash->new();
my $p = new IO::Handle;
- my @cmd = (qw(dpkg-parsechangelog));
+ my @cmd = (qw(dpkg-parsechangelog), @_);
open $p, '-|', @cmd or die $!;
$c->parse($p);
$?=0; $!=0; close $p or failedcmd @cmd;
@@ -442,16 +452,19 @@ sub get_archive_dsc () {
my ($vsn,$subpath) = @$vinfo;
$dscurl = access_cfg('mirror').$subpath;
$dscdata = url_get($dscurl);
- next unless defined $dscdata;
+ if (!$dscdata) {
+ $skew_warning_vsn = $vsn if !defined $skew_warning_vsn;
+ next;
+ }
my $dscfh = new IO::File \$dscdata, '<' or die $!;
print DEBUG Dumper($dscdata) if $debug>1;
$dsc = parsecontrolfh($dscfh,$dscurl, allow_pgp=>1);
print DEBUG Dumper($dsc) if $debug>1;
my $fmt = getfield $dsc, 'Format';
fail "unsupported source format $fmt, sorry" unless $format_ok{$fmt};
- return $dsc;
+ return;
}
- return undef;
+ $dsc = undef;
}
sub check_for_git () {
@@ -482,7 +495,7 @@ sub create_remote_git_repo () {
}
}
-our ($dsc_hash,$upload_hash);
+our ($dsc_hash,$lastpush_hash);
our $ud = '.git/dgit/unpack';
@@ -551,6 +564,18 @@ sub make_commit ($) {
return cmdoutput @git, qw(hash-object -w -t commit), $file;
}
+sub clogp_authline ($) {
+ my ($clogp) = @_;
+ my $author = getfield $clogp, 'Maintainer';
+ $author =~ s#,.*##ms;
+ my $date = cmdoutput qw(date), '+%s %z', qw(-d), getfield($clogp,'Date');
+ my $authline = "$author $date";
+ $authline =~ m/^[^<>]+ \<\S+\> \d+ [-+]\d+$/ or
+ fail "unexpected commit author line format \`$authline'".
+ " (was generated from changelog Maintainer field)";
+ return $authline;
+}
+
sub generate_commit_from_dsc () {
prep_ud();
chdir $ud or die $!;
@@ -571,13 +596,7 @@ sub generate_commit_from_dsc () {
my ($tree,$dir) = mktree_in_ud_from_only_subdir();
runcmd qw(sh -ec), 'dpkg-parsechangelog >../changelog.tmp';
my $clogp = parsecontrol('../changelog.tmp',"commit's changelog");
- my $date = cmdoutput qw(date), '+%s %z', qw(-d), getfield($clogp,'Date');
- my $author = getfield $clogp, 'Maintainer';
- $author =~ s#,.*##ms;
- my $authline = "$author $date";
- $authline =~ m/^[^<>]+ \<\S+\> \d+ [-+]\d+$/ or
- fail "unexpected commit author line format \`$authline'".
- " (was generated from changelog Maintainer field)";
+ my $authline = clogp_authline $clogp;
my $changes = getfield $clogp, 'Changes';
open C, ">../commit.tmp" or die $!;
print C <<END or die $!;
@@ -593,8 +612,8 @@ END
my $outputhash = make_commit qw(../commit.tmp);
my $cversion = getfield $clogp, 'Version';
print "synthesised git commit from .dsc $cversion\n";
- if ($upload_hash) {
- runcmd @git, qw(reset --hard), $upload_hash;
+ if ($lastpush_hash) {
+ runcmd @git, qw(reset --hard), $lastpush_hash;
runcmd qw(sh -ec), 'dpkg-parsechangelog >>../changelogold.tmp';
my $oldclogp = parsecontrol('../changelogold.tmp','previous changelog');
my $oversion = getfield $oldclogp, 'Version';
@@ -605,7 +624,7 @@ END
open C, ">../commit2.tmp" or die $!;
print C <<END or die $!;
tree $tree
-parent $upload_hash
+parent $lastpush_hash
parent $outputhash
author $authline
committer $authline
@@ -620,9 +639,9 @@ Version actually in archive: $cversion (older)
Last allegedly pushed/uploaded: $oversion (newer or same)
$later_warning_msg
END
- $outputhash = $upload_hash;
+ $outputhash = $lastpush_hash;
} else {
- $outputhash = $upload_hash;
+ $outputhash = $lastpush_hash;
}
}
chdir '../../../..' or die $!;
@@ -657,8 +676,7 @@ sub ensure_we_have_orig () {
$origurl .= "/$f";
die "$f ?" unless $f =~ m/^${package}_/;
die "$f ?" if $f =~ m#/#;
- runcmd_ordryrun qw(sh -ec),'cd ..; exec "$@"','x',
- @dget,'--',$origurl;
+ runcmd_ordryrun shell_cmd 'cd ..', @dget,'--',$origurl;
}
}
@@ -679,69 +697,112 @@ sub is_fast_fwd ($$) {
}
sub git_fetch_us () {
- badusage "cannot dry run with fetch" if $dryrun;
- runcmd @git, qw(fetch),access_giturl(),fetchspec();
+ runcmd_ordryrun @git, qw(fetch),access_giturl(),fetchspec();
}
sub fetch_from_archive () {
# ensures that lrref() is what is actually in the archive,
# one way or another
- get_archive_dsc() or return 0;
- foreach my $field (@ourdscfield) {
- $dsc_hash = $dsc->{$field};
- last if defined $dsc_hash;
- }
- if (defined $dsc_hash) {
- $dsc_hash =~ m/\w+/ or fail "invalid hash in .dsc \`$dsc_hash'";
- $dsc_hash = $&;
- print "last upload to archive specified git hash\n";
+ get_archive_dsc();
+
+ if ($dsc) {
+ foreach my $field (@ourdscfield) {
+ $dsc_hash = $dsc->{$field};
+ last if defined $dsc_hash;
+ }
+ if (defined $dsc_hash) {
+ $dsc_hash =~ m/\w+/ or fail "invalid hash in .dsc \`$dsc_hash'";
+ $dsc_hash = $&;
+ print "last upload to archive specified git hash\n";
+ } else {
+ print "last upload to archive has NO git hash\n";
+ }
} else {
- print "last upload to archive has NO git hash\n";
+ print "no version available from the archive\n";
}
my $lrref_fn = ".git/".lrref();
if (open H, $lrref_fn) {
- $upload_hash = <H>;
- chomp $upload_hash;
- die "$lrref_fn $upload_hash ?" unless $upload_hash =~ m/^\w+$/;
+ $lastpush_hash = <H>;
+ chomp $lastpush_hash;
+ die "$lrref_fn $lastpush_hash ?" unless $lastpush_hash =~ m/^\w+$/;
} elsif ($! == &ENOENT) {
- $upload_hash = '';
+ $lastpush_hash = '';
} else {
die "$lrref_fn $!";
}
- print DEBUG "previous reference hash=$upload_hash\n";
+ print DEBUG "previous reference hash=$lastpush_hash\n";
my $hash;
if (defined $dsc_hash) {
fail "missing git history even though dsc has hash -".
" could not find commit $dsc_hash".
" (should be in ".access_giturl()."#".rrref().")"
- unless $upload_hash;
+ unless $lastpush_hash;
$hash = $dsc_hash;
ensure_we_have_orig();
- if ($dsc_hash eq $upload_hash) {
- } elsif (is_fast_fwd($dsc_hash,$upload_hash)) {
+ if ($dsc_hash eq $lastpush_hash) {
+ } elsif (is_fast_fwd($dsc_hash,$lastpush_hash)) {
print STDERR <<END or die $!;
Git commit in archive is behind the last version allegedly pushed/uploaded.
Commit referred to by archive: $dsc_hash
-Last allegedly pushed/uploaded: $upload_hash
+Last allegedly pushed/uploaded: $lastpush_hash
$later_warning_msg
END
- $hash = $upload_hash;
+ $hash = $lastpush_hash;
} else {
fail "archive's .dsc refers to ".$dsc_hash.
- " but this is an ancestor of ".$upload_hash;
+ " but this is an ancestor of ".$lastpush_hash;
}
- } else {
+ } elsif ($dsc) {
$hash = generate_commit_from_dsc();
+ } elsif ($lastpush_hash) {
+ # only in git, not in the archive yet
+ $hash = $lastpush_hash;
+ print STDERR <<END or die $!;
+
+Package not found in the archive, but has allegedly been pushed using dgit.
+$later_warning_msg
+END
+ } else {
+ print DEBUG "nothing found!\n";
+ if (defined $skew_warning_vsn) {
+ print STDERR <<END or die $!;
+
+Warning: relevant archive skew detected.
+Archive allegedly contains $skew_warning_vsn
+But we were not able to obtain any version from the archive or git.
+
+END
+ }
+ return 0;
}
print DEBUG "current hash=$hash\n";
- if ($upload_hash) {
+ if ($lastpush_hash) {
fail "not fast forward on last upload branch!".
" (archive's version left in DGIT_ARCHIVE)"
- unless is_fast_fwd($upload_hash, $hash);
+ unless is_fast_fwd($lastpush_hash, $hash);
}
- if ($upload_hash ne $hash) {
+ if (defined $skew_warning_vsn) {
+ mkpath '.git/dgit';
+ print DEBUG "SKEW CHECK WANT $skew_warning_vsn\n";
+ my $clogf = ".git/dgit/changelog.tmp";
+ runcmd shell_cmd "exec >$clogf",
+ @git, qw(cat-file blob), "$hash:debian/changelog";
+ my $gotclogp = parsechangelog("-l$clogf");
+ my $got_vsn = getfield $gotclogp, 'Version';
+ print DEBUG "SKEW CHECK GOT $got_vsn\n";
+ if (version_compare_string($got_vsn, $skew_warning_vsn) < 0) {
+ print STDERR <<END or die $!;
+
+Warning: archive skew detected. Using the available version:
+Archive allegedly contains $skew_warning_vsn
+We were able to obtain only $got_vsn
+
+END
+ }
+ }
+ if ($lastpush_hash ne $hash) {
my @upd_cmd = (@git, qw(update-ref -m), 'dgit fetch', lrref(), $hash);
if (!$dryrun) {
cmdoutput @upd_cmd;
@@ -767,7 +828,7 @@ sub clone ($) {
if (check_for_git()) {
print "fetching existing git history\n";
git_fetch_us();
- runcmd @git, qw(fetch origin);
+ runcmd_ordryrun @git, qw(fetch origin);
} else {
print "starting new git history\n";
}
@@ -883,7 +944,8 @@ sub dopush () {
# runcmd @git, qw(fetch -p ), "$alioth_git/$package.git",
# map { lref($_).":".rref($_) }
# (uploadbranch());
- $dsc->{$ourdscfield[0]} = rev_parse('HEAD');
+ my $head = rev_parse('HEAD');
+ $dsc->{$ourdscfield[0]} = $head;
$dsc->save("../$dscfn.tmp") or die $!;
if (!$changesfile) {
my $multi = "../${package}_".(stripepoch $cversion)."_multi.changes";
@@ -907,24 +969,56 @@ sub dopush () {
" does not match changelog \`$clogp->{$field}'";
}
my $tag = debiantag($dversion);
+ runcmd @git, qw(check-ref-format), $tag;
+
+ # We make the git tag by hand because (a) that makes it easier
+ # to control the "tagger" (b) we can do remote signing
+ my $authline = clogp_authline $clogp;
+ my $tfn = sub { ".git/dgit/tag$_[0]"; };
+ open TO, '>', $tfn->('.tmp') or die $!;
+ print TO <<END or die $!;
+object $head
+type commit
+tag $tag
+tagger $authline
+
+$package release $dversion for $csuite [dgit]
+END
+ close TO or die $!;
+
+ my $tagobjfn = $tfn->('.tmp');
+ if ($sign) {
+ if (!defined $keyid) {
+ $keyid = access_cfg('keyid','RETURN-UNDEF');
+ }
+ unlink $tfn->('.tmp.asc') or $!==&ENOENT or die $!;
+ my @sign_cmd = (@gpg, qw(--detach-sign --armor));
+ push @sign_cmd, qw(-u),$keyid if defined $keyid;
+ push @sign_cmd, $tfn->('.tmp');
+ runcmd_ordryrun @sign_cmd;
+ if (!$dryrun) {
+ $tagobjfn = $tfn->('.signed.tmp');
+ runcmd shell_cmd "> $tagobjfn", qw(cat --),
+ $tfn->('.tmp'), $tfn->('.tmp.asc');
+ }
+ }
+ my $tag_obj_hash = runcmd @git, qw(hash-object -w -t tag), $tagobjfn;
+ runcmd_ordryrun @git, qw(verify-tag), $tag_obj_hash;
+ runcmd_ordryrun @git, qw(update-ref), "refs/tags/$tag", $tag_obj_hash;
+ runcmd_ordryrun @git, qw(tag -v --), $tag;
+
if (!check_for_git()) {
create_remote_git_repo();
}
runcmd_ordryrun @git, qw(push),access_giturl(),"HEAD:".rrref();
+ runcmd_ordryrun @git, qw(update-ref -m), 'dgit push', lrref(), 'HEAD';
if (!$dryrun) {
rename "../$dscfn.tmp","../$dscfn" or die "$dscfn $!";
} else {
print "[new .dsc left in $dscfn.tmp]\n";
}
+
if ($sign) {
- if (!defined $keyid) {
- $keyid = access_cfg('keyid','RETURN-UNDEF');
- }
- my @tag_cmd = (@git, qw(tag -s -m),
- "Release $dversion for $csuite [dgit]");
- push @tag_cmd, qw(-u),$keyid if defined $keyid;
- push @tag_cmd, $tag;
- runcmd_ordryrun @tag_cmd;
my @debsign_cmd = @debsign;
push @debsign_cmd, "-k$keyid" if defined $keyid;
push @debsign_cmd, $changesfile;
@@ -1054,6 +1148,7 @@ sub build_maybe_quilt_fixup () {
my $ncommits = 3;
my $patchname = "auto-$version-$headref-$time";
my $msg = cmdoutput @git, qw(log), "-n$ncommits";
+ mkpath '.git/dgit';
my $descfn = ".git/dgit/quilt-description.tmp";
open O, '>', $descfn or die "$descfn: $!";
$msg =~ s/\n/\n /g;
@@ -1197,6 +1292,11 @@ sub cmd_quilt_fixup {
build_maybe_quilt_fixup();
}
+sub cmd_version {
+ print "dgit version $our_version\n" or die $!;
+ exit 0;
+}
+
sub parseopts () {
my $om;
while (@ARGV) {
@@ -1209,7 +1309,9 @@ sub parseopts () {
} elsif (m/^--no-sign$/) {
$sign=0;
} elsif (m/^--help$/) {
- helponly();
+ cmd_help();
+ } elsif (m/^--version$/) {
+ cmd_version();
} elsif (m/^--new$/) {
$new_package=1;
} elsif (m/^--(\w+)=(.*)/s &&
@@ -1239,7 +1341,7 @@ sub parseopts () {
if (s/^-n/-/) {
$dryrun=1;
} elsif (s/^-h/-/) {
- helponly();
+ cmd_help();
} elsif (s/^-D/-/) {
open DEBUG, ">&STDERR" or die $!;
$debug++;
diff --git a/dgit.1 b/dgit.1
index f97e458..251af59 100644
--- a/dgit.1
+++ b/dgit.1
@@ -102,6 +102,9 @@ and
Tagging, signing and actually uploading should be left to dgit push.
.TP
+.B dgit help
+Print a usage summary.
+.TP
\fBdgit sbuild\fR ...
Constructs the source package, uses
.B sbuild
@@ -148,6 +151,148 @@ by making a new debian/ patch containing your unquilty changes) and
make a commit of the changes it has made.
This is normally done automatically by dgit build and dgit push.
+.TP
+.B dgit version
+Prints version information and exits.
+.SH OPTIONS
+.TP
+.BR --dry-run | -n
+Go through the motions, fetching all information needed, but do not
+actually update the output(s). For push, dgit does
+the required checks and leaves the new .dsc in a temporary file,
+but does not sign, tag, push or upload.
+.TP
+.BI -k keyid
+Use
+.I keyid
+for signing the tag and the upload.
+.TP
+.BR --no-sign
+does not sign tags or uploads (meaningful only with push).
+.TP
+.TP
+.BI -p package
+Specifies that we should process source package
+.I package
+rather than looking in debian/control or debian/changelog.
+Valid with dgit fetch and dgit pull, only.
+.TP
+.BR --clean=git | -wg
+The source tree should be cleaned, before building a source package
+with one of the build options, using
+.BR "git clean -xdf" .
+This will delete all files which are not tracked by git.
+.TP
+.BR --clean=none | -wn
+Do not clean the tree before building a source package. If there are
+files which are not in git, a subsequent dgit push will fail.
+.TP
+.BR --clean=dpkg-source | -wd
+Use dpkg-buildpackage to do the build, so that the source package
+is cleaned by dpkg-source running the package's clean target.
+This is the default. It requires the package's build dependencies.
+.TP
+.BR -N | --new
+The package may be new in this suite. Without this, dgit will
+refuse to push.
+.TP
+.BR --ignore-dirty
+Do not complain if the working tree does not match your git HEAD.
+This can be useful with build, if you plan to commit later. (dgit
+push will still ensure that the .dsc you upload and the git tree
+you push are identical, so this option won't make broken pushes.)
+
+This option may not work properly on `3.0 (quilt)' packages, as in
+that case dgit needs to use and perhaps commit parts of your working
+tree.
+.TP
+.BR --no-quilt-fixup
+Do not fix up source format `3.0 (quilt)' metadata. If you use this
+option and the package did in fact need fixing up, dgit push will
+fail.
+.TP
+.BI -D
+Prints debugging information to stderr. Repeating the option produces
+more output (currently, up to -DD is meaningfully different).
+.TP
+.BI -c name = value
+Specifies a git configuration option. dgit itself is also controlled
+by git configuration options.
+.TP
+.RI \fB-v\fR version |\fB-m\fR maintaineraddress
+Passed to dpkg-genchanges (eventually).
+.TP
+.RI \fB--ch:\fR option
+Specifies a single additional option to pass, eventually, to
+dpkg-genchanges.
+.TP
+.RI \fB--dget=\fR program |\fB--dput=\fR program |...
+Specifies alternative programs to use instead of
+.BR dget ,
+.BR dput ,
+.BR debsign ,
+.BR dpkg-source ,
+.BR dpkg-buildpackage ,
+.BR dpkg-genchanges ,
+.BR sbuild ,
+or
+.BR mergechanges .
+This applies only when the program is invoked directly by dgit.
+.TP
+.RI \fB--dget:\fR option |\fB--dput:\fR option |...
+Specifies a single additional option to pass to
+.BR dget ,
+.BR dput ,
+.BR debsign ,
+.BR dpkg-source ,
+.BR dpkg-buildpackage ,
+.BR dpkg-genchanges ,
+.BR sbuild ,
+or
+.BR mergechanges .
+Can be repeated as necessary.
+This applies only when the program is invoked directly by dgit.
+Usually, for passing options to dpkg-genchanges, use
+.BR --ch: \fIoption\fR.
+.TP
+.BR -d "\fIdistro\fR | " --distro= \fIdistro\fR
+Specifies that the suite to be operated on is part of distro
+.IR distro .
+This overrides the default value found from the git config option
+.BR dgit-suite. \fIsuite\fR .distro .
+The only effect is that other configuration variables (used
+for accessing the archive and dgit-repos) used are
+.BR dgit-distro. \fIdistro\fR .* .
+
+If your suite is part of a distro that dgit already knows about, you
+can use this option to make dgit work even if your dgit doesn't know
+about the suite. For example, specifying
+.B -ddebian
+will work when the suite is an unknown suite in the Debian archive.
+
+To define a new distro it is necessary to define methods and URLs
+for fetching (and, for dgit push, altering) a variety of information both
+in the archive and in dgit-repos. How to do this is not yet
+documented, and currently the arrangements are unpleasant. See
+BUGS.
+.TP
+.BI -C changesfile
+Specifies the .changes file which is to be uploaded. By default
+dgit push looks for single .changes file in the parent directory whose
+filename suggests it is for the right package and version - or,
+if there is a _multi.changes file, dgit uses that.
+.TP
+.BI --existing-package= package
+dgit push needs to canonicalise the suite name. But currently
+there is no way to ask the archive to do this without knowing the
+name of an existing package. Without --new we can just use the
+package we are trying to push. But with --new that will not work, so
+we guess
+.B dpkg
+or use the value of this option.
+.TP
+.BR -h | --help
+Print a usage summary.
.SH WORKFLOW - SIMPLE
It is always possible with dgit to clone or fetch a package, make
changes in git (using git-commit) on the suite branch
@@ -232,7 +377,7 @@ dgit push can operate on any commit which is a descendant of the
current dgit/suite tip in dgit-repos.
Uploads made by dgit contain an additional field
-.B Vcs-Dgit-Master
+.B Dgit
in the source package .dsc. (This is added by dgit push.)
This specifies a commit (an ancestor of the dgit/suite
branch) whose tree is identical to the unpacked source upload.
@@ -300,154 +445,51 @@ You can explicitly request that dgit do just this fixup, by running
dgit quilt-fixup.
We recommend against the use of `3.0 (quilt)'.
-.SH OPTIONS
-.TP
-.BR --dry-run | -n
-Go through the motions, fetching all information needed, but do not
-actually update the output(s). For push, dgit does
-the required checks and leaves the new .dsc in a temporary file,
-but does not sign, tag, push or upload.
-.TP
-.BI -k keyid
-Use
-.I keyid
-for signing the tag and the upload.
-.TP
-.BR --no-sign
-does not sign tags or uploads (meaningful only with push).
-.TP
-.TP
-.BI -p package
-Specifies that we should process source package
-.I package
-rather than looking in debian/control or debian/changelog.
-Valid with dgit fetch and dgit pull, only.
-.TP
-.BR --clean=git | -wg
-The source tree should be cleaned, before building a source package
-with one of the build options, using
-.BR "git clean -xdf" .
-This will delete all files which are not tracked by git.
-.TP
-.BR --clean=none | -wn
-Do not clean the tree before building a source package. If there are
-files which are not in git, a subsequent dgit push will fail.
-.TP
-.BR --clean=dpkg-source | -wd
-Use dpkg-buildpackage to do the build, so that the source package
-is cleaned by dpkg-source running the package's clean target.
-This is the default. It requires the package's build dependencies.
-.TP
-.BR -N | --new
-The package may be new in this suite. Without this, dgit will
-refuse to push.
-.TP
-.BR --ignore-dirty
-Do not complain if the working tree does not match your git HEAD.
-This can be useful with build, if you plan to commit later. (dgit
-push will still ensure that the .dsc you upload and the git tree
-you push are identical, so this option won't make broken pushes.)
-
-This option may not work properly on `3.0 (quilt)' packages, as in
-that case dgit needs to use and perhaps commit parts of your working
-tree.
-.TP
-.BR --no-quilt-fixup
-Do not fix up source format `3.0 (quilt)' metadata. If you use this
-option and the package did in fact need fixing up, dgit push will
-fail.
-.TP
-.BI -D
-Prints debugging information to stderr. Repeating the option produces
-more output (currently, up to -DD is meaningfully different).
-.TP
-.BI -c name = value
-Specifies a git configuration option. dgit itself is also controlled
-by git configuration options.
-.TP
-.RI \fB-v\fR version |\fB-m\fR maintaineraddress
-Passed to dpkg-genchanges (eventually).
-.TP
-.RI \fB--ch:\fR option
-Specifies a single additional option to pass, eventually, to
-dpkg-genchanges.
-.TP
-.RI \fB--dget=\fR program |\fB--dput=\fR program |...
-Specifies alternative programs to use instead of
-.BR dget ,
-.BR dput ,
-.BR debsign ,
-.BR dpkg-source ,
-.BR dpkg-buildpackage ,
-.BR dpkg-genchanges ,
-.BR sbuild ,
-or
-.BR mergechanges .
-This applies only when the program is invoked directly by dgit.
-.TP
-.RI \fB--dget:\fR option |\fB--dput:\fR option |...
-Specifies a single additional option to pass to
-.BR dget ,
-.BR dput ,
-.BR debsign ,
-.BR dpkg-source ,
-.BR dpkg-buildpackage ,
-.BR dpkg-genchanges ,
-.BR sbuild ,
-or
-.BR mergechanges .
-Can be repeated as necessary.
-This applies only when the program is invoked directly by dgit.
-Usually, for passing options to dpkg-genchanges, use
-.BR --ch: \fIoption\fR.
-.TP
-.BR -d "\fIdistro\fR | " --distro= \fIdistro\fR
-Specifies that the suite to be operated on is part of distro
-.IR distro .
-This overrides the default value found from the git config option
-.BR dgit-suite. \fIsuite\fR .distro .
-The only effect is that other configuration variables (used
-for accessing the archive and dgit-repos) used are
-.BR dgit-distro. \fIdistro\fR .* .
-
-If your suite is part of a distro that dgit already knows about, you
-can use this option to make dgit work even if your dgit doesn't know
-about the suite. For example, specifying
-.B -ddebian
-will work when the suite is an unknown suite in the Debian archive.
-
-To define a new distro it is necessary to define methods and URLs
-for fetching (and, for dgit push, altering) a variety of information both
-in the archive and in dgit-repos. How to do this is not yet
-documented, and currently the arrangements are unpleasant. See
-BUGS.
-.TP
-.BI -C changesfile
-Specifies the .changes file which is to be uploaded. By default
-dgit push looks for single .changes file in the parent directory whose
-filename suggests it is for the right package and version - or,
-if there is a _multi.changes file, dgit uses that.
-.TP
-.BI --existing-package= package
-dgit push needs to canonicalise the suite name. But currently
-there is no way to ask the archive to do this without knowing the
-name of an existing package. Without --new we can just use the
-package we are trying to push. But with --new that will not work, so
-we guess
-.B dpkg
-or use the value of this option.
-.TP
-.BR -h | --help
-Print a usage summary.
-.SH SEE ALSO
-\fBdget\fP(1),
-\fBdput\fP(1),
-\fBdebsign\fP(1),
-\fBgit-config\fP(1),
-\fBgit-buildpackage\fP(1),
-\fBdpkg-buildpackage\fP(1),
-.br
-https://wiki.debian.org/Alioth
+.SH FILES IN THE SOURCE PACKAGE BUT NOT IN GIT
+This section is mainly of interest to maintainers who want to use dgit
+with their existing git history for the Debian package.
+
+Some developers like to have an extra-clean git tree which lacks files
+which are normally found in source tarballs and therefore in Debian
+source packages. For example, it is conventional to ship ./configure
+in the source tarball, but some people prefer not to have it present
+in the git view of their project.
+
+dgit requires that the source package unpacks to exactly the same
+files as are in the git commit on which dgit push operates. So if you
+just try to dgit push directly from one of these extra-clean git
+branches, it will fail.
+
+As the maintainer you therefore have the following options:
+.TP
+\(bu
+Persuade upstream that the source code in their git history and the
+source they ship as tarballs should be identical. Of course simply
+removing the files from the tarball may make the tarball hard for
+people to use.
+.IP
+One answer is to commit the (maybe autogenerated)
+files, perhaps with some simple automation to deal with conflicts and
+spurious changes. This has the advantage that someone who clones
+the git repository finds the program just as easy to build as someone
+who uses the tarball.
+.TP
+\(bu
+Have separate git branches which do contain the extra files, and after
+regenerating the extra files (whenever you would have to anyway),
+commit the result onto those branches.
+.TP
+\(bu
+Provide source packages which lack the files you don't want
+in git, and arrange for your package build to create them as needed.
+This may mean not using upstream source tarballs and makes the Debian
+source package less useful for people without Debian build
+infrastructure.
+.LP
+Of course it may also be that the differences are due to build system
+bugs, which cause unintended files to end up in the source package.
+dgit will notice this and complain. You may have to fix these bugs
+before you can unify your existing git history with dgit's.
.SH CONFIGURATION
dgit looks at the following git config keys to control its behaviour.
You may set them with git-config (either in system-global or per-tree
@@ -501,7 +543,7 @@ We should be using some kind of vhost/vpath setup for the git repos on
alioth, so that they can be moved later if and when this turns out to
be a good idea.
-Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
+Debian Policy needs to be updated to describe the new Dgit .dsc
field (and to specify that it is an RC bug for that field to refer
to an unavailable commit).
@@ -565,5 +607,15 @@ sane way to find the path in the archive pool of the .dsc for a
particular suite. I'm assured that the archive layout is a
`well known algorithm' by now.
---dry-run often does not work with fetch, even though this is a
-logically plausible request. (It fails, instead.)
+--dry-run does not always work properly, as not doing some of the git
+fetches may result in subsequent actions being different. Doing a
+non-dry-run dgit fetch first will help.
+.SH SEE ALSO
+\fBdget\fP(1),
+\fBdput\fP(1),
+\fBdebsign\fP(1),
+\fBgit-config\fP(1),
+\fBgit-buildpackage\fP(1),
+\fBdpkg-buildpackage\fP(1),
+.br
+https://wiki.debian.org/Alioth