stg 0.14.3 breakage on push after moving hunk

5 messages, 2 authors, 2016-06-15 · open the first message on its own page

stg 0.14.3 breakage on push after moving hunk

From: Yann Dirson <hidden>
Date: 2016-06-15 22:45:24

Just saw the following problem - ever saw that ?

Getting into context: split changes affecting a particular file into
another patch

$ stg --version
Stacked GIT 0.14.3
git version 1.6.0.1
Python version 2.5.2 (r252:60911, Aug  8 2008, 09:22:44)
[GCC 4.3.1]

$ stg pop
Checking for changes in the working directory ... done
Popping patch "factorize" ... done
Now at patch "x-dummy"
$ stg new -m test
$ stg-fold-files-from factorize 't/*'
Checking for changes in the working directory ... done
Folding patch from stdin ... done
$ stg ref
Checking for changes in the working directory ... done
Refreshing patch "test" ... done

... then attempting to push to get rid of the now-duplicated changes
from orig patch (which has been how I have used stg-fold-files-from
ever since I wrote it, so I'm pretty sure it used to work, but then,
it's been a couple of months since I did not use it ;):

$ stg push
Checking for changes in the working directory ... done
Pushing patch "factorize" ... Traceback (most recent call last):
  File "/usr/bin/stg", line 43, in <module>
    main()
  File "/var/lib/python-support/python2.5/stgit/main.py", line 281, in main
    command.func(parser, options, args)   
  File "/var/lib/python-support/python2.5/stgit/commands/push.py", line 102, in func
    push_patches(crt_series, patches, options.merged)
  File "/var/lib/python-support/python2.5/stgit/commands/common.py", line 202, in push_patches
    modified = crt_series.push_patch(p)
  File "/var/lib/python-support/python2.5/stgit/stack.py", line 1112, in push_patch
    git.merge(bottom, head, top, recursive = True)
  File "/var/lib/python-support/python2.5/stgit/git.py", line 790, in merge
    stages['2'][0], stages['3'][0]) != 0:
  File "/var/lib/python-support/python2.5/stgit/gitmergeonefile.py", line 268, in merge
    % path)
TypeError: not all arguments converted during string formatting

Best regards,
-- 
Yann

Re: stg 0.14.3 breakage on push after moving hunk

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:45:24

On 2008-09-25 01:26:54 +0200, Yann Dirson wrote:
Just saw the following problem - ever saw that ?

$ stg push
Checking for changes in the working directory ... done
Pushing patch "factorize" ... Traceback (most recent call last):
  File "/usr/bin/stg", line 43, in <module>
    main()
  File "/var/lib/python-support/python2.5/stgit/main.py", line 281, in main
    command.func(parser, options, args)   
  File "/var/lib/python-support/python2.5/stgit/commands/push.py", line 102, in func
    push_patches(crt_series, patches, options.merged)
  File "/var/lib/python-support/python2.5/stgit/commands/common.py", line 202, in push_patches
    modified = crt_series.push_patch(p)
  File "/var/lib/python-support/python2.5/stgit/stack.py", line 1112, in push_patch
    git.merge(bottom, head, top, recursive = True)
  File "/var/lib/python-support/python2.5/stgit/git.py", line 790, in merge
    stages['2'][0], stages['3'][0]) != 0:
  File "/var/lib/python-support/python2.5/stgit/gitmergeonefile.py", line 268, in merge
    % path)
