[BUG] Problem with "stgit push" causing data loss
- From
Yann Dirson <ydirson@altern.org>
- Date
- Jan 20, 2007, 15:01 UTC
- Message-ID
- <20070120150113.GB4665@nan92-1-81-57-214-146.fbx.proxad.net>
Well, "data loss" is a bit strong, since the data is still available to find using git-lost-found.
I first tried to reproduce with a simple test-case, but could not, so here is my way to reproduce it, on a clone of the stgit official workspace.
stgit$ stg branch --create test origin Branch "test" created.
The test patch is my previous work on "pull --to", now superceded by "rebase". Patch to reproduce attached to this mail - I just use "pick" since it's easier for me:
stgit$ ./stg pick -n pull-to 9abaec589753ab190d378b534ceaa6a5af5d0dd3 Checking for changes in the working directory... done Importing commit 9abaec589753ab190d378b534ceaa6a5af5d0dd3... done Now at patch "pull-to" stgit$ stg files pull-to M stgit/commands/pull.py A t/t2100-pull-to.sh
Now move the testcase in a new patch below, using my stg-fold-files-from already sent to the list:
stgit$ stg pop Popping patch "pull-to"... done No patches applied stgit$ stg new test -m test stgit$ stg-fold-files-from pull-to 't/*' Folding patch from stdin... done stgit$ stg refresh Refreshing patch "test"... done stgit$ stg files A t/t2100-pull-to.sh
And then push the old file over that:
$ stg push
Pushing patch "pull-to"...
Traceback (most recent call last):
File "/usr/bin/stg", line 43, in ?
main()
File "/var/lib/python-support/python2.4/stgit/main.py", line 261, in main
command.func(parser, options, args)
File "/var/lib/python-support/python2.4/stgit/commands/push.py", line 101, in func
push_patches(patches, options.merged)
File "/var/lib/python-support/python2.4/stgit/commands/common.py", line 190, in push_patches
modified = crt_series.push_patch(p)
File "/var/lib/python-support/python2.4/stgit/stack.py", line 916, in push_patch
git.merge(bottom, head, top)
File "/var/lib/python-support/python2.4/stgit/git.py", line 535, in merge
stages['2'][0], stages['3'][0]) != 0:
File "/var/lib/python-support/python2.4/stgit/gitmergeonefile.py", line 203, in merge
print >> sys.stderr, \
TypeError: not all arguments converted during string formattingState of things now:
stgit$ stg status ? t/t2100-pull-to.sh.current ? t/t2100-pull-to.sh.patched M stgit/commands/pull.py stgit$ diff t/t2100-pull-to.sh.*; echo $? 0 stgit$ stg files pull-to stgit$ stg top test
As you can see, the pull-to patch is now in a situation that's not obvious to untangle by hand. Also "stg push -m" exhibits the same issue.
Best regards,
-- Yann.