{"thread":{"id":"11967","subject":"git log -S doesn't search stash WIPs","startedAt":"2008-02-08T10:46:08Z","lastAt":"2008-02-09T15:18:51Z","messageCount":3,"participants":["Jonathan del Strother","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"67928","messageId":"57518fd10802080246p4a929b62tc6e260a16d3587@mail.gmail.com","threadId":"11967","inReplyTo":null,"subject":"git log -S doesn't search stash WIPs","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2008-02-08T10:46:08Z","receivedAt":"2008-02-08T10:46:08Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"\"git log --all -Sfoo\" doesn't find strings introduced in stash WIP\ncommits, only the stash index.  That is, if I do :\n\n$ echo foo >> file\n$ git add file\n$ echo bar >> file\n$ git stash\nSaved working directory and index state \"WIP on master: 00495fc... initial\"\n(To restore them type \"git stash apply\")\nHEAD is now at 00495fc... initial\n$ git log --all -Sfoo\ncommit a8834ce80ebdf84e6579280c1fc75cdb7b4ac7c9\nAuthor: Jonathan del Strother <me@here.com>\nDate:   Fri Feb 8 10:43:44 2008 +0000\n\n    index on master: 00495fc... initial\n$ git log --all -Sbar\n<this space intentionally left blank>\n\n\nIs this intentional?  Am I missing some git-log option that would\nallow me to search the stash WIPs?\n"},{"id":"67938","messageId":"alpine.LSU.1.00.0802081208580.11591@racer.site","threadId":"11967","inReplyTo":"57518fd10802080246p4a929b62tc6e260a16d3587@mail.gmail.com","subject":"Re: git log -S doesn't search stash WIPs","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-02-08T12:18:30Z","receivedAt":"2008-02-08T12:18:30Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 8 Feb 2008, Jonathan del Strother wrote:\n\n> \"git log --all -Sfoo\" doesn't find strings introduced in stash WIP\n> commits, only the stash index.\n\nIt is a little unfortunate that a stash will do this:\n\nHEAD ------- stash\n    \\       /\n      index\n\nIn other words, the index will be \"committed\" as a regular commit, but the \nworking directory will actually be a \"merge commit\".\n\nSo you need to add \"--cc\" to see the commit.\n\nFurther, the stash is not just a branch.  The stash is actually a stack of \nreflogs.  So could you try again, with\n\n\t$ git log --cc -Sfoo --walk-reflogs stash\n\n?\n\nHth,\nDscho\n"},{"id":"68092","messageId":"57518fd10802090718w2ab705aeg6cb1c531666d52a2@mail.gmail.com","threadId":"11967","inReplyTo":"alpine.LSU.1.00.0802081208580.11591@racer.site","subject":"Re: git log -S doesn't search stash WIPs","fromName":"Jonathan del Strother","fromEmail":"maillist@steelskies.com","sentAt":"2008-02-09T15:18:51Z","receivedAt":"2008-02-09T15:18:51Z","isPatch":false,"sender":{"key":"jon.delstrother@bestbefore.tv","avatar":"https://gravatar.com/avatar/754e21ab701c00e2d21fc261187254c34b2a1c0b959d9ee5be1a295990be3081?d=mp&s=160"},"body":"On Feb 8, 2008 12:18 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Fri, 8 Feb 2008, Jonathan del Strother wrote:\n>\n> > \"git log --all -Sfoo\" doesn't find strings introduced in stash WIP\n> > commits, only the stash index.\n>\n> It is a little unfortunate that a stash will do this:\n>\n> HEAD ------- stash\n>     \\       /\n>       index\n>\n> In other words, the index will be \"committed\" as a regular commit, but the\n> working directory will actually be a \"merge commit\".\n>\n> So you need to add \"--cc\" to see the commit.\n>\n> Further, the stash is not just a branch.  The stash is actually a stack of\n> reflogs.  So could you try again, with\n>\n>         $ git log --cc -Sfoo --walk-reflogs stash\n\n\nHmmm, I'm a little fuzzy on why --cc helps, though it looks like\neither or both of --cc and --walk-reflogs will do the trick.\nThanks for the help\nJon\n"}]}