git ubuntu merge start fails on logwatch

Bug #1810931 reported by Karl Stenerud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Triaged
Low
Unassigned

Bug Description

[Impact]

Attempting to start a merge using git ubuntu fails in the current tree for logwatch.

[Test Case]

$ snap info git-ubuntu
name: git-ubuntu
summary: Ubuntu development git tooling
publisher: Canonical✓
contact: https://bugs.launchpad.net/usd-importer/+filebug
license: unset
description: |
  Imports, clones, etc. a source package in a git tree
commands:
  - git-ubuntu
  - git-ubuntu.import-source-packages
  - git-ubuntu.man
  - git-ubuntu.merge-changelogs
  - git-ubuntu.reconstruct-changelog
  - git-ubuntu.self-test
  - git-ubuntu.source-package-walker
  - git-ubuntu.update-repository-alias
snap-id: VAGSRAriUyDDlqsLunShJTe7503Uw4GF
tracking: edge
refresh-date: 26 days ago, at 16:08 CET
channels:
  stable: 0.7.4+git16.0a79cbc (391) 104MB classic
  candidate: 0.7.4 (392) 105MB classic
  beta: 0.7.4+git148.85bef3c (446) 112MB classic
  edge: 0.7.4+git148.85bef3c (446) 112MB classic
installed: 0.7.4+git148.85bef3c (446) 112MB classic
$ git ubuntu clone logwatch
$ cd logwatch
$ git log|head -1
commit 0a8d80deb8cfdb7aa23ce164238edf784aa8fc60 (HEAD -> ubuntu/devel, tag: pkg/import/7.4.3+git20161207-2ubuntu2, tag: kstenerud/pkg/import/7.4.3+git20161207-2ubuntu2, tag: kstenerud/lp1808319/old/ubuntu, tag: kstenerud/kstenerud/lp1808319/old/ubuntu, pkg/ubuntu/disco-devel, pkg/ubuntu/disco, pkg/ubuntu/devel, pkg/ubuntu/cosmic-proposed, pkg/ubuntu/cosmic-devel, pkg/ubuntu/cosmic)
$ git ubuntu merge start ubuntu/devel --bug 1810928
01/08/2019 12:40:38 - INFO:debian/sid is not a defined object in this git repository.
01/08/2019 12:40:38 - INFO:Creating a local branch named debian/sid tracking pkg/debian/sid.
01/08/2019 12:40:38 - INFO:Created tag lp1810928/old/ubuntu for version 7.4.3+git20161207-2ubuntu2
01/08/2019 12:40:38 - INFO:Created tag lp1810928/old/debian for version 7.4.3+git20161207-2
01/08/2019 12:40:38 - INFO:Created tag lp1810928/new/debian for version 7.5.0-1
01/08/2019 12:40:38 - ERROR:Command exited 1: git cherry-pick --allow-empty --keep-redundant-commits 326ad2e2e15c2eca839ae50537e5c006b7622eb2
01/08/2019 12:40:38 - ERROR:stdout:
01/08/2019 12:40:38 - ERROR:stderr: error: could not apply 326ad2e... changelog
  hint: after resolving the conflicts, mark the corrected paths
  hint: with 'git add <paths>' or 'git rm <paths>'
  hint: and commit the result with 'git commit'

Traceback (most recent call last):
  File "/snap/git-ubuntu/446/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==0.7.4', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/__main__.py", line 243, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/merge.py", line 108, in cli_main
    subcommand=args.subsubcommand,
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/merge.py", line 471, in main
    tag_only,
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/merge.py", line 177, in do_start
    do_reconstruct(repo, tag_prefix, commitish, merge_base_commit_hash, force)
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/merge.py", line 155, in do_reconstruct
    repo.git_run(args)
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 1523, in git_run
    **kwargs,
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 204, in git_run
    return run(['git'] + list(args), env=env, **kwargs)
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/run.py", line 88, in run
    raise e
  File "/snap/git-ubuntu/446/lib/python3.6/site-packages/gitubuntu/run.py", line 67, in run
    stdout=stdout, stderr=stderr, stdin=stdin)
  File "/snap/git-ubuntu/446/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'cherry-pick', '--allow-empty', '--keep-redundant-commits', '326ad2e2e15c2eca839ae50537e5c006b7622eb2']' returned non-zero exit status 1.

