royger · GitHub

Hello,

When rebasing a branch with local commits that lead to conflicts stgit will throw the following backtrace and crash:

% stg rebase upstream/staging
Checking for changes in the working directory ... done
Popping all applied patches ... done
Rebasing to "upstream/staging" ... done
Pushing patch "func_fn" ... done (empty patch)
Pushing patch "devfn_sbdf" ... done (empty patch)
Pushing patch "pdev_union" ... done (empty patch)
Pushing patch "pci_sbdf" ...
  CONFLICT (content): Merge conflict in xen/include/xen/pci.h
Error: The merge failed during "push".
       Revert the operation with "stg undo".
xen/include/xen/pci.h: unmerged (b03927cd28d85c2fe9325e9f8912c66990e3473d)
xen/include/xen/pci.h: unmerged (04a9f46cc32ffc56452efa022b03ea19d6e0f06a)
xen/include/xen/pci.h: unmerged (12f1cea19bc50738b64fac172cbbe6f41894b25a)
fatal: git-write-tree: error building trees
Traceback (most recent call last):
  File "/usr/local/bin/stg", line 47, in <module>
    main()
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/main.py", line 213, in main
    _main()
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/main.py", line 192, in _main
    directory.write_log(cmd)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/commands/common.py", line 599, in write_log
    log.compat_log_entry(msg)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/log.py", line 383, in compat_log_entry
    log_entry(Fakestack(stack), msg)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/log.py", line 336, in log_entry
    new_log = LogEntry.from_stack(last_log, stack, msg)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/log.py", line 191, in from_stack
    for pn in stack.patchorder.all),
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/log.py", line 191, in <genexpr>
    for pn in stack.patchorder.all),
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/log.py", line 366, in get
    return stack.patches.get(pn)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/stack.py", line 189, in get
    return self.__patches[name]
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/git.py", line 569, in __getitem__
    self.__objects[name] = self.__create(name)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/stack.py", line 179, in create_patch
    p.commit # raise exception if the patch doesn't exist
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/stack.py", line 34, in commit
    return self.__stack.repository.refs.get(self.__ref)
  File "/usr/local/Cellar/stgit/0.19/lib/python2.7/site-packages/stgit/lib/git.py", line 532, in get
    return self.__repository.get_commit(self.__refs[ref])
KeyError: u'refs/patches/pci_sbdf_t/add_fn_field'

Read the original on github.com ↗