merge finish fails on packages with empty directories

Bug #1939747 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Triaged
Medium
Unassigned

Bug Description

stirling:~/pkg/Apache2/merge-v2.4.48-3.1/apache2-gu$ git ubuntu merge finish base debian/sid
08/11/2021 20:00:52 - ERROR:Command exited 1: git commit -m merge-changelogs debian/changelog
08/11/2021 20:00:52 - ERROR:stdout:
08/11/2021 20:00:52 - ERROR:stderr: ERROR: Empty directories exist and will disappear on commit, causing
  extraneous unintended changes:

  docs/manual/style/lang
  docs/manual/style/xsl/util

  See LP: #1687057.
  Use "git commit --no-verify ..." to ignore this problem.

  pre-commit hook failed.

Traceback (most recent call last):
  File "/snap/git-ubuntu/596/usr/bin/git-ubuntu", line 11, in <module>
    load_entry_point('gitubuntu==1.0', 'console_scripts', 'git-ubuntu')()
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/__main__.py", line 269, in main
    sys.exit(args.func(args))
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/merge.py", line 100, in cli_main
    return main(
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/merge.py", line 474, in main
    return do_finish(
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/merge.py", line 335, in do_finish
    do_merge_changelogs(repo, commitish, merge_base_commit_hash, onto)
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/merge.py", line 206, in do_merge_changelogs
    repo.git_run(['commit', '-m', 'merge-changelogs', 'debian/changelog'])
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/git_repository.py", line 1802, in git_run
    return git_run(
  File "/snap/git-ubuntu/596/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/596/usr/lib/python3/dist-packages/gitubuntu/run.py", line 87, in run
    raise e
  File "/snap/git-ubuntu/596/usr/lib/python3/dist-packages/gitubuntu/run.py", line 64, in run
    cp = subprocess.run(
  File "/snap/git-ubuntu/596/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'commit', '-m', 'merge-changelogs', 'debian/changelog']' returned non-zero exit status 1.

I only ran into this issue during 'merge finish'; earlier steps in the merge procedure would emit warnings about directories (i.e. via the post-checkout hook I gather) but no hard errors or stack traces. I gather this is because this was the first point there was a "real" commit being added.

Workaround was to rm .git/hooks/pre-commit.

Revision history for this message
Robie Basak (racb) wrote :

Ah, thanks. I think I understand now.

I suppose a fix for now would be to either adjust what we're doing in the pre-commit hook or arrange for "merge finish" to ignore it (using --no-verify or similar).

It's probably still appropriate to display a warning at least, and maybe even require the use of --force or similar, to acknowledge that running the workaround script afterwards will be necessary. This might mean adding functionality to "merge finish" to be able to back itself out with no changes if the commit fails. Alternatively, the hook could be adjusted to interact with "merge finish" somehow.

I think the constraint here should be that the user should be sufficiently notified that the workaround will be required. I'd appreciate feedback on exactly how "merge finish" users think that should be achieved.

Changed in usd-importer:
importance: Undecided → Medium
status: New → Triaged
tags: added: merge onboarding-ux
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.