git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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 formatting
 State 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.
Next: Yann Dirson
Message 1 of 4 in “[BUG] Problem with "stgit push" causing data loss”
  1. Yann DirsonJan 20, 2007
  2. Yann DirsonJan 20, 2007
  3. Catalin MarinasJan 21, 2007
  4. Yann DirsonJan 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.