{"thread":{"id":"15661","subject":"stg 0.14.3 breakage on push after moving hunk","startedAt":"2008-09-24T23:26:54Z","lastAt":"2008-09-25T18:54:14Z","messageCount":5,"participants":["Yann Dirson","Karl Hasselström"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"91541","messageId":"20080924232654.GY4985@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"15661","inReplyTo":null,"subject":"stg 0.14.3 breakage on push after moving hunk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2008-09-24T23:26:54Z","receivedAt":"2008-09-24T23:26:54Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"Just saw the following problem - ever saw that ?\n\nGetting into context: split changes affecting a particular file into\nanother patch\n\n$ stg --version\nStacked GIT 0.14.3\ngit version 1.6.0.1\nPython version 2.5.2 (r252:60911, Aug  8 2008, 09:22:44)\n[GCC 4.3.1]\n\n$ stg pop\nChecking for changes in the working directory ... done\nPopping patch \"factorize\" ... done\nNow at patch \"x-dummy\"\n$ stg new -m test\n$ stg-fold-files-from factorize 't/*'\nChecking for changes in the working directory ... done\nFolding patch from stdin ... done\n$ stg ref\nChecking for changes in the working directory ... done\nRefreshing patch \"test\" ... done\n\n... then attempting to push to get rid of the now-duplicated changes\nfrom orig patch (which has been how I have used stg-fold-files-from\never since I wrote it, so I'm pretty sure it used to work, but then,\nit's been a couple of months since I did not use it ;):\n\n$ stg push\nChecking for changes in the working directory ... done\nPushing patch \"factorize\" ... Traceback (most recent call last):\n  File \"/usr/bin/stg\", line 43, in <module>\n    main()\n  File \"/var/lib/python-support/python2.5/stgit/main.py\", line 281, in main\n    command.func(parser, options, args)   \n  File \"/var/lib/python-support/python2.5/stgit/commands/push.py\", line 102, in func\n    push_patches(crt_series, patches, options.merged)\n  File \"/var/lib/python-support/python2.5/stgit/commands/common.py\", line 202, in push_patches\n    modified = crt_series.push_patch(p)\n  File \"/var/lib/python-support/python2.5/stgit/stack.py\", line 1112, in push_patch\n    git.merge(bottom, head, top, recursive = True)\n  File \"/var/lib/python-support/python2.5/stgit/git.py\", line 790, in merge\n    stages['2'][0], stages['3'][0]) != 0:\n  File \"/var/lib/python-support/python2.5/stgit/gitmergeonefile.py\", line 268, in merge\n    % path)\nTypeError: not all arguments converted during string formatting\n\nBest regards,\n-- \nYann\n"},{"id":"91557","messageId":"20080925072322.GA27632@diana.vm.bytemark.co.uk","threadId":"15661","inReplyTo":"20080924232654.GY4985@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: stg 0.14.3 breakage on push after moving hunk","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-09-25T07:23:22Z","receivedAt":"2008-09-25T07:23:22Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-09-25 01:26:54 +0200, Yann Dirson wrote:\n\n> Just saw the following problem - ever saw that ?\n>\n> $ stg push\n> Checking for changes in the working directory ... done\n> Pushing patch \"factorize\" ... Traceback (most recent call last):\n>   File \"/usr/bin/stg\", line 43, in <module>\n>     main()\n>   File \"/var/lib/python-support/python2.5/stgit/main.py\", line 281, in main\n>     command.func(parser, options, args)   \n>   File \"/var/lib/python-support/python2.5/stgit/commands/push.py\", line 102, in func\n>     push_patches(crt_series, patches, options.merged)\n>   File \"/var/lib/python-support/python2.5/stgit/commands/common.py\", line 202, in push_patches\n>     modified = crt_series.push_patch(p)\n>   File \"/var/lib/python-support/python2.5/stgit/stack.py\", line 1112, in push_patch\n>     git.merge(bottom, head, top, recursive = True)\n>   File \"/var/lib/python-support/python2.5/stgit/git.py\", line 790, in merge\n>     stages['2'][0], stages['3'][0]) != 0:\n>   File \"/var/lib/python-support/python2.5/stgit/gitmergeonefile.py\", line 268, in merge\n>     % path)\n> TypeError: not all arguments converted during string formatting\n\nNo, but try this ...\n\ndiff --git a/stgit/gitmergeonefile.py b/stgit/gitmergeonefile.py\nindex c1af2f8..55b62db 100644\n--- a/stgit/gitmergeonefile.py\n+++ b/stgit/gitmergeonefile.py\n@@ -264,7 +264,7 @@ def merge(orig_hash, file1_hash, file2_hash,\n                     __conflict(path)\n                     return 1\n                 if file1_mode != file2_mode:\n-                    out.error('File \"s\" added in both, permissions conflict'\n+                    out.error('File \"%s\" added in both, permissions conflict'\n                               % path)\n                     __conflict(path)\n                     return 1\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"91562","messageId":"20080925075732.GA17458@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"15661","inReplyTo":"20080925072322.GA27632@diana.vm.bytemark.co.uk","subject":"Re: stg 0.14.3 breakage on push after moving hunk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2008-09-25T07:57:32Z","receivedAt":"2008-09-25T07:57:32Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Thu, Sep 25, 2008 at 09:23:22AM +0200, Karl Hasselström wrote:\n> > TypeError: not all arguments converted during string formatting\n> \n> No, but try this ...\n\nThanks, it does fix the exception - I feel a bit ashamed of not having\nlooked at the code myself ;)\n\nNevertheless, that error was only hiding another more annoying problem:\n\n$ ../stgit/stg push\nChecking for changes in the working directory ... done\nPushing patch \"factorize\" ...\n  Error: File \"t/t4030-diff-rename-factorize.sh\" added in both, permissions conflict\n  Error: The merge failed during \"push\".  \n         Use \"refresh\" after fixing the conflicts or revert the operation with \"push --undo\".\n  stg push: GIT index merging failed (possible conflicts)\n$ md5sum t/t4030-diff-rename-factorize.sh*\ncc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh\ncc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current\ncc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched\n\nAFAICT, adding the same file in 2 branches used not to produce a\nconflict at all.  Is that intended ?\n\nBest regards,\n-- \nYann\n"},{"id":"91563","messageId":"20080925083747.GC27632@diana.vm.bytemark.co.uk","threadId":"15661","inReplyTo":"20080925075732.GA17458@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: stg 0.14.3 breakage on push after moving hunk","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-09-25T08:37:47Z","receivedAt":"2008-09-25T08:37:47Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-09-25 09:57:32 +0200, Yann Dirson wrote:\n\n> Thanks, it does fix the exception - I feel a bit ashamed of not\n> having looked at the code myself ;)\n\n:-)\n\n> Nevertheless, that error was only hiding another more annoying\n> problem:\n>\n> $ ../stgit/stg push\n> Checking for changes in the working directory ... done\n> Pushing patch \"factorize\" ...\n>   Error: File \"t/t4030-diff-rename-factorize.sh\" added in both, permissions conflict\n>   Error: The merge failed during \"push\".  \n>          Use \"refresh\" after fixing the conflicts or revert the operation with \"push --undo\".\n>   stg push: GIT index merging failed (possible conflicts)\n> $ md5sum t/t4030-diff-rename-factorize.sh*\n> cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh\n> cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current\n> cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched\n>\n> AFAICT, adding the same file in 2 branches used not to produce a\n> conflict at all. Is that intended ?\n\n\"permissions conflict\" sounds like it was added with the exec bit in\none branch, and without in the other. Is that right? And\n\n  1. Does it work if there's no permissions conflict?\n\n  2. Did it work before if there was a permissions conflict?\n\nJust a guess, but it's entirely plausible that this case never worked,\nand you're the first to hit it.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"91620","messageId":"20080925185414.GB17458@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"15661","inReplyTo":"20080925083747.GC27632@diana.vm.bytemark.co.uk","subject":"Re: stg 0.14.3 breakage on push after moving hunk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2008-09-25T18:54:14Z","receivedAt":"2008-09-25T18:54:14Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Thu, Sep 25, 2008 at 10:37:47AM +0200, Karl Hasselström wrote:\n> On 2008-09-25 09:57:32 +0200, Yann Dirson wrote:\n> \n> > Thanks, it does fix the exception - I feel a bit ashamed of not\n> > having looked at the code myself ;)\n> \n> :-)\n> \n> > Nevertheless, that error was only hiding another more annoying\n> > problem:\n> >\n> > $ ../stgit/stg push\n> > Checking for changes in the working directory ... done\n> > Pushing patch \"factorize\" ...\n> >   Error: File \"t/t4030-diff-rename-factorize.sh\" added in both, permissions conflict\n> >   Error: The merge failed during \"push\".  \n> >          Use \"refresh\" after fixing the conflicts or revert the operation with \"push --undo\".\n> >   stg push: GIT index merging failed (possible conflicts)\n> > $ md5sum t/t4030-diff-rename-factorize.sh*\n> > cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh\n> > cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.current\n> > cc313acd2824036556128b3e0879dd07  t/t4030-diff-rename-factorize.sh.patched\n> >\n> > AFAICT, adding the same file in 2 branches used not to produce a\n> > conflict at all. Is that intended ?\n> \n> \"permissions conflict\" sounds like it was added with the exec bit in\n> one branch, and without in the other. Is that right? And\n>   1. Does it work if there's no permissions conflict?\n\nDoh.  Sure, it does work, and as expected.  Some days really deserve to\nbe spent sleeping :}\n\n>   2. Did it work before if there was a permissions conflict?\n> \n> Just a guess, but it's entirely plausible that this case never worked,\n> and you're the first to hit it.\n\nI is also entirely plausible that I lacked sleep enough not to read\ncorrectly what was printed, and that the behaviour was indeed correct :>\n\nThe problem is mostly a limitation of the way stg-fold-files-from works,\nrelying on patchutils which do not know about git extensions to the diff\nformat.  And since I mostly used it in the past on a git-cvsimport'ed\ntree, permissions never bothered me.\n\nBest regards,\n-- \nYann\n"}]}