threads / discuss / 14326

stgit error on status command

Subject: stgit error on status command

## tl;dr

6 messages between Jul 7, 2008 and Jul 8, 2008.

replies: 5people: 2as markdown or json

Jon Smirl· Jul 7, 2008, 15:10 UTC · lore

jonsmirl@terra:~$ stg --version Stacked GIT 0.14.3.163.g06f9 git version 1.5.6.1 Python version 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] jonsmirl@terra:~$

jonsmirl@terra:~/fs$ stg status
Error: Unhandled exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/stgit/main.py", line 278, in main
    ret = command.func(parser, options, args)
  File "/usr/local/lib/python2.5/site-packages/stgit/commands/status.py",
line 119, in func
    options.diff_flags)
  File "/usr/local/lib/python2.5/site-packages/stgit/commands/status.py",
line 75, in status
    diff_flags = diff_flags)
  File "/usr/local/lib/python2.5/site-packages/stgit/git.py", line
255, in tree_status
    for t, fn in parse_git_ls(GRun('diff-index', '-z', *args).raw_output()):
  File "/usr/local/lib/python2.5/site-packages/stgit/git.py", line
201, in parse_git_ls
    mode_a, mode_b, sha1_a, sha1_b, t = line.split(' ')
ValueError: need more than 1 value to unpack
jonsmirl@terra:~/fs$

jonsmirl@terra:~/fs$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # renamed: arch/powerpc/boot/dts/digispeaker-alpha.dts -> arch/powerpc/boot/dts/dspeak01.dts # renamed: arch/powerpc/platforms/52xx/digispeaker_alpha.c -> arch/powerpc/platforms/52xx/dspeak0 # # Changed but not updated: # (use "git add <file>..." to update what will be committed) # # modified: arch/powerpc/platforms/52xx/dspeak01.c

-- 
Jon Smirl
jonsmirl@gmail.com
Karl Hasselström· Jul 8, 2008, 07:02 UTC · re: Jon Smirl · lore

Re: stgit error on status command

Thanks for the report.

The problem is that we mis-parse the output of git diff-index when rename detection is on (and it prints more than one filename on one line). This happens if you give stg status the --diff-opts=-M flag, but you didn't -- but it could also happen if you have the stgit.diff-opts config variable set.

I'll try to get a patch out tonight. In the mean time, if you like you should be able to work around the problem by unsetting stgit.diff-opts.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Jon Smirl· Jul 8, 2008, 12:06 UTC · re: Karl Hasselström · lore

Re: stgit error on status command

On 7/8/08, Karl Hasselström <kha@treskal.com> wrote:
Show 7 quoted lines
> Thanks for the report.
>
>  The problem is that we mis-parse the output of git diff-index when
>  rename detection is on (and it prints more than one filename on one
>  line). This happens if you give stg status the --diff-opts=-M flag,
>  but you didn't -- but it could also happen if you have the
>  stgit.diff-opts config variable set.

I have -M in my config file. If I don't use people on lkml complain about renames generating piles of output in the patches. I'm able to work around the problem for the moment.

Show 10 quoted lines
>
>  I'll try to get a patch out tonight. In the mean time, if you like you
>  should be able to work around the problem by unsetting
>  stgit.diff-opts.
>
>
>  --
>  Karl Hasselström, kha@treskal.com
>       www.treskal.com/kalle
>
-- 
Jon Smirl
jonsmirl@gmail.com
Karl Hasselström· Jul 8, 2008, 12:25 UTC · re: Jon Smirl · lore

Re: stgit error on status command

On 2008-07-08 08:06:04 -0400, Jon Smirl wrote:
Show 13 quoted lines
> On 7/8/08, Karl Hasselström <kha@treskal.com> wrote:
>
> > Thanks for the report.
> >
> > The problem is that we mis-parse the output of git diff-index when
> > rename detection is on (and it prints more than one filename on
> > one line). This happens if you give stg status the --diff-opts=-M
> > flag, but you didn't -- but it could also happen if you have the
> > stgit.diff-opts config variable set.
>
> I have -M in my config file. If I don't use people on lkml complain
> about renames generating piles of output in the patches. I'm able to
> work around the problem for the moment.

Oh, I'm certainly not suggesting that you shouldn't have -M in your stgit.diff-opts -- just that dropping it for the moment is a workaround to your problem.

Hmm. Another workaround is to pass an explicit --diff-opts="" to stg status; that'll override your stgit.diff-opts, and avoid triggering the bug.

But with any luck, I'll have this fixed within 4-6 hours or so.
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Karl Hasselström· Jul 8, 2008, 19:57 UTC · re: Karl Hasselström · lore

[StGit PATCH] stg status rename fix (safe+experimental)

This is just a patch to make sure the bug is gone; the bugfix consists of a merge of the updated stable branch.

Both safe and experimental at git://repo.or.cz/stgit/kha.git has said merge, and this test.

---
Karl Hasselström (1):
      Test "stg status" with -M in stgit.diff-opts
 t/t0002-status.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Karl Hasselström· Jul 8, 2008, 19:57 UTC · re: Karl Hasselström · lore

[StGit PATCH] Test "stg status" with -M in stgit.diff-opts

It used to fail, before the recent merge of the -O/--diff-opts removal, since the default value of that option was taken from stgit.diff-opts and passed on to stgit.git.tree_status() which couldn't handle it.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 t/t0002-status.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index 5e1e8ca..86ff419 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -186,4 +186,10 @@ test_expect_success 'Status after renaming a file' '
     test_cmp expected.txt output.txt
 '
 
+test_expect_success 'Status after renaming a file (with rename detection)' '
+    git config stgit.diff-opts -M &&
+    stg status > output.txt &&
+    test_cmp expected.txt output.txt
+'
+
 test_done

← back to recent threads