Package: git-buildpackage
Version: 0.9.20
Severity: normal
X-Debbugs-Cc: ant...@friki.cat

Dear Maintainer,

I got a non-working situation while using routine-update package.
After tracing down the problem, I've found it's related to 'gbp pull'.

Please, take a look at this example session that reproduces the problem.
  "warning: refname 'master' is ambiguous."

 | % git init foo
 | Initialized empty Git repository in /tmp/foo/.git/
 | % pushd foo
 | % echo HELLO WORLD > README
 | % git add README
 | % git commit -m "Init"
 | [master (root-commit) 69e36c7] Init
 |  1 file changed, 1 insertion(+)
 |  create mode 100644 README
 | % popd
 | % git clone foo bar
 | Cloning into 'bar'...
 | done.
 | % pushd bar
 | % git remote rename origin master
 | % gbp pull --verbose
 | gbp:info: Fetching from default remote for each branch
 | gbp:debug: ['git', 'rev-parse', '--show-cdup']
 | gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
 | gbp:debug: ['git', 'rev-parse', '--git-dir']
 | gbp:debug: ['git', 'symbolic-ref', 'HEAD']
 | gbp:debug: ['git', 'show-ref', 'refs/heads/master']
 | gbp:debug: ['git', 'status', '--porcelain']
 | gbp:debug: ['git', 'fetch', '--quiet']
 | gbp:debug: ['git', 'fetch', '--quiet', '--tags']
 | gbp:debug: ['git', 'config', 'branch.master.remote']
 | gbp:debug: ['git', 'config', 'branch.master.merge']
 | gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/master']
 | gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream']
 | gbp:debug: ['git', 'config', 'branch.master.remote']
 | gbp:debug: ['git', 'config', 'branch.master.merge']
 | gbp:debug: ['git', 'rev-list', '--left-right', 'master...master/master', 
'--']
 | warning: refname 'master' is ambiguous.
 | gbp:info: Branch 'master' is already up to date.
 | gbp:debug: ['git', 'symbolic-ref', 'HEAD']
 | gbp:debug: ['git', 'show-ref', 'refs/heads/master']

I've fixed localy adding 'refs/heads/' to from_branch.

 | --- a/usr/lib/python3/dist-packages/gbp/git/repository.py
 | +++ b/usr/lib/python3/dist-packages/gbp/git/repository.py
 | @@ -509,7 +509,7 @@ class GitRepository(object):
 |          has_remote = False      # remote repo has new commits
 |          out = self._git_getoutput('rev-list',
 |                                    ["--left-right",
 | -                                   "%s...%s" % (from_branch, to_branch),
 | +                                   "%s...%s" % ('refs/heads/' + 
from_branch, to_branch),
 |                                     "--"])[0]
 | 
 |          if not out:  # both branches have the same commits

By now I've didn't noticed bad side effects.

Regards,

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.0-2-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to 
C.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages git-buildpackage depends on:
ii  devscripts             2.20.4
ii  git                    1:2.28.0-1
ii  man-db                 2.9.3-2
ii  python3                3.8.2-3
ii  python3-dateutil       2.8.1-4
ii  python3-pkg-resources  46.1.3-1
ii  sensible-utils         0.0.12+nmu1

Versions of packages git-buildpackage recommends:
ii  cowbuilder        0.88
ii  pbuilder          0.230.4
ii  pristine-tar      1.48+salsaci
ii  python3-requests  2.23.0+dfsg-2

Versions of packages git-buildpackage suggests:
ii  python3-notify2  0.3-4
ii  sudo             1.9.1-2
ii  unzip            6.0-25

-- no debconf information

Reply via email to