{"thread":{"id":"10136","subject":"stgit: lost all my patches again","startedAt":"2007-10-04T05:29:17Z","lastAt":"2007-10-04T17:29:30Z","messageCount":7,"participants":["Jon Smirl","Karl Hasselström","David Brown"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"54789","messageId":"9e4733910710032229m38fb4e47k5aa0b2b2e0eb2251@mail.gmail.com","threadId":"10136","inReplyTo":null,"subject":"stgit: lost all my patches again","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-10-04T05:29:17Z","receivedAt":"2007-10-04T05:29:17Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"I believe this command did it:\n\nstg refresh -p pcm030_bsp_powerpc -e\n\nthat patch whitespace errors in it\nI edited the description and removed the last line\nit was 10th patch down in the stack\n\nfor some reason the refresh from that command didn't close.\nThen stg pushed all the patches back after the edit and they got\nincluded into that patch.\n\nstg should definitely have an assert that the previous patch is closed\nbefore auto pushing.\nThere is a bug somewhere that caused that edit refresh not to get closed.\n\nI am using stg version:\n5ae6fcce77a29221e15f6a4e8348bd4276960ba1\n\nIt might also be good to make a log that lets me rollback commands.\nAll of the info is still in the system.\n\nThis refresh failed to close:\njonsmirl@terra:~/mpc5200b$ stg log pcm030_bsp_powerpc\n95a8e03b [push   ]                               Thu Oct  4 00:27:53 2007 -0400\n6094a0a5 [refresh]                               Thu Oct  4 00:00:41 2007 -0400\n0c4f5480 [push(f)]                               Wed Oct  3 22:10:38 2007 -0400\n9a685ae9 [push(f)]                               Wed Oct  3 22:05:47 2007 -0400\n\nThis push ended up in the bsp patch:\njonsmirl@terra:~/mpc5200b$ stg log mpc52xx_restart\n801962ed [push   ]                               Thu Oct  4 00:33:42 2007 -0400\n9e0c7417 [push   ]                               Thu Oct  4 00:27:53 2007 -0400\n37822491 [push   ]                               Thu Oct  4 00:00:41 2007 -0400\n9aff07ff [push(f)]                               Wed Oct  3 22:10:38 2007 -0400\nc41c9cb3 [push(f)]                               Wed Oct  3 22:05:47 2007 -0400\n\nand so one for nine more patches.\nThe ten messed up patches still have their descriptions, the are just\nmissing the changes.\n\n---------------------------------\nAfter an export stg puts the patches into patches-m25\nLooking back in my command logs I had done:\n  stg export\n  cd patches-m25\n  grep for some things\n  stg refresh -p pcm030_bsp_powerpc -e\n\nI did the 'stg refresh' from a directory that was not being tracked by git.\nIt is in the .gitignore list. This appears to be the root of the problem.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"54800","messageId":"20071004083304.GB17778@diana.vm.bytemark.co.uk","threadId":"10136","inReplyTo":"9e4733910710032229m38fb4e47k5aa0b2b2e0eb2251@mail.gmail.com","subject":"Re: stgit: lost all my patches again","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-10-04T08:33:04Z","receivedAt":"2007-10-04T08:33:04Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-10-04 01:29:17 -0400, Jon Smirl wrote:\n\n> for some reason the refresh from that command didn't close. Then stg\n> pushed all the patches back after the edit and they got included\n> into that patch.\n\nThat's really weird. As far as I know there isn't a concept of\n\"closed\" patches in StGit -- there's no need, because they're always\nclosed!\n\n> I did the 'stg refresh' from a directory that was not being tracked\n> by git. It is in the .gitignore list. This appears to be the root of\n> the problem.\n\nMmmph. This is not the only StGit command that's apparently not safe\nto run from a subdirectory. See e.g. https://gna.org/bugs/?9986.\n\nI plan to do some StGit hacking this weekend. I guess subdirectory\nsafeness ought to be at the top of my list ...\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"54810","messageId":"9e4733910710040510v53cd390el35cf5b4251e6d@mail.gmail.com","threadId":"10136","inReplyTo":"20071004083304.GB17778@diana.vm.bytemark.co.uk","subject":"Re: stgit: lost all my patches again","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-10-04T12:10:12Z","receivedAt":"2007-10-04T12:10:12Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 10/4/07, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-10-04 01:29:17 -0400, Jon Smirl wrote:\n>\n> > for some reason the refresh from that command didn't close. Then stg\n> > pushed all the patches back after the edit and they got included\n> > into that patch.\n>\n> That's really weird. As far as I know there isn't a concept of\n> \"closed\" patches in StGit -- there's no need, because they're always\n> closed!\n\nMust be the other way around then, the next nine patches didn't get\nopened right. Their descriptions ended up in the right place but the\ndeltas all ended up in the first patch.\n\n> > I did the 'stg refresh' from a directory that was not being tracked\n> > by git. It is in the .gitignore list. This appears to be the root of\n> > the problem.\n>\n> Mmmph. This is not the only StGit command that's apparently not safe\n> to run from a subdirectory. See e.g. https://gna.org/bugs/?9986.\n>\n> I plan to do some StGit hacking this weekend. I guess subdirectory\n> safeness ought to be at the top of my list ...\n>\n> --\n> Karl Hasselström, kha@treskal.com\n>       www.treskal.com/kalle\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"54817","messageId":"9e4733910710040606j75caa6bcn1e97e59c1285eb4b@mail.gmail.com","threadId":"10136","inReplyTo":"20071004083304.GB17778@diana.vm.bytemark.co.uk","subject":"Re: stgit: lost all my patches again","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-10-04T13:06:22Z","receivedAt":"2007-10-04T13:06:22Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 10/4/07, Karl Hasselström <kha@treskal.com> wrote:\n> Mmmph. This is not the only StGit command that's apparently not safe\n> to run from a subdirectory. See e.g. https://gna.org/bugs/?9986.\n>\n> I plan to do some StGit hacking this weekend. I guess subdirectory\n> safeness ought to be at the top of my list ...\n\nIsn't a rollback log fairly easy to implement? Is there a single SHA\nafter each operation? If so just record the commands and the sha to\nrollback.\n\nI have also messed things up more than once using 'git merge linus'\ninstead of 'stg rebase linus'. Should 'git merge' have a check to see\nif stg is active and refuse to run?\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"54835","messageId":"20071004153830.GA21717@diana.vm.bytemark.co.uk","threadId":"10136","inReplyTo":"9e4733910710040606j75caa6bcn1e97e59c1285eb4b@mail.gmail.com","subject":"Re: stgit: lost all my patches again","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-10-04T15:38:30Z","receivedAt":"2007-10-04T15:38:30Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-10-04 09:06:22 -0400, Jon Smirl wrote:\n\n> On 10/4/07, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > Mmmph. This is not the only StGit command that's apparently not\n> > safe to run from a subdirectory. See e.g.\n> > https://gna.org/bugs/?9986.\n> >\n> > I plan to do some StGit hacking this weekend. I guess subdirectory\n> > safeness ought to be at the top of my list ...\n>\n> Isn't a rollback log fairly easy to implement? Is there a single SHA\n> after each operation? If so just record the commands and the sha to\n> rollback.\n\nYeah, conceptually it's simple. The only major complication there is\nif you want to allow undo both at the whole-stack level and on single\npatches.\n\n> I have also messed things up more than once using 'git merge linus'\n> instead of 'stg rebase linus'. Should 'git merge' have a check to\n> see if stg is active and refuse to run?\n\nI've always felt that git shouldn't have to know about third-party\ntools.\n\nstg will detect that you've made git commits on top of the stack.\nThere's a command to turn them into patches -- but not if they are\nmerges, of course. In a sufficiently bleeding-edge StGit, assimilate\nwill tell you something like,\n\n  14 patches are hidden below the merge commit 4711abcd,\n  and will be considered unapplied.\n\nat which point you can easily git-reset to below the merge and run\nassimilate again.\n\nThis is of course less user-friendly than having git refuse to commit\na merge in the first place. Hmmm, a commit hook could probably do\nmagic here ... it could even turn regular commits into patches on the\nfly. I'll have to look up how commit hooks work.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"54837","messageId":"20071004154508.GA15424@old.davidb.org","threadId":"10136","inReplyTo":"20071004083304.GB17778@diana.vm.bytemark.co.uk","subject":"Re: stgit: lost all my patches again","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2007-10-04T15:45:08Z","receivedAt":"2007-10-04T15:45:08Z","isPatch":false,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Thu, Oct 04, 2007 at 10:33:04AM +0200, Karl Hasselström wrote:\n\n>> I did the 'stg refresh' from a directory that was not being tracked\n>> by git. It is in the .gitignore list. This appears to be the root of\n>> the problem.\n>\n>Mmmph. This is not the only StGit command that's apparently not safe\n>to run from a subdirectory. See e.g. https://gna.org/bugs/?9986.\n\nI get an \"Error: This item is private\" from that page, so I'm not sure what\nthat is.\n\nJust yesterday, I had 'stg push' empty out my patches when I ran it from a\nsubdirectory.  Fortunately, in this case, the old versions were in the log,\nbut I can imagine someone less familiar with what git and stgit are doing\nnot knowing how to recover this.\n\nDavid\n"},{"id":"54858","messageId":"20071004172930.GC21717@diana.vm.bytemark.co.uk","threadId":"10136","inReplyTo":"20071004154508.GA15424@old.davidb.org","subject":"Re: stgit: lost all my patches again","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-10-04T17:29:30Z","receivedAt":"2007-10-04T17:29:30Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-10-04 08:45:08 -0700, David Brown wrote:\n\n> On Thu, Oct 04, 2007 at 10:33:04AM +0200, Karl Hasselström wrote:\n>\n> > > I did the 'stg refresh' from a directory that was not being\n> > > tracked by git. It is in the .gitignore list. This appears to be\n> > > the root of the problem.\n> >\n> > Mmmph. This is not the only StGit command that's apparently not\n> > safe to run from a subdirectory. See e.g.\n> > https://gna.org/bugs/?9986.\n>\n> I get an \"Error: This item is private\" from that page, so I'm not\n> sure what that is.\n\nBleh. For some reason that bug was marked \"private\" (possibly because\nit was posted anonymously), and I didn't realize because _I_ could\nread it just fine ... Sorry about that; I've made it public now.\n\n> Just yesterday, I had 'stg push' empty out my patches when I ran it\n> from a subdirectory. Fortunately, in this case, the old versions\n> were in the log, but I can imagine someone less familiar with what\n> git and stgit are doing not knowing how to recover this.\n\nYep. I hadn't really realized how bad this was, because I always run\nstg from the root dir. Wonder how I picked up that habit? ;-)\n\nThanks for the report.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}