Package: git-buildpackage
Version: 0.9.29
Severity: normal
User: de...@kali.org
Usertags: origin-kali

Dear Maintainer,

Today 'gbp pull' failed without giving me much details:

  $ 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/kali/master']
  gbp:debug: ['git', 'status', '--porcelain']
  gbp:debug: ['git', 'fetch', '--quiet']
  gbp:debug: ['git', 'fetch', '--quiet', '--tags']
  gbp:error: Error running git fetch:

As you can see, the error message from 'git fetch' was not displayed. So
I had to go patch gbp and drop the '--quiet' argument from the 'git
fetch' command, so that I could understand what was the issue.

Output after I patched:

  $ 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/kali/master']
  gbp:debug: ['git', 'status', '--porcelain']
  gbp:debug: ['git', 'fetch']
  gbp:debug: ['git', 'fetch', '--tags']
  gbp:error: Error running git fetch: From gitlab.com:kalilinux/packages/grub2
   ! [rejected]        kali/2.06-3kali2 -> kali/2.06-3kali2  (would clobber 
existing tag)

That's much better!

Clearly, this '--quiet' argument gets in the way. So first, I tried to
understand where it comes from. I could track the addition of it to this
commit:

  8038a46e77b557ed234a0cfcb3c6109190d1b2c2
  Author: Guido Günther <a...@sigxcpu.org>  2011-11-07 23:37:54
  Subject: GitRepository: fetch and pull quietly

Looking at the code, it seems that at the time (2011!) stdout/stderr
would be displayed "as is" by gbp, therefore the addition of '--quiet'
was meant to make gbp a bit more quiet. At least, that's how I
understand it.

Fast-forward today: the function 'fetch' calls '_git_command', which
captures stderr and stdout, and uses it only internally to display an
error message, if ever there's an error (cf.  `gbp/git/repository.py`).
Then it's discarded (not returned to the caller).

So it seems to me that there's no good reason to use '--quiet' anymore.

Please find a tentative change at:
https://salsa.debian.org/arnaudr/git-buildpackage/-/commit/4c798909

Best regards,

Arnaud

----

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages git-buildpackage depends on:
ii  devscripts             2.22.2
ii  git                    1:2.37.2-1
ii  man-db                 2.11.0-1+b1
ii  python3                3.10.6-1
ii  python3-dateutil       2.8.2-1
ii  python3-pkg-resources  65.5.0-1
ii  python3-yaml           5.4.1-1+b2
ii  sensible-utils         0.0.17

Versions of packages git-buildpackage recommends:
ii  pristine-tar      1.49
ii  python3-requests  2.27.1+dfsg-1
ii  sbuild            0.83.2

Versions of packages git-buildpackage suggests:
pn  python3-notify2  <none>
ii  sudo             1.9.11p3-2
ii  unzip            6.0-27

-- no debconf information

Reply via email to