{"thread":{"id":"21473","subject":"How to ensure a word has been removed from repository?","startedAt":"2009-11-04T02:12:49Z","lastAt":"2009-11-04T03:35:55Z","messageCount":3,"participants":["Patrick Higgins","Nicolas Pitre","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126702","messageId":"6fb3af8e0911031812j54a9b698xca9f5301ac07442a@mail.gmail.com","threadId":"21473","inReplyTo":null,"subject":"How to ensure a word has been removed from repository?","fromName":"Patrick Higgins","fromEmail":"patrick.allen.higgins@gmail.com","sentAt":"2009-11-04T02:12:49Z","receivedAt":"2009-11-04T02:12:49Z","isPatch":false,"sender":{"key":"patrick.allen.higgins@gmail.com","avatar":null},"body":"Hi all,\n\nI just completed a series of filter-branch commands to remove a couple\nof sensitive words from a repository before I publish it. The words\nwere found in commit messages, directory names, file contents, and\nvarious other places (kind of weird, I know). I believe I have removed\nthem all, but I would like to double check but don't know how.\n\nGiven that much of the repository is stored in compressed packs, I\ncan't just use grep to look for the words. To get around this, I've\nunpacked the objects, use a Perl script (filtinf example script) to\ndecompress them and then use grep (this has proven to be quite slow).\n\nIs that going to find every possible occurrence if all the relevant\nfiles are plain text?\n\nIs there an easier way to search the repository? The way I'm doing it\nhas required some awfully deep knowledge to expire and prune\neverything. I feel like I must be missing something.\n\nThanks,\nPatrick\n"},{"id":"126705","messageId":"alpine.LFD.2.00.0911032138400.13333@xanadu.home","threadId":"21473","inReplyTo":"6fb3af8e0911031812j54a9b698xca9f5301ac07442a@mail.gmail.com","subject":"Re: How to ensure a word has been removed from repository?","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2009-11-04T02:49:07Z","receivedAt":"2009-11-04T02:49:07Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 3 Nov 2009, Patrick Higgins wrote:\n\n> Hi all,\n> \n> I just completed a series of filter-branch commands to remove a couple\n> of sensitive words from a repository before I publish it. The words\n> were found in commit messages, directory names, file contents, and\n> various other places (kind of weird, I know). I believe I have removed\n> them all, but I would like to double check but don't know how.\n> \n> Given that much of the repository is stored in compressed packs, I\n> can't just use grep to look for the words. To get around this, I've\n> unpacked the objects, use a Perl script (filtinf example script) to\n> decompress them and then use grep (this has proven to be quite slow).\n> \n> Is that going to find every possible occurrence if all the relevant\n> files are plain text?\n> \n> Is there an easier way to search the repository? The way I'm doing it\n> has required some awfully deep knowledge to expire and prune\n> everything. I feel like I must be missing something.\n\nAn easy way to look for the presence of a particular string in all the \nrepository data is:\n\n\tgit rev-list --all --objects | cut -c -40 | \\\n\t\tgit cat-file --batch | grep <string>\n\nAlternatively you can use:\n\n\tgit fast-export --all --signed-tag=verbatim | grep <string>\n\n\nNicolas\n"},{"id":"126710","messageId":"2e24e5b90911031935m2a0b9f70xd3d7975eea334d9e@mail.gmail.com","threadId":"21473","inReplyTo":"6fb3af8e0911031812j54a9b698xca9f5301ac07442a@mail.gmail.com","subject":"Re: How to ensure a word has been removed from repository?","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-11-04T03:35:55Z","receivedAt":"2009-11-04T03:35:55Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Wed, Nov 4, 2009 at 7:42 AM, Patrick Higgins\n<patrick.allen.higgins@gmail.com> wrote:\n\n> Given that much of the repository is stored in compressed packs, I\n> can't just use grep to look for the words. To get around this, I've\n> unpacked the objects, use a Perl script (filtinf example script) to\n> decompress them and then use grep (this has proven to be quite slow).\n\n> Is that going to find every possible occurrence if all the relevant\n> files are plain text?\n\n> Is there an easier way to search the repository? The way I'm doing it\n> has required some awfully deep knowledge to expire and prune\n> everything. I feel like I must be missing something.\n\nInstead of expire and prune, I'd clone the repo to some other\nlocation, and search in that clone.  You'd still need the commands\nthat Nicolas gave in his reply but you wouldn't get any false\npositivies from missing some reflog or something kept a ref alive.\n"}]}