[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#854358: unblock: dgit/3.10



Control: tag -1 - moreinfo

Jonathan Wiltshire writes ("Re: Bug#854358: unblock: dgit/3.10"):
> On 2017-02-06 11:30, Ian Jackson wrote:
> > I would like fix some bugs by providing a new dgit in stretch.  I have
> > not yet uploaded this package to sid, in case you dislike some of my
> > changes and want an even more minimal update.  (If that is the case, I
> > can strip them out and retest, since I have them as individual git
> > commits.)
> 
> They look fine. Please go ahead and update this bug when the package is 
> in sid.

Thanks.  Now uploaded.

FTR, I attach the debdiff, which as promised is identical to the
previous diff apart from the changelog timestamp (and diff formatting
differences; git diff produces some more decoration).

Regards,
Ian.

diff -Nru dgit-3.9/debian/changelog dgit-3.10/debian/changelog
--- dgit-3.9/debian/changelog	2017-01-25 16:21:53.000000000 +0000
+++ dgit-3.10/debian/changelog	2017-02-06 17:49:39.000000000 +0000
@@ -1,3 +1,25 @@
+dgit (3.10) unstable; urgency=medium
+
+  Bugfixes:
+  * dgit: Copy several user.* settings from main tree git local config
+    to dgit private workarea.  Closes:#853085.
+  * dgit: Strip initial newline from Changes line from dpkg-parsechangelog
+    so as to avoid blank line in commit messages.  Closes:#853093.
+  * dgit: Do not fail when run with detached HEAD.  Closes:#853022.
+  * dgit: Be much better about commas in maintainer changelog names.
+    Closes:#852661.
+
+  Test suite:
+  * quilt-useremail: New test for user config copying (#853085).
+  * lib-import-chk: Test that commits have smae authorship as appears in
+    the changelog.  (Or, at least, the same authorship set.)
+  * import-maintmangle: New test for changelog Maintainer mangling.
+
+  Documentation:
+  * Fix typos.  Closes:#853125.  [Nicholas D Steeves]
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Mon, 06 Feb 2017 17:49:39 +0000
+
 dgit (3.9) unstable; urgency=medium
 
   Improvements:
diff -Nru dgit-3.9/debian/tests/control dgit-3.10/debian/tests/control
--- dgit-3.9/debian/tests/control	2017-01-23 16:20:07.000000000 +0000
+++ dgit-3.10/debian/tests/control	2017-02-06 17:49:31.000000000 +0000
@@ -29,7 +29,7 @@
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential
 Restrictions: x-dgit-git-only
 
-Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig import-dsc import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt
+Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt
 Tests-Directory: tests/tests
 Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential
 
diff -Nru dgit-3.9/dgit dgit-3.10/dgit
--- dgit-3.9/dgit	2017-01-25 15:43:50.000000000 +0000
+++ dgit-3.10/dgit	2017-02-06 17:49:31.000000000 +0000
@@ -1699,6 +1699,11 @@
 sub mktree_in_ud_here () {
     runcmd qw(git init -q);
     runcmd qw(git config gc.auto 0);
+    foreach my $copy (qw(user.email user.name user.useConfigOnly)) {
+	my $v = $gitcfgs{local}{$copy};
+	next unless $v;
+	runcmd qw(git config), $copy, $_ foreach @$v;
+    }
     rmtree('.git/objects');
     symlink '../../../../objects','.git/objects' or die $!;
     setup_gitattrs(1);
@@ -1990,7 +1995,14 @@
 sub clogp_authline ($) {
     my ($clogp) = @_;
     my $author = getfield $clogp, 'Maintainer';
-    $author =~ s#,.*##ms;
+    if ($author =~ m/^[^"\@]+\,/) {
+	# single entry Maintainer field with unquoted comma
+	$author = ($& =~ y/,//rd).$'; # strip the comma
+    }
+    # git wants a single author; any remaining commas in $author
+    # are by now preceded by @ (or ").  It seems safer to punt on
+    # "..." for now rather than attempting to dequote or something.
+    $author =~ s#,.*##ms unless $author =~ m/"/;
     my $date = cmdoutput qw(date), '+%s %z', qw(-d), getfield($clogp,'Date');
     my $authline = "$author $date";
     $authline =~ m/$git_authline_re/o or
@@ -2312,6 +2324,7 @@
 
     my $authline = clogp_authline $clogp;
     my $changes = getfield $clogp, 'Changes';
+    $changes =~ s/^\n//; # Changes: \n
     my $cversion = getfield $clogp, 'Version';
 
     if (@tartrees) {
@@ -4429,7 +4442,12 @@
 }
 
 sub branchsuite () {
-    my $branch = cmdoutput_errok @git, qw(symbolic-ref HEAD);
+    my @cmd = (@git, qw(symbolic-ref -q HEAD));
+    my $branch = cmdoutput_errok @cmd;
+    if (!defined $branch) {
+	$?==256 or failedcmd @cmd;
+	return undef;
+    }
     if ($branch =~ m#$lbranch_re#o) {
 	return $1;
     } else {
diff -Nru dgit-3.9/dgit-nmu-simple.7.pod dgit-3.10/dgit-nmu-simple.7.pod
--- dgit-3.9/dgit-nmu-simple.7.pod	2017-01-12 01:29:58.000000000 +0000
+++ dgit-3.10/dgit-nmu-simple.7.pod	2017-02-06 17:49:31.000000000 +0000
@@ -56,10 +56,10 @@
 =head1 WHAT KIND OF CHANGES AND COMMITS TO MAKE
 
 When preparing an NMU, the git commits you make on the dgit branch
-should be simple linear series of commmits with good commit messages.
+should be simple linear series of commits with good commit messages.
 The commit messages will be published in various ways,
 including perhaps being used as the cover messages for
-genrated quilt patches.
+generated quilt patches.
 
 Do not make merge commits.
 Do not try to rebase to drop patches - if you need to revert a
diff -Nru dgit-3.9/dgit-user.7.pod dgit-3.10/dgit-user.7.pod
--- dgit-3.9/dgit-user.7.pod	2017-01-18 18:20:58.000000000 +0000
+++ dgit-3.10/dgit-user.7.pod	2017-02-06 17:49:31.000000000 +0000
@@ -232,7 +232,7 @@
 
 Debian package builds are often quite messy:
 they may modify files which are also committed to git,
-or leave outputs and teporary files not covered by C<.gitignore>.
+or leave outputs and temporary files not covered by C<.gitignore>.
 
 If you always commit,
 you can use
diff -Nru dgit-3.9/tests/lib-import-chk dgit-3.10/tests/lib-import-chk
--- dgit-3.9/tests/lib-import-chk	2017-01-12 01:31:01.000000000 +0000
+++ dgit-3.10/tests/lib-import-chk	2017-02-06 17:49:31.000000000 +0000
@@ -1,4 +1,15 @@
 
+t-import-chk-authorship () {
+	perl -ne 'print $1,"\n" if m/^ -- (\S.*\>)  /' debian/changelog \
+		| sort -u \
+		> $tmp/authorship.changelog
+	${import_chk_changelog_massage:-:} $tmp/authorship.changelog
+	git log --pretty=format:'%an <%ae>%n%cn <%ce>' \
+		| sort -u \
+		> $tmp/authorship.commits
+	diff $tmp/authorship.{changelog,commits}
+}
+
 t-import-chk1 () {
 	p=$1
 	v=$2
@@ -15,6 +26,8 @@
 
 	cd $p
 
+	t-import-chk-authorship
+
 	git branch first-import
 
 	m='Commit for import check'
diff -Nru dgit-3.9/tests/tests/import-maintmangle dgit-3.10/tests/tests/import-maintmangle
--- dgit-3.9/tests/tests/import-maintmangle	1970-01-01 01:00:00.000000000 +0100
+++ dgit-3.10/tests/tests/import-maintmangle	2017-02-06 17:49:31.000000000 +0000
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -e
+. tests/lib
+. $troot/lib-import-chk
+
+t-tstunt-parsechangelog
+
+t-select-package example
+v=1.0
+t-worktree $v
+
+cd $p
+
+dsc=${p}_${v}.dsc
+
+chk () {
+	local perl="$1"
+	local unperl="$2"
+	git checkout master~0
+	perl -i -pe "next unless m/^ -- /; $perl" debian/changelog
+	git commit --allow-empty -a -m "perl $perl"
+	(cd ..; dpkg-source -i\.git -I.git -b $p)
+	t-dgit import-dsc ../$dsc +x
+	git checkout x~0
+	t-import-chk-authorship
+}
+
+massage () {
+	perl -i~ -pe "$unperl" "$1"
+}
+
+import_chk_changelog_massage=massage
+
+chk
+
+chk 	's/Ian Jackson/Ian Jackson, SPQR/' \
+	's/Ian Jackson, SPQR/Ian Jackson SPQR/'
+
+chk 	's/Ian Jackson/"Ian Jackson, SPQR"/'
+
+t-ok
diff -Nru dgit-3.9/tests/tests/quilt-useremail dgit-3.10/tests/tests/quilt-useremail
--- dgit-3.9/tests/tests/quilt-useremail	1970-01-01 01:00:00.000000000 +0100
+++ dgit-3.10/tests/tests/quilt-useremail	2017-02-06 17:49:31.000000000 +0000
@@ -0,0 +1,27 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-tstunt-parsechangelog
+t-archive example 1.0-1
+t-worktree 1.0
+t-git-none
+
+cd $p
+
+git checkout quilt-tip-2
+
+t-dgit -wgf fetch
+
+oe=other.email@example.com
+on='Hannibal Barca'
+
+git config --local user.email "$oe"
+git config --local user.name  "$on"
+
+t-dgit -wgf --quilt=smash quilt-fixup
+
+git show | fgrep "$oe"
+git show | fgrep "$on"
+
+t-ok

Reply to: