Skip to contentSkip to conversation

StGIT fails to clean patch series, and to go to a patch

DISCUSSION Jakub Narebski 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I have patch series with empty patch in the middle of the stack. After trying to stg-clean (and failing) stack looks like below:

1167:[gitweb/web!git]$ stg series -e -s
+ gitweb-Always-set-from_file-to_file
+ gitweb-Add-status_str-diffinfo
+ gitweb-Easier-adding-parameters-to-current-URL
+ gitweb-Use-replay-to-generate-pagination

Quoted 1 line

gitweb-Use-replay-to-generate-alt-views

0 gitweb-Update-INSTALL-file
- gitweb-No-CGI_Carp-in-test
- gitweb-Test-config-override
- gitweb-Config-reader
- gitweb-Use-config-more

Now stg-rebase works, but stg-goto doesn't work. It returns the following error.

1164:[gitweb/web!git]$ stg goto gitweb-Use-config-more Checking for changes in the working directory ... done Traceback (most recent call last):
File "/usr/bin/stg", line 43, in ?

    main()
  File "/usr/lib/python2.4/site-packages/stgit/main.py", line 284, in main
    command.func(parser, options, args)
  File "/usr/lib/python2.4/site-packages/stgit/commands/goto.py", line 63, in func
    push_patches(patches)
  File "/usr/lib/python2.4/site-packages/stgit/commands/common.py", line 165, in push_patches
    forwarded = crt_series.forward_patches(patches)
  File "/usr/lib/python2.4/site-packages/stgit/stack.py", line 954, in forward_patches
    bottom_tree = git.get_commit(bottom).get_tree()
  File "/usr/lib/python2.4/site-packages/stgit/git.py", line 136, in get_commit
    commit = Commit(id_hash)
  File "/usr/lib/python2.4/site-packages/stgit/git.py", line 77, in __init__
    lines = _output_lines(['git-cat-file', 'commit', id_hash])
  File "/usr/lib/python2.4/site-packages/stgit/git.py", line 196, in _output_lines
    raise GitException, '%s failed (%s)' % (' '.join(cmd),

TypeError: sequence item 2: expected string, NoneType found 1165:[gitweb/web!git]$ stg version
Stacked GIT 0.13
git version 1.5.3.5
Python version 2.4.3 (#1, Jun 13 2006, 16:41:18) [GCC 4.0.2 20051125 (Red Hat 4.0.2-8)]

Signature · 2 lines
Jakub Narebski
Poland
#1 lore raw
Quoted 2 lines · Jakub Narebski

I have patch series with empty patch in the middle of the stack. After trying to stg-clean (and failing) stack looks like below:

Does 'stg delete gitweb-Update-INSTALL-file' work?

Quoted 3 lines

1164:[gitweb/web!git]$ stg goto gitweb-Use-config-more Checking for changes in the working directory ... done Traceback (most recent call last):

Does a simple 'stg push' work? I suspect there is something wrong with the gitweb-Update-INSTALL-file patch but not sure why or how it could get to this inconsistent state?

It's worth checking the values of 'stg id gitweb-Update-INSTALL-file//top' and //bottom and whether they are commit ids or something else.

Signature · 1 line
Catalin
#2 lore raw
Quoted 11 lines · Catalin Marinas
Quoted 2 lines · Jakub Narebski

I have patch series with empty patch in the middle of the stack. After trying to stg-clean (and failing) stack looks like below:

Does 'stg delete gitweb-Update-INSTALL-file' work?

Quoted 3 lines

1164:[gitweb/web!git]$ stg goto gitweb-Use-config-more Checking for changes in the working directory ... done Traceback (most recent call last):

Quoted 7 lines

Does a simple 'stg push' work? I suspect there is something wrong with the gitweb-Update-INSTALL-file patch but not sure why or how it could get to this inconsistent state?

It's worth checking the values of 'stg id gitweb-Update-INSTALL-file//top' and //bottom and whether they are commit ids or something else.

1168:[gitweb/web!git]$ stg id gitweb-Update-INSTALL-file None
1169:[gitweb/web!git]$ stg id gitweb-Update-INSTALL-file//top None
1170:[gitweb/web!git]$ stg id gitweb-Update-INSTALL-file//bottom None
1171:[gitweb/web!git]$ stg delete gitweb-Update-INSTALL-file Traceback (most recent call last):
File "/usr/bin/stg", line 43, in ?

    main()

File "/usr/lib/python2.4/site-packages/stgit/main.py", line 284, in main
command.func(parser, options, args)
File "/usr/lib/python2.4/site-packages/stgit/commands/delete.py", line 76, in func
crt_series.delete_patch(patch)
File "/usr/lib/python2.4/site-packages/stgit/stack.py", line 919, in delete_patch
patch.delete()
File "/usr/lib/python2.4/site-packages/stgit/stack.py", line 160, in delete
for f in os.listdir(self._dir()):
OSError: [Errno 2] No such file or directory: '.git/patches/gitweb/web/patches/gitweb-Update-INSTALL-file'

I wonder how that happened... I'm just interested in recovering the unapplied commits. There is always reflog, but StGIT does not create reflog message as it should.

Hmmm... removing gitweb-Update-INSTALL-file line from 'unapplied' file worked; nice.

Signature · 2 lines
Jakub Narebski
Poland