Comment 1 for bug 1942865

Revision history for this message
Bryce Harrington (bryce) wrote (last edit ):

This situation appears to also arise when running the command on a branch that needs a force-push (e.g. after applying changes from an MP review). And Robie's proposed solution sounds like it will address this use case as well.

Example output:

merges-jammy+22.04:~/pkg/Apache2/merge-v2.4.52-1/apache2-gu$ debuild -S -sa -uc -us $(git ubuntu prepare-upload args)
To ssh://git.launchpad.net/~bryce/ubuntu/+source/apache2
 ! [rejected] merge-v2.4.52-1-jammy -> merge-v2.4.52-1-jammy (non-fast-forward)
error: failed to push some refs to 'ssh://<email address hidden>/~bryce/ubuntu/+source/apache2'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
02/04/2022 18:30:35 - ERROR:Command exited 1: git push bryce refs/heads/merge-v2.4.52-1-jammy:refs/heads/merge-v2.4.52-1-jammy
02/04/2022 18:30:35 - ERROR:stdout: [Not captured]

02/04/2022 18:30:35 - ERROR:stderr: [Not captured]

Traceback (most recent call last):
  File "/snap/git-ubuntu/773/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 270, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 170, in cli_printargs
    headers = push(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/prepare_upload.py", line 125, in push
    repo.git_run(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/git_repository.py", line 1802, in git_run
    return git_run(
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/git_repository.py", line 267, in git_run
    return run(['git'] + list(args), env=env, **kwargs)
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/run.py", line 87, in run
    raise e
  File "/snap/git-ubuntu/773/usr/lib/python3/dist-packages/gitubuntu/run.py", line 64, in run
    cp = subprocess.run(
  File "/snap/git-ubuntu/773/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'push', 'bryce', 'refs/heads/merge-v2.4.52-1-jammy:refs/heads/merge-v2.4.52-1-jammy']' returned non-zero exit status 1.
 dpkg-buildpackage -us -uc -ui -i -I.bzr -I.svn -I.git -S -sa
dpkg-buildpackage: info: source package apache2
dpkg-buildpackage: info: source version 2.4.52-1ubuntu1
dpkg-buildpackage: info: source distribution jammy
dpkg-buildpackage: info: source changed by Bryce Harrington <email address hidden>
 dpkg-source -i -I.bzr -I.svn -I.git --before-build .
 fakeroot debian/rules clean
dh clean
   dh_clean
 dpkg-source -i -I.bzr -I.svn -I.git -b .
dpkg-source: warning: upstream signing key but no upstream tarball signature
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building apache2 using existing ./apache2_2.4.52.orig.tar.gz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: warning: ignoring deletion of directory changes-entries
dpkg-source: warning: ignoring deletion of directory test/modules/md/data/store_migrate/1.0/sample1/challenges
dpkg-source: warning: ignoring deletion of directory test/modules/md/data/store_migrate/1.0/sample1/staging
dpkg-source: warning: ignoring deletion of directory test/modules/md/data/store_migrate/1.0/sample1/tmp
dpkg-source: warning: ignoring deletion of directory docs/manual/style/xsl
dpkg-source: warning: ignoring deletion of directory docs/manual/style/xsl/util
dpkg-source: warning: ignoring deletion of directory docs/manual/style/lang
dpkg-source: info: building apache2 in apache2_2.4.52-1ubuntu1.debian.tar.xz
dpkg-source: info: building apache2 in apache2_2.4.52-1ubuntu1.dsc
 dpkg-genbuildinfo --build=source -O../apache2_2.4.52-1ubuntu1_source.buildinfo
 dpkg-genchanges -sa --build=source -O../apache2_2.4.52-1ubuntu1_source.changes
dpkg-genchanges: info: including full source code in upload
 dpkg-source -i -I.bzr -I.svn -I.git --after-build .
dpkg-source: info: unapplying fix-macro.patch
dpkg-source: info: unapplying reproducible_builds.diff
dpkg-source: info: unapplying build_suexec-custom.patch
dpkg-source: info: unapplying customize_apxs.patch
dpkg-source: info: unapplying suexec-CVE-2007-1742.patch
dpkg-source: info: unapplying no_LD_LIBRARY_PATH.patch
dpkg-source: info: unapplying fhs_compliance.patch
dpkg-buildpackage: info: source-only upload (original source is included)
Now running lintian apache2_2.4.52-1ubuntu1_source.changes ...
E: apache2 source: source-is-missing docs/manual/style/scripts/prettify.js
W: apache2 source: mismatched-override source-is-missing docs/manual/style/scripts/prettify.js .*
W: apache2 source: mismatched-override very-long-line-length-in-source-file test/modules/http2/htdocs/test1/*
W: apache2 source: orig-tarball-missing-upstream-signature apache2_2.4.52.orig.tar.gz
N: 7 hints overridden (6 warnings, 1 info); 3 unused overrides
Finished running lintian.