{"thread":{"id":"13837","subject":"Re: Multiple user questions","startedAt":"2008-06-06T20:47:39Z","lastAt":"2008-06-06T22:15:29Z","messageCount":3,"participants":["Dennis Schridde","Brandon Casey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"78956","messageId":"200806062247.42074.devurandom@gmx.net","threadId":"13837","inReplyTo":null,"subject":"Re: Multiple user questions","fromName":"Dennis Schridde","fromEmail":"devurandom@gmx.net","sentAt":"2008-06-06T20:47:39Z","receivedAt":"2008-06-06T20:47:39Z","isPatch":false,"sender":{"key":"devurandom@gmx.net","avatar":null},"body":"I just ran into a lost stash again and thus would like to get an answer to \nthis question, which was forgotten last time:\n(lost-found is really growing in a pace it will take me very long to find my \nlost stash.)\n\n5) fsck --full --lost-found shows me a lot of \"dangling commit\". I would like \nto clean them up. prune did only remove \"dangling tree\" and blobs.\n(Reason: Last time I droped a stash accidently, I was able to find it in that \nlist. I will not be able to do this again if it continues to grow at that \nrate.)\nHow can I do that?\nFurther fsck --full --unreachable also shows a lot of unreachable things \n(commits, trees, blobs). Can that be cleaned up as well?\n\nGreetings,\nDennis\n\nAgain: Please CC me, as I am not subscribed.\n"},{"id":"78959","messageId":"fa67IkKd22OcyCOfHZx_EORkS5DPZLP5IEWlE3dg-pOOdKgeIL0hpA@cipher.nrlssc.navy.mil","threadId":"13837","inReplyTo":"200806062247.42074.devurandom@gmx.net","subject":"Re: Multiple user questions","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-06-06T21:19:49Z","receivedAt":"2008-06-06T21:19:49Z","isPatch":false,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Dennis Schridde wrote:\n> I just ran into a lost stash again and thus would like to get an answer to \n> this question, which was forgotten last time:\n> (lost-found is really growing in a pace it will take me very long to find my \n> lost stash.)\n\nHow did you lose it?\n\nIf you did 'git stash drop' and then realized that you dropped the wrong stash,\nyou can apply that stash and then recreate it since 'stash drop' also prints out\nthe sha1 and 'stash apply' can use that.\n\nFor example:\n\n   # edit edit edit\n   $ git stash\n   # hmm I don't need that old stash anymore\n   $ git stash drop\n   Dropped refs/stash@{0} (5dcea62df980fa157e7755f82125dfc3bbd52ff5)\n   # whoops I didn't mean to drop _that_ stash\n   $ git stash apply 5dcea62df980fa157e7755f82125dfc3bbd52ff5\n   $ git stash\n\nOf course, that only works if you realize pretty quickly that you dropped the\nwrong stash. Also realize my example was rather simplified and the working\ndirectory may need to be prepped before reapplying the dropped stash.\n\n-brandon\n"},{"id":"78969","messageId":"200806070015.29709.devurandom@gmx.net","threadId":"13837","inReplyTo":"fa67IkKd22OcyCOfHZx_EORkS5DPZLP5IEWlE3dg-pOOdKgeIL0hpA@cipher.nrlssc.navy.mil","subject":"Re: Multiple user questions","fromName":"Dennis Schridde","fromEmail":"devurandom@gmx.net","sentAt":"2008-06-06T22:15:29Z","receivedAt":"2008-06-06T22:15:29Z","isPatch":false,"sender":{"key":"devurandom@gmx.net","avatar":null},"body":"Am Freitag, 6. Juni 2008 23:19:49 schrieben Sie:\n> Dennis Schridde wrote:\n> > I just ran into a lost stash again and thus would like to get an answer\n> > to this question, which was forgotten last time:\n> > (lost-found is really growing in a pace it will take me very long to find\n> > my lost stash.)\n>\n> How did you lose it?\n>\n> If you did 'git stash drop' and then realized that you dropped the wrong\n> stash, you can apply that stash and then recreate it since 'stash drop'\n> also prints out the sha1 and 'stash apply' can use that.\n>\n> For example:\n>\n>    # edit edit edit\n>    $ git stash\n>    # hmm I don't need that old stash anymore\n>    $ git stash drop\n>    Dropped refs/stash@{0} (5dcea62df980fa157e7755f82125dfc3bbd52ff5)\n>    # whoops I didn't mean to drop _that_ stash\n>    $ git stash apply 5dcea62df980fa157e7755f82125dfc3bbd52ff5\n>    $ git stash\n>\n> Of course, that only works if you realize pretty quickly that you dropped\n> the wrong stash. Also realize my example was rather simplified and the\n> working directory may need to be prepped before reapplying the dropped\n> stash.\nIt was indeed too late. (I assumed to have rerecorded the stash, but later \nrealised that the new stash contained only parts of the changes.)\n\nI am now using this script:\nfor commit in $(git fsck --full --lost-found | grep commit | awk '{print \n$3}') ; do\n        git show ${commit} | head -n7 | \\\n                grep \"On ${branch}:\" | grep \"${message}\" > /dev/null \\\n                && git show ${commit} | head -n7\ndone\n\nThough that list grows pretty long, so I would like to cut down the output of \nfsck-lost-found after I am sure nothing worthy is \"lost\" anymore.\n\n--Dennis\n"}]}