{"thread":{"id":"16168","subject":"Stgit and refresh-temp","startedAt":"2008-11-04T13:37:24Z","lastAt":"2008-11-24T14:11:51Z","messageCount":14,"participants":["Jon Smirl","Karl Hasselström","Catalin Marinas"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"94891","messageId":"9e4733910811040537p4e88c09an94370154eca12778@mail.gmail.com","threadId":"16168","inReplyTo":null,"subject":"Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-04T13:37:24Z","receivedAt":"2008-11-04T13:37:24Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"I hit a case when refreshing a buried patch that needed a merge\nconflict sorted out.\nI'm unable to recover out of the state.\n\njonsmirl@terra:~/fs$ stg status\nA drivers/input/ir/ir-configfs.c\nA drivers/input/ir/ir-core.c\nA drivers/input/ir/ir.h\nC drivers/input/ir/Makefile\nD drivers/input/ir-configfs.c\nD drivers/input/ir-core.c\nD drivers/input/ir.h\nM drivers/input/Makefile\nM drivers/input/input.c\njonsmirl@terra:~/fs$ gedit drivers/input/Makefile drivers/input/input.c\njonsmirl@terra:~/fs$ gedit drivers/input/ir/Makefile\njonsmirl@terra:~/fs$ stg resolve drivers/input/ir/Makefile\njonsmirl@terra:~/fs$ stg help\nusage: stg <command> [options]\n\nGeneric commands:\n  help        print the detailed command usage\n  version     display version information\n  copyright   display copyright information\n\nRepository commands:\n  clone     Make a local clone of a remote repository\n  id        Print the git hash value of a StGit reference\n\nStack (branch) commands:\n  branch    Branch operations: switch, list, create, rename, delete, ...\n  clean     Delete the empty patches in the series\n  coalesce  Coalesce two or more patches into one\n  commit    Permanently store the applied patches into the stack base\n  float     Push patches to the top, even if applied\n  goto      Push or pop patches to the given one\n  hide      Hide a patch in the series\n  init      Initialise the current branch for use with StGIT\n  log       Display the patch changelog\n  patches   Show the applied patches modifying a file\n  pop       Pop one or more patches from the stack\n  pull      Pull changes from a remote repository\n  push      Push one or more patches onto the stack\n  rebase    Move the stack base to another point in history\n  redo      Undo the last undo operation\n  repair    Fix StGit metadata if branch was modified with git commands\n  reset     Reset the patch stack to an earlier state\n  series    Print the patch series\n  sink      Send patches deeper down the stack\n  top       Print the name of the top patch\n  uncommit  Turn regular git commits into StGit patches\n  undo      Undo the last operation\n  unhide    Unhide a hidden patch\n\nPatch commands:\n  delete    Delete patches\n  edit      edit a patch description or diff\n  export    Export patches to a directory\n  files     Show the files modified by a patch (or the current patch)\n  fold      Integrate a GNU diff patch into the current patch\n  import    Import a GNU diff file as a new patch\n  mail      Send a patch or series of patches by e-mail\n  new       Create a new, empty patch\n  pick      Import a patch from a different branch or a commit object\n  refresh   Generate a new commit for the current patch\n  rename    Rename a patch\n  show      Show the commit corresponding to a patch\n  sync      Synchronise patches with a branch or a series\n\nIndex/worktree commands:\n  diff      Show the tree diff\n  resolved  Mark a file conflict as solved\n  status    Show the tree status\njonsmirl@terra:~/fs$ stg help coalesce\njonsmirl@terra:~/fs$ stg series\n+ Makefile\n+ anton_1\n+ anton_3\n+ add-of_find_i2c_device_by_node\n+ jds_platform\n+ max9485\n+ jds-soc-machine\n+ jds-psc-c\n+ soc-u32-cleanup\n+ jds-audio\n+ g_spi_4\n+ m_1\n+ spi-mmc\n+ mpc5200-rtc\n+ lirc\n+ jds-lirc\n> refresh-temp\n- jds-lirc-gpt\n- jds-lirc-device-tree\n- jds-lirc-mce2\njonsmirl@terra:~/fs$ ls\narch     Documentation  init    MAINTAINERS     net\nsamples     usr             vmlinux.strip.gz\nblock    drivers        ipc     Makefile        patches-master  scripts     virt\nCOPYING  firmware       Kbuild  mm              patches-save\nsecurity    vmlinux\nCREDITS  fs             kernel  modules.order   README          sound\n     vmlinux.bin.gz\ncrypto   include        lib     Module.symvers  REPORTING-BUGS\nSystem.map  vmlinux.o\njonsmirl@terra:~/fs$ mv patches-master patches-foo\njonsmirl@terra:~/fs$ stg export\nChecking for changes in the working directory ... done\nWarning: Local changes in the tree; you might want to commit them first\njonsmirl@terra:~/fs$ stg status\nA drivers/input/ir/ir-configfs.c\nA drivers/input/ir/ir-core.c\nA drivers/input/ir/ir.h\nD drivers/input/ir-configfs.c\nD drivers/input/ir-core.c\nD drivers/input/ir.h\nM drivers/input/Makefile\nM drivers/input/input.c\nM drivers/input/ir/Makefile\njonsmirl@terra:~/fs$ ls patches-master\nadd-of_find_i2c_device_by_node  g_spi_4    jds_platform     lirc\nmax9485       series\nanton_1                         jds-audio  jds-psc-c        m_1\nmpc5200-rtc   soc-u32-cleanup\nanton_3                         jds-lirc   jds-soc-machine  Makefile\nrefresh-temp  spi-mmc\njonsmirl@terra:~/fs$ vi patches-master/refresh-temp\njonsmirl@terra:~/fs$ stg series\n+ Makefile\n+ anton_1\n+ anton_3\n+ add-of_find_i2c_device_by_node\n+ jds_platform\n+ max9485\n+ jds-soc-machine\n+ jds-psc-c\n+ soc-u32-cleanup\n+ jds-audio\n+ g_spi_4\n+ m_1\n+ spi-mmc\n+ mpc5200-rtc\n+ lirc\n+ jds-lirc\n> refresh-temp\n- jds-lirc-gpt\n- jds-lirc-device-tree\n- jds-lirc-mce2\njonsmirl@terra:~/fs$ stg refresh -p jds-lirc\nError: HEAD and top are not the same.\n       This can happen if you modify a branch with git.\n       \"stg repair --help\" explains more about what to do next.\nstg refresh: Command aborted (all changes rolled back)\njonsmirl@terra:~/fs$ stg refresh\nError: HEAD and top are not the same.\n       This can happen if you modify a branch with git.\n       \"stg repair --help\" explains more about what to do next.\nstg refresh: Command aborted (all changes rolled back)\njonsmirl@terra:~/fs$ stg new foo\nInvoking the editor: \"vi .stgit-new.txt\" ... done\nError: HEAD and top are not the same.\n       This can happen if you modify a branch with git.\n       \"stg repair --help\" explains more about what to do next.\nstg new: Command aborted (all changes rolled back)\njonsmirl@terra:~/fs$ stg new foo\nInvoking the editor: \"vi .stgit-new.txt\" ... done\nError: HEAD and top are not the same.\n       This can happen if you modify a branch with git.\n       \"stg repair --help\" explains more about what to do next.\nstg new: Command aborted (all changes rolled back)\njonsmirl@terra:~/fs$ stg repair --help\nUsage: stg repair\n\nFix StGit metadata if branch was modified with git commands\n\nOptions:\n  -h, --help  show this help message and exit\njonsmirl@terra:~/fs$\n\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"94892","messageId":"9e4733910811040538v604d33e3jf0b312d809630af2@mail.gmail.com","threadId":"16168","inReplyTo":"9e4733910811040537p4e88c09an94370154eca12778@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-04T13:38:05Z","receivedAt":"2008-11-04T13:38:05Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"jonsmirl@terra:~/fs$ stg version\nStacked GIT 0.14.3.270.g0f36\ngit version 1.6.0.3.523.g304d0\nPython version 2.5.2 (r252:60911, Oct  5 2008, 19:29:17)\n[GCC 4.3.2]\njonsmirl@terra:~/fs$\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"94894","messageId":"9e4733910811040650k2b63856fpf20f4b654780c658@mail.gmail.com","threadId":"16168","inReplyTo":"9e4733910811040538v604d33e3jf0b312d809630af2@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-04T14:50:33Z","receivedAt":"2008-11-04T14:50:33Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"I think I fixed my tree up. After a stg repair I was able to delete\n'refresh-temp' which was empty, then apply the changes to jds-lirc.\n\nIt may have been possible to make the merge smarter. The conflicts\nwere with things in the popped-off patches. Your typical end of file\nappend merge conflicts.\n\nOn Tue, Nov 4, 2008 at 8:38 AM, Jon Smirl <jonsmirl@gmail.com> wrote:\n> jonsmirl@terra:~/fs$ stg version\n> Stacked GIT 0.14.3.270.g0f36\n> git version 1.6.0.3.523.g304d0\n> Python version 2.5.2 (r252:60911, Oct  5 2008, 19:29:17)\n> [GCC 4.3.2]\n> jonsmirl@terra:~/fs$\n>\n> --\n> Jon Smirl\n> jonsmirl@gmail.com\n>\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"95101","messageId":"20081107054419.GA27146@diana.vm.bytemark.co.uk","threadId":"16168","inReplyTo":"9e4733910811040537p4e88c09an94370154eca12778@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-11-07T05:44:19Z","receivedAt":"2008-11-07T05:44:19Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n\n> I hit a case when refreshing a buried patch that needed a merge\n> conflict sorted out. I'm unable to recover out of the state.\n\nHmm, so what you're saying is basically that you did something with\n\"stg refresh -p\" that caused a merge conflict, and that messed things\nup so that you needed to run \"stg repair\". Is that right?\n\nHave you been able to reproduce it? (I would like to add the failing\ncase to the test suite.)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"95397","messageId":"9e4733910811101508h3cb30752o77b61926aeefed5b@mail.gmail.com","threadId":"16168","inReplyTo":"20081107054419.GA27146@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-10T23:08:54Z","receivedAt":"2008-11-10T23:08:54Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On Fri, Nov 7, 2008 at 12:44 AM, Karl Hasselström <kha@treskal.com> wrote:\n> On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n>\n>> I hit a case when refreshing a buried patch that needed a merge\n>> conflict sorted out. I'm unable to recover out of the state.\n>\n> Hmm, so what you're saying is basically that you did something with\n> \"stg refresh -p\" that caused a merge conflict, and that messed things\n> up so that you needed to run \"stg repair\". Is that right?\n\nMissed the reply.\n\nYes, that is what happed.\n\nI think the problem was this:\n\nFile - xxxxxxx\nPatch A adds a line\nFile - xxxxxxxa\nPatch B in the middle adds a line\nFile - xxxxxxxab\nI edit it and add a line\nFile - xxxxxxxabc\nLine c needs to be patch A\nstg refresh -p A\n..messed up tree\n\n\n\n>\n> Have you been able to reproduce it? (I would like to add the failing\n> case to the test suite.)\n>\n> --\n> Karl Hasselström, kha@treskal.com\n>      www.treskal.com/kalle\n>\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"95398","messageId":"9e4733910811101510p74ea9d5hda7d47dc3bf16b5c@mail.gmail.com","threadId":"16168","inReplyTo":"9e4733910811101508h3cb30752o77b61926aeefed5b@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-10T23:10:34Z","receivedAt":"2008-11-10T23:10:34Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On Mon, Nov 10, 2008 at 6:08 PM, Jon Smirl <jonsmirl@gmail.com> wrote:\n> On Fri, Nov 7, 2008 at 12:44 AM, Karl Hasselström <kha@treskal.com> wrote:\n>> On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n>>\n>>> I hit a case when refreshing a buried patch that needed a merge\n>>> conflict sorted out. I'm unable to recover out of the state.\n>>\n>> Hmm, so what you're saying is basically that you did something with\n>> \"stg refresh -p\" that caused a merge conflict, and that messed things\n>> up so that you needed to run \"stg repair\". Is that right?\n>\n> Missed the reply.\n>\n> Yes, that is what happed.\n>\n> I think the problem was this:\n>\n> File - xxxxxxx\n> Patch A adds a line\n> File - xxxxxxxa\n> Patch B in the middle adds a line\n> File - xxxxxxxab\n> I edit it and add a line\n> File - xxxxxxxabc\n> Line c needs to be patch A\n> stg refresh -p A\n> ..messed up tree\n>\n>\n>\n>>\n>> Have you been able to reproduce it? (I would like to add the failing\n>> case to the test suite.)\n\nYes, it happens every time the 'stg refresh -p' triggers a merge conflict.\nstg repair seem to fix it and then I touch things up manually.\n\n>>\n>> --\n>> Karl Hasselström, kha@treskal.com\n>>      www.treskal.com/kalle\n>>\n>\n>\n>\n> --\n> Jon Smirl\n> jonsmirl@gmail.com\n>\n\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"95475","messageId":"b0943d9e0811110959t4eb236bvd648fbca5e482911@mail.gmail.com","threadId":"16168","inReplyTo":"20081107054419.GA27146@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-11-11T17:59:02Z","receivedAt":"2008-11-11T17:59:02Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/11/7 Karl Hasselström <kha@treskal.com>:\n> On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n>\n>> I hit a case when refreshing a buried patch that needed a merge\n>> conflict sorted out. I'm unable to recover out of the state.\n>\n> Hmm, so what you're saying is basically that you did something with\n> \"stg refresh -p\" that caused a merge conflict, and that messed things\n> up so that you needed to run \"stg repair\". Is that right?\n>\n> Have you been able to reproduce it? (I would like to add the failing\n> case to the test suite.)\n\nCould be related to this - if I run 'stg goto some-patch' and it fails\nwith a conflict, the HEAD points to the previous patch though the\nstack has the conflicting patch as empty (which is normal) and the\nconflicts in the index. Anything after that says HEAD and top not\nequal and 'stg repair' is needed.\n\n-- \nCatalin\n"},{"id":"95529","messageId":"20081112080103.GA25454@diana.vm.bytemark.co.uk","threadId":"16168","inReplyTo":"b0943d9e0811110959t4eb236bvd648fbca5e482911@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-11-12T08:01:03Z","receivedAt":"2008-11-12T08:01:03Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-11-11 17:59:02 +0000, Catalin Marinas wrote:\n\n> 2008/11/7 Karl Hasselström <kha@treskal.com>:\n>\n> > On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n> >\n> > > I hit a case when refreshing a buried patch that needed a merge\n> > > conflict sorted out. I'm unable to recover out of the state.\n> >\n> > Hmm, so what you're saying is basically that you did something\n> > with \"stg refresh -p\" that caused a merge conflict, and that\n> > messed things up so that you needed to run \"stg repair\". Is that\n> > right?\n>\n> Could be related to this - if I run 'stg goto some-patch' and it\n> fails with a conflict, the HEAD points to the previous patch though\n> the stack has the conflicting patch as empty (which is normal) and\n> the conflicts in the index. Anything after that says HEAD and top\n> not equal and 'stg repair' is needed.\n\nAh, yes, that could definitely be the same problem, since those two\nthings end up calling the same functions to handle the conflict.\n\nI'll build a test case for that as well.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"95545","messageId":"b0943d9e0811120202wae88381j9fbc9f919b49dce5@mail.gmail.com","threadId":"16168","inReplyTo":"20081112080103.GA25454@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-11-12T10:02:10Z","receivedAt":"2008-11-12T10:02:10Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/11/12 Karl Hasselström <kha@treskal.com>:\n> On 2008-11-11 17:59:02 +0000, Catalin Marinas wrote:\n>> Could be related to this - if I run 'stg goto some-patch' and it\n>> fails with a conflict, the HEAD points to the previous patch though\n>> the stack has the conflicting patch as empty (which is normal) and\n>> the conflicts in the index. Anything after that says HEAD and top\n>> not equal and 'stg repair' is needed.\n>\n> Ah, yes, that could definitely be the same problem, since those two\n> things end up calling the same functions to handle the conflict.\n\nI think it's just a matter of updating HEAD on the \"merge_conflict\"\npath but I'm still not fully confident in modifying the new lib\ninfrastructure.\n\n> I'll build a test case for that as well.\n\nWe test the conflicts quite a lot in the \"push\" tests but this command\nhasn't been converted to the new infrastructure yet.\n\n-- \nCatalin\n"},{"id":"95547","messageId":"20081112101439.GA27469@diana.vm.bytemark.co.uk","threadId":"16168","inReplyTo":"b0943d9e0811120202wae88381j9fbc9f919b49dce5@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-11-12T10:14:39Z","receivedAt":"2008-11-12T10:14:39Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-11-12 10:02:10 +0000, Catalin Marinas wrote:\n\n> I think it's just a matter of updating HEAD on the \"merge_conflict\"\n> path but I'm still not fully confident in modifying the new lib\n> infrastructure.\n\nYou're probably right.\n\nI'll do it, but you're welcome to beat me to it if you like; I promise\nto read your patch extra carefully if you do.\n\n(I'll drop you a mail when I start attacking this, to prevent any\nduplicated work.)\n\n> 2008/11/12 Karl Hasselström <kha@treskal.com>:\n>\n> > I'll build a test case for that as well.\n>\n> We test the conflicts quite a lot in the \"push\" tests but this\n> command hasn't been converted to the new infrastructure yet.\n\nYes. As soon as we convert push and/or pop, this will be caught by the\ntest suite. But that just means the test suite needs extending ...\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"95556","messageId":"20081112124615.GA29659@diana.vm.bytemark.co.uk","threadId":"16168","inReplyTo":"20081112080103.GA25454@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-11-12T12:46:15Z","receivedAt":"2008-11-12T12:46:15Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-11-12 09:01:03 +0100, Karl Hasselström wrote:\n\n> On 2008-11-11 17:59:02 +0000, Catalin Marinas wrote:\n>\n> > 2008/11/7 Karl Hasselström <kha@treskal.com>:\n> >\n> > > On 2008-11-04 08:37:24 -0500, Jon Smirl wrote:\n> > >\n> > > > I hit a case when refreshing a buried patch that needed a\n> > > > merge conflict sorted out. I'm unable to recover out of the\n> > > > state.\n> > >\n> > > Hmm, so what you're saying is basically that you did something\n> > > with \"stg refresh -p\" that caused a merge conflict, and that\n> > > messed things up so that you needed to run \"stg repair\". Is that\n> > > right?\n> >\n> > Could be related to this - if I run 'stg goto some-patch' and it\n> > fails with a conflict, the HEAD points to the previous patch\n> > though the stack has the conflicting patch as empty (which is\n> > normal) and the conflicts in the index. Anything after that says\n> > HEAD and top not equal and 'stg repair' is needed.\n>\n> Ah, yes, that could definitely be the same problem, since those two\n> things end up calling the same functions to handle the conflict.\n\nOK, I just got this error with goto. :-)\n\nFWIW, the convenient way to recover is\n\n  $ git reset --soft $(stg id $(stg top))\n\nThis will point your branch head to the correct commit. stg repair\nwould pop the top patch, which is much less convenient in this case.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"96390","messageId":"b0943d9e0811231320s804eff0k5aecbac84cb2ffe7@mail.gmail.com","threadId":"16168","inReplyTo":"20081112101439.GA27469@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-11-23T21:20:59Z","receivedAt":"2008-11-23T21:20:59Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/11/12 Karl Hasselström <kha@treskal.com>:\n> On 2008-11-12 10:02:10 +0000, Catalin Marinas wrote:\n>\n>> I think it's just a matter of updating HEAD on the \"merge_conflict\"\n>> path but I'm still not fully confident in modifying the new lib\n>> infrastructure.\n>\n> You're probably right.\n\nThe simple patch below seems to fix it the goto issue. Could you\nplease confirm its correctness (the patch might be wrapped by the web\ninterface)?\n\ndiff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py\nindex 6623645..0f414d8 100644\n--- a/stgit/lib/transaction.py\n+++ b/stgit/lib/transaction.py\n@@ -321,6 +321,7 @@ class StackTransaction(object):\n         if any(getattr(cd, a) != getattr(orig_cd, a) for a in\n                ['parent', 'tree', 'author', 'message']):\n             comm = self.__stack.repository.commit(cd)\n+            self.head = comm\n         else:\n             comm = None\n             s = ' (unmodified)'\n\nThanks.\n\n-- \nCatalin\n"},{"id":"96411","messageId":"20081124111635.GA31986@diana.vm.bytemark.co.uk","threadId":"16168","inReplyTo":"b0943d9e0811231320s804eff0k5aecbac84cb2ffe7@mail.gmail.com","subject":"Re: Stgit and refresh-temp","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-11-24T11:16:35Z","receivedAt":"2008-11-24T11:16:35Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-11-23 21:20:59 +0000, Catalin Marinas wrote:\n\n> 2008/11/12 Karl Hasselström <kha@treskal.com>:\n>\n> > On 2008-11-12 10:02:10 +0000, Catalin Marinas wrote:\n> >\n> > > I think it's just a matter of updating HEAD on the\n> > > \"merge_conflict\" path but I'm still not fully confident in\n> > > modifying the new lib infrastructure.\n> >\n> > You're probably right.\n>\n> The simple patch below seems to fix it the goto issue. Could you\n> please confirm its correctness (the patch might be wrapped by the web\n> interface)?\n>\n> diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py\n> index 6623645..0f414d8 100644\n> --- a/stgit/lib/transaction.py\n> +++ b/stgit/lib/transaction.py\n> @@ -321,6 +321,7 @@ class StackTransaction(object):\n>          if any(getattr(cd, a) != getattr(orig_cd, a) for a in\n>                 ['parent', 'tree', 'author', 'message']):\n>              comm = self.__stack.repository.commit(cd)\n> +            self.head = comm\n>          else:\n>              comm = None\n>              s = ' (unmodified)'\n\nOK, so I just took a quick look, and my understanding of the problem\n(without having had time to actually run any code to confirm) is that\nthe following happens:\n\n  1. In push_patch(), we delay the final stack update (the update()\n     function) since we want to record the state just before the\n     conflict in the stack log.\n\n  2. In run(), we update the branch head before running the delayed\n     stack update (self.__conflicting_push()).\n\nYour patch works around this problem by explicitly specifying what the\nbranch head should be; this mechanism is used by undo etc. to be able\nto set the branch head to something that isn't the stack top.\n\nAt first I thought it was something of a hack, and that the run()\nfunction should probably be modified to do something clever when\nself.__conflicting_push != None, such as writing the branch head\nlater. But there's a reason the checkout is done first in run(): it's\nthe one and only thing that can go wrong, in which case we have to\nroll back. So I guess your solution is indeed at least as right and\nproper as anything I would have come up with.\n\nBut I would recommend a big fat comment just before the line you\ninsert that explains why we have to set self.head hard in this case\n(namely, that the update() function is run _after_ checkout in run()).\n\nWith that comment,\n\nAcked-by: Karl Hasselström <kha@treskal.com>\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"96416","messageId":"9e4733910811240611x605b539am6a659ab29437035@mail.gmail.com","threadId":"16168","inReplyTo":"20081124111635.GA31986@diana.vm.bytemark.co.uk","subject":"Re: Stgit and refresh-temp","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-11-24T14:11:51Z","receivedAt":"2008-11-24T14:11:51Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"A useful future enhancement would be to adjust patches that insert\nadjacent areas so that they can pass each other in a pop/pop\noperation. The most common case of this being appends to end of file.\n\nThis would be a form of automatic conflict resolution. The pending\npatch would be automatically corrected to resolve the adjacent insert\nconflict.  You might want a prompt asking if this was ok andt then\nremember the answer so that question is not asked repeatedly.\n\nIt's a mechanism to say that multiple insertions at point X in the\noriginal file don't matter in their order of insertion.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"}]}