TypeError: not all arguments converted during string formatting
No, but try this ...
diff --git a/stgit/gitmergeonefile.py b/stgit/gitmergeonefile.py
index c1af2f8..55b62db 100644
--- a/stgit/gitmergeonefile.py
+++ b/stgit/gitmergeonefile.py
@@ -264,7 +264,7 @@ def merge(orig_hash, file1_hash, file2_hash,
                     __conflict(path)
                     return 1
                 if file1_mode != file2_mode:
-                    out.error('File "s" added in both, permissions conflict'
+                    out.error('File "%s" added in both, permissions conflict'
                               % path)
                     __conflict(path)
                     return 1
-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

Re: stg 0.14.3 breakage on push after moving hunk

From: Yann Dirson <hidden>
Date: 2016-06-15 22:45:24

On Thu, Sep 25, 2008 at 09:23:22AM +0200, Karl Hasselström wrote:
quoted
TypeError: not all arguments converted during string formatting
No, but try this ...
Thanks, it does fix the exception - I feel a bit ashamed of not having
looked at the code myself ;)

Nevertheless, that error was only hiding another more annoying problem:

$ ../stgit/stg push
Checking for changes in the working directory ... done
Pushing patch "factorize" ...
  Error: File "t/t4030-diff-rename-factorize.sh" added in both, permissions conflict
  Error: The merge failed during "push".  
         Use "refresh" after fixing the conflicts or revert the operation with "push --undo".
  stg push: GIT index merging failed (possible conflicts)
$ md5sum t/t4030-diff-rename-factorize.sh*
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched

AFAICT, adding the same file in 2 branches used not to produce a
conflict at all.  Is that intended ?

Best regards,
-- 
Yann

Re: stg 0.14.3 breakage on push after moving hunk

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:45:24

On 2008-09-25 09:57:32 +0200, Yann Dirson wrote:
Thanks, it does fix the exception - I feel a bit ashamed of not
having looked at the code myself ;)
:-)
Nevertheless, that error was only hiding another more annoying
problem:

$ ../stgit/stg push
Checking for changes in the working directory ... done
Pushing patch "factorize" ...
  Error: File "t/t4030-diff-rename-factorize.sh" added in both, permissions conflict
  Error: The merge failed during "push".  
         Use "refresh" after fixing the conflicts or revert the operation with "push --undo".
  stg push: GIT index merging failed (possible conflicts)
$ md5sum t/t4030-diff-rename-factorize.sh*
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched

AFAICT, adding the same file in 2 branches used not to produce a
conflict at all. Is that intended ?
"permissions conflict" sounds like it was added with the exec bit in
one branch, and without in the other. Is that right? And

  1. Does it work if there's no permissions conflict?

  2. Did it work before if there was a permissions conflict?

Just a guess, but it's entirely plausible that this case never worked,
and you're the first to hit it.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

Re: stg 0.14.3 breakage on push after moving hunk

From: Yann Dirson <hidden>
Date: 2016-06-15 22:45:24

On Thu, Sep 25, 2008 at 10:37:47AM +0200, Karl Hasselström wrote:
On 2008-09-25 09:57:32 +0200, Yann Dirson wrote:
quoted
Thanks, it does fix the exception - I feel a bit ashamed of not
having looked at the code myself ;)
:-)
quoted
Nevertheless, that error was only hiding another more annoying
problem:

$ ../stgit/stg push
Checking for changes in the working directory ... done
Pushing patch "factorize" ...
  Error: File "t/t4030-diff-rename-factorize.sh" added in both, permissions conflict
  Error: The merge failed during "push".  
         Use "refresh" after fixing the conflicts or revert the operation with "push --undo".
  stg push: GIT index merging failed (possible conflicts)
$ md5sum t/t4030-diff-rename-factorize.sh*
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current
cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched

AFAICT, adding the same file in 2 branches used not to produce a
conflict at all. Is that intended ?
"permissions conflict" sounds like it was added with the exec bit in
one branch, and without in the other. Is that right? And
  1. Does it work if there's no permissions conflict?
Doh.  Sure, it does work, and as expected.  Some days really deserve to
be spent sleeping :}
  2. Did it work before if there was a permissions conflict?

Just a guess, but it's entirely plausible that this case never worked,
and you're the first to hit it.
I is also entirely plausible that I lacked sleep enough not to read
correctly what was printed, and that the behaviour was indeed correct :>

The problem is mostly a limitation of the way stg-fold-files-from works,
relying on patchutils which do not know about git extensions to the diff
format.  And since I mostly used it in the past on a git-cvsimport'ed
tree, permissions never bothered me.

Best regards,
-- 
Yann
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help