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 <agx@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
----