{"thread":{"id":"12330","subject":"stgit - continue rebase after merge conflict?","startedAt":"2008-02-26T14:57:25Z","lastAt":"2008-02-29T07:58:21Z","messageCount":7,"participants":["Alex Chiang","Catalin Marinas","Karl Hasselström"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"69999","messageId":"20080226145725.GA24987@ldl.fc.hp.com","threadId":"12330","inReplyTo":null,"subject":"stgit - continue rebase after merge conflict?","fromName":"Alex Chiang","fromEmail":"achiang@hp.com","sentAt":"2008-02-26T14:57:25Z","receivedAt":"2008-02-26T14:57:25Z","isPatch":false,"sender":{"key":"achiang@hp.com","avatar":null},"body":"Hi Catalin,\n\nHow does one do a stg rebase if there are merge conflicts?\n\nI see:\n\n-------------------------------------------------------\nachiang@blender:~/kernels/linux-2.6$ stg rebase origin\nUpgraded branch stg-pci-slots to format version 2\nChecking for changes in the working directory ... done\nPopping all applied patches ... done\nRebasing to \"origin\" ... done\nPushing patch \"0001-Remove-path-attribute-from-sgi_hotplug.patch\" ... done\nPushing patch \"0002-Construct-one-fakephp-slot-per-pci-slot.patch\" ... \n  CONFLICT (content): Merge conflict in drivers/pci/hotplug/fakephp.c\n  Error: The merge failed during \"push\".\n         Revert the operation with \"push --undo\".\n  stg rebase: 1 conflict(s)\n-------------------------------------------------------\n\nThis output tells you how to undo the rebase, but doesn't give\nany clues on how to continue it, like git would:\n\n-------------------------------------------------------\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo restore the original branch and stop rebasing run \"git rebase --abort\".\n-------------------------------------------------------\n\nDoing an 'stg help rebase' isn't so helpful.\n\nMy *guess* is that I want to:\n\n\t- manually resolve the merge conflicts\n\t- stg refresh\n\t- ???\n\nAny hints are appreciated.\n\nThanks.\n\n/ac\n"},{"id":"70007","messageId":"b0943d9e0802260856j6e9b0053ne4916149d8e4387c@mail.gmail.com","threadId":"12330","inReplyTo":"20080226145725.GA24987@ldl.fc.hp.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-02-26T16:56:53Z","receivedAt":"2008-02-26T16:56:53Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 26/02/2008, Alex Chiang <achiang@hp.com> wrote:\n>  How does one do a stg rebase if there are merge conflicts?\n\nBasically, you solve the conflict, refresh the current patch and\ncontinue with 'stg push' or 'stg goto <top patch>'. The 'rebase'\ncommand does 'pop --all', 'git reset', 'push --all'. In your conflict,\nthe base of the stack was already changed to the latest and hence only\npush/goto is needed. To fix it:\n\n$ vi files   # or simply use 'resolved -i' below\n$ stg resolved -a [-i]\n$ stg refresh\n$ stg goto top-patch\n\nor (if you want to skip that patch):\n\n$ stg push --undo\n$ stg push next-patch..\n\nThe 'rebase' command doesn't store any information about the state of\nthe stack and cannot continue it. Maybe we'll do something in the next\nrelease as the refactored code has support for transactions.\n\nYet another option is to enable the automatic interactive merge ('git\nconfig stgit.autoimerge yes') and, at a conflict, it calls your\nthree-way merge tool (emacs, xxdiff etc.). If the merge tool succeeds,\nthe rebase will simply continue.\n\n>  This output tells you how to undo the rebase, but doesn't give\n>  any clues on how to continue it, like git would:\n>\n>  -------------------------------------------------------\n>  When you have resolved this problem run \"git rebase --continue\".\n>  If you would prefer to skip this patch, instead run \"git rebase --skip\".\n>  To restore the original branch and stop rebasing run \"git rebase --abort\".\n>  -------------------------------------------------------\n>\n>  Doing an 'stg help rebase' isn't so helpful.\n\nYes, indeed. It could be made better.\n\n-- \nCatalin\n"},{"id":"70012","messageId":"20080226174928.GA15862@ldl.fc.hp.com","threadId":"12330","inReplyTo":"b0943d9e0802260856j6e9b0053ne4916149d8e4387c@mail.gmail.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Alex Chiang","fromEmail":"achiang@hp.com","sentAt":"2008-02-26T17:49:28Z","receivedAt":"2008-02-26T17:49:28Z","isPatch":false,"sender":{"key":"achiang@hp.com","avatar":null},"body":"* Catalin Marinas <catalin.marinas@gmail.com>:\n> On 26/02/2008, Alex Chiang <achiang@hp.com> wrote:\n> >  How does one do a stg rebase if there are merge conflicts?\n> \n> Basically, you solve the conflict, refresh the current patch and\n> continue with 'stg push' or 'stg goto <top patch>'.\n\nThanks.\n\n> The 'rebase' command doesn't store any information about the state of\n> the stack and cannot continue it. Maybe we'll do something in the next\n> release as the refactored code has support for transactions.\n\nI see.\n\n> >  Doing an 'stg help rebase' isn't so helpful.\n> \n> Yes, indeed. It could be made better.\n\nHow about this?\n\n/ac\n\nFrom: Alex Chiang <achiang@hp.com>\n\nEnhance rebase help string by providing guidance on merge\nconflict resolution during a rebase.\n\nBased on text suggested by Catalin Marinas.\n\nSigned-off-by: Alex Chiang <achiang@hp.com>\n---\ndiff --git a/stgit/commands/rebase.py b/stgit/commands/rebase.py\nindex 12faaf8..29d741b 100644\n--- a/stgit/commands/rebase.py\n+++ b/stgit/commands/rebase.py\n@@ -27,7 +27,19 @@ help = 'move the stack base to another point in history'\n usage = \"\"\"%prog [options] <new-base-id>\n \n Pop all patches from current stack, move the stack base to the given\n-<new-base-id> and push the patches back.\"\"\"\n+<new-base-id> and push the patches back.\n+\n+If you experience merge conflicts, resolve the problem and continue\n+the rebase by executing the following sequence:\n+\n+\t$ stg resolved -a [-i]\n+\t$ stg refresh\n+\t$ stg goto top-patch\n+\n+Or if you want to skip that patch:\n+\n+\t$ stg push --undo\n+\t$ stg push next-patch..\"\"\"\n \n directory = DirectoryGotoToplevel()\n options = [make_option('-n', '--nopush',\n"},{"id":"70073","messageId":"20080227093808.GA7795@diana.vm.bytemark.co.uk","threadId":"12330","inReplyTo":"b0943d9e0802260856j6e9b0053ne4916149d8e4387c@mail.gmail.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-02-27T09:38:08Z","receivedAt":"2008-02-27T09:38:08Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-02-26 16:56:53 +0000, Catalin Marinas wrote:\n\n> or (if you want to skip that patch):\n>\n> $ stg push --undo\n> $ stg push next-patch..\n\nBetter use\n\n  $ stg push next-patch..top-patch\n\nwhich works even if you don't want to push _all_ patches.\n\n> The 'rebase' command doesn't store any information about the state\n> of the stack and cannot continue it. Maybe we'll do something in the\n> next release as the refactored code has support for transactions.\n\nHmm, that's an interesting idea. Maybe an \"stg resume\" command that\none would run after having resolved the conflicts.\n\nOne implementation would be to save a .stgit-todo file with contents\nlike this:\n\n  push foo\n  push bar\n  push baz\n\nIt would have to handle more than just pushes, however. For example,\nstg coalesce will try to first push the given patches in order, and\nthen coalesce them, so for that case .stgit-todo might look like this:\n\n  push bar\n  push baz\n  coalesce foo bar baz\n  push frotz\n\nWe should be able to redefine each non-atomic stgit command in terms\nof such atomic commands, and get resumeability all over the place.\n\nI'm not sure this is a good idea, but it is intriguing.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"70282","messageId":"20080228173830.GA16045@ldl.fc.hp.com","threadId":"12330","inReplyTo":"b0943d9e0802260856j6e9b0053ne4916149d8e4387c@mail.gmail.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Alex Chiang","fromEmail":"achiang@hp.com","sentAt":"2008-02-28T17:38:30Z","receivedAt":"2008-02-28T17:38:30Z","isPatch":false,"sender":{"key":"achiang@hp.com","avatar":null},"body":"* Catalin Marinas <catalin.marinas@gmail.com>:\n> On 26/02/2008, Alex Chiang <achiang@hp.com> wrote:\n> >  How does one do a stg rebase if there are merge conflicts?\n> \n> Basically, you solve the conflict, refresh the current patch and\n> continue with 'stg push' or 'stg goto <top patch>'. The 'rebase'\n> command does 'pop --all', 'git reset', 'push --all'. In your conflict,\n> the base of the stack was already changed to the latest and hence only\n> push/goto is needed. To fix it:\n> \n> $ vi files   # or simply use 'resolved -i' below\n> $ stg resolved -a [-i]\n> $ stg refresh\n> $ stg goto top-patch\n\nThat goto command doesn't tell you about merge conflicts:\n\nachiang@blender:~/kernels/linux-2.6$ stg series\n+ 0001-Remove-path-attribute-from-sgi_hotplug.patch\n> 0002-Construct-one-fakephp-slot-per-pci-slot.patch\n- 0003-Introduce-pci_slot.patch\n- 0004-ACPI-PCI-slot-detection-driver.patch\n\nachiang@blender:~/kernels/linux-2.6$ stg goto 0004-ACPI-PCI-slot-detection-driver.patch \nPushed 0003-Introduce-pci_slot.patch (conflict)\nError: Merge conflict\nNow at patch \"0003-Introduce-pci_slot.patch\"\n\nachiang@blender:~/kernels/linux-2.6$ stg series\n+ 0001-Remove-path-attribute-from-sgi_hotplug.patch\n+ 0002-Construct-one-fakephp-slot-per-pci-slot.patch\n> 0003-Introduce-pci_slot.patch\n- 0004-ACPI-PCI-slot-detection-driver.patch\n\nSince this patch series is small, I just did a 'stg push' and now\nit tells me about the conflicts. But I don't think I'd want to do\nthat if I was managing tens or hundreds of patches...\n\nachiang@blender:~/kernels/linux-2.6$ stg push --undo\nUndoing push of \"0003-Introduce-pci_slot.patch\" ... done\nNow at patch \"0002-Construct-one-fakephp-slot-per-pci-slot.patch\"\nachiang@blender:~/kernels/linux-2.6$ stg push\nChecking for changes in the working directory ... done\nPushing patch \"0003-Introduce-pci_slot.patch\" ... \n  CONFLICT (content): Merge conflict in drivers/pci/hotplug/acpiphp_ibm.c\n  CONFLICT (content): Merge conflict in drivers/pci/hotplug/pci_hotplug_core.c\n  CONFLICT (content): Merge conflict in drivers/pci/hotplug/rpadlpar_sysfs.c\n  CONFLICT (content): Merge conflict in include/linux/pci.h\n  CONFLICT (content): Merge conflict in include/linux/pci_hotplug.h\n  Error: The merge failed during \"push\".\n         Revert the operation with \"push --undo\".\n  stg push: 5 conflict(s)\n\nIs this pilot error? Or is goto misbehaving?\n\nThanks.\n\n/ac\n\n"},{"id":"70321","messageId":"b0943d9e0802281350r3945d3f0qd0dd8ee61679e82d@mail.gmail.com","threadId":"12330","inReplyTo":"20080228173830.GA16045@ldl.fc.hp.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-02-28T21:50:04Z","receivedAt":"2008-02-28T21:50:04Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 28/02/2008, Alex Chiang <achiang@hp.com> wrote:\n> * Catalin Marinas <catalin.marinas@gmail.com>:\n>\n> > On 26/02/2008, Alex Chiang <achiang@hp.com> wrote:\n>  > >  How does one do a stg rebase if there are merge conflicts?\n>  >\n>  > Basically, you solve the conflict, refresh the current patch and\n>  > continue with 'stg push' or 'stg goto <top patch>'. The 'rebase'\n>  > command does 'pop --all', 'git reset', 'push --all'. In your conflict,\n>  > the base of the stack was already changed to the latest and hence only\n>  > push/goto is needed. To fix it:\n>  >\n>  > $ vi files   # or simply use 'resolved -i' below\n>  > $ stg resolved -a [-i]\n>  > $ stg refresh\n>  > $ stg goto top-patch\n>\n>\n> That goto command doesn't tell you about merge conflicts:\n[...]\n>  achiang@blender:~/kernels/linux-2.6$ stg goto 0004-ACPI-PCI-slot-detection-driver.patch\n>  Pushed 0003-Introduce-pci_slot.patch (conflict)\n>  Error: Merge conflict\n>  Now at patch \"0003-Introduce-pci_slot.patch\"\n\nIt says that it's a merge conflict but isn't more precise than that.\nYou can run 'stg status' to check the conflicts.\n\nThe reason is that you are probably using the development branch of\nStGIT and we (actually Karl) are refactoring the GIT objects handling.\nThe 'goto' command (but not 'push') was moved to the new\ninfrastructure but missed some of the UI stuff. They'll be added back.\n\nI could use the stable branch until we sort out these issues.\n\n-- \nCatalin\n"},{"id":"70370","messageId":"20080229075821.GA14773@diana.vm.bytemark.co.uk","threadId":"12330","inReplyTo":"b0943d9e0802281350r3945d3f0qd0dd8ee61679e82d@mail.gmail.com","subject":"Re: stgit - continue rebase after merge conflict?","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-02-29T07:58:21Z","receivedAt":"2008-02-29T07:58:21Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-02-28 21:50:04 +0000, Catalin Marinas wrote:\n\n> It says that it's a merge conflict but isn't more precise than that.\n> You can run 'stg status' to check the conflicts.\n>\n> The reason is that you are probably using the development branch of\n> StGIT and we (actually Karl) are refactoring the GIT objects\n> handling. The 'goto' command (but not 'push') was moved to the new\n> infrastructure but missed some of the UI stuff. They'll be added\n> back.\n\nYeah, I'd forgotten all about that. I rarely get conflicts when\nrunning \"stg goto\".\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}