Package: git-buildpackage Version: 0.9.9 Severity: normal Tags: patch Hey,
[ as spoilered over private email ;-) ] We currently grep the log of the pristine-tar branch to find out which compression type the tarball we're interested in has. The regex we use to do that fails when it encounters something unknown - like a merge commit. Like this: gbp:warning: Unknown compression type of Merge branch 'pristine-tar' into 'pristine-tar', assuming gzip gbp:info: Tarballs 'gnome-session_3.29.90.orig.tar.gz' not found at '../tarballs/' gbp:info: Creating /home/laney/dev/debian/packaging/pkg-gnome/build-area/gnome-session_3.29.90.orig.tar.gz gbp:error: Error creating gnome-session_3.29.90.orig.tar.gz: Pristine-tar couldn't checkout "gnome-session_3.29.90.orig.tar.gz": fatal: Path 'gnome-session_3.29.90.orig.tar.gz.delta' does not exist in 'refs/heads/pristine-tar' pristine-tar: git show refs/heads/pristine-tar:gnome-session_3.29.90.orig.tar.gz.delta failed (We might get a merge commit if someone clicks the 'merge' button in salsa, for example.) This can be worked around by passing "--no-merges" to the git log invocation. That's what the attached patch does. Please could you review it? Don't let this stop you from merging the commit (I don't know if I'll have time to write this patch soon if it's the right idea and I have the other one already which works), but is there a reason why we don't use e.g. "git ls-tree -r --name-only pristine-tar" and look at the filenames in the branch directly? Cheers, -- Iain Lane [ i...@orangesquash.org.uk ] Debian Developer [ la...@debian.org ] Ubuntu Developer [ la...@ubuntu.com ]
>From 0e222c0591aec4d9b2644e951b2a07f6205d71c3 Mon Sep 17 00:00:00 2001 From: Iain Lane <la...@debian.org> Date: Fri, 17 Aug 2018 11:22:01 +0100 Subject: [PATCH] Ignore merge commits when looking at the pristine-tar branch When there is a merge commit in this branch, we currently get the warning: gbp:warning: Unknown compression type of Merge branch 'pristine-tar' into 'pristine-tar', assuming gzip because we're grepping the commit logs to find out the compression type of the tarballs in there. For now, we can just use `git log ... --no-merges' to not see these commits. --- gbp/git/repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 1fc92ee9..19778710 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1654,7 +1654,7 @@ class GitRepository(object): @param since: where to start grepping (e.g. a branch) @type since: C{str} """ - args = ['--pretty=format:%H'] + args = ['--pretty=format:%H', '--no-merges'] args.append("--grep=%s" % regex) if since: args.append(since) -- 2.17.1