Tags: merge
Revision history for this message
Bryce Harrington (bryce) wrote :

Not sure how to reproduce this synthetically, at least at the moment, since the current package is caught up with debian. Checking out 0a8d80deb8cfdb7 and doing the git ubuntu merge start command appears to no longer be sufficient.

Fwiw, I was able to merge logwatch for eoan without this particular issue, although I didn't use the --bug parameter. However, my suspicion is that the --keep-redundant-commits parameter is involved in some fashion here.

Changed in usd-importer:
status: New → Incomplete
Revision history for this message
Bryce Harrington (bryce) wrote :

Found a similar failure with php-imagick:

php-transition-php7x4-c-focal+20.04:~/ubuntu/Php7.4/php-imagick/php-imagick-gu$ git ubuntu merge start ubuntu/devel
02/25/2020 22:56:31 - INFO:debian/sid is not a defined object in this git repository.
02/25/2020 22:56:31 - INFO:Creating a local branch named debian/sid tracking pkg/debian/sid.
02/25/2020 22:56:32 - INFO:Created tag old/ubuntu for version 3.4.3~rc2-2ubuntu7
02/25/2020 22:56:32 - INFO:Created tag old/debian for version 3.4.3~rc2-2
02/25/2020 22:56:32 - INFO:Created tag new/debian for version 3.4.4-3
02/25/2020 22:56:32 - ERROR:Command exited 1: git cherry-pick --allow-empty --keep-redundant-commits cddfbb9afe94ce0f4f56f5494971bbb0c5858f1a
02/25/2020 22:56:32 - ERROR:stdout:
02/25/2020 22:56:32 - ERROR:stderr: error: could not apply cddfbb9... Import patches-unapplied version 3.4.3~rc2-2ubuntu3 to ubuntu/artful-proposed
  hint: after resolving the conflicts, mark the corrected paths
  hint: with 'git add <paths>' or 'git rm <paths>'
  hint: and commit the result with 'git commit'

Traceback (most recent call last):
  File "/snap/git-ubuntu/465/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==0.9.3', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/__main__.py", line 254, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/merge.py", line 108, in cli_main
    subcommand=args.subsubcommand,
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/merge.py", line 471, in main
    tag_only,
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/merge.py", line 177, in do_start
    do_reconstruct(repo, tag_prefix, commitish, merge_base_commit_hash, force)
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/merge.py", line 155, in do_reconstruct
    repo.git_run(args)
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 1559, in git_run
    **kwargs,
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/git_repository.py", line 207, in git_run
    return run(['git'] + list(args), env=env, **kwargs)
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/run.py", line 88, in run
    raise e
  File "/snap/git-ubuntu/465/lib/python3.6/site-packages/gitubuntu/run.py", line 67, in run
    stdout=stdout, stderr=stderr, stdin=stdin)
  File "/snap/git-ubuntu/465/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'cherry-pick', '--allow-empty', '--keep-redundant-commits', 'cddfbb9afe94ce0f4f56f5494971bbb0c5858f1a']' returned non-zero exit status 1.

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

Perhaps of note, php-imagick had been merged via git ubuntu in the past (it has an upload tag), but subsequent uploads were not done through git ubuntu. Could this be what's confusing the cherry-picking?

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

Andreas explained a workaround:

1. git ubuntu clone php-imagick php-imagick-gu
2. cd php-imagick-gu
3. git ubuntu merge start pkg/ubuntu/devel --tag-only
4. git rebase -i old/debian

This presents you with a lengthy list of import changes, which are applied on top of the old/ubuntu tag point. This list needs to be reduced to only what *should* be there. In the editor, delete all the lines down to the "correct

5. From here, proceed with the usual git ubuntu merge process

I noticed there was not a reconstruct/ tag in my merge, which I'm guessing is a side-effect of doing it this way, but not sure if it's important or if so how to do that manually.

Changed in usd-importer:
status: Incomplete → Triaged
importance: Undecided → Low
Robie Basak (racb)
tags: added: merge
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.