{"thread":{"id":"3851","subject":"cg-admin-rewritehist --tree-filter revives removed files","startedAt":"2006-04-11T19:26:39Z","lastAt":"2006-04-11T19:26:39Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18569","messageId":"200604112126.39365.johannes.sixt@telecom.at","threadId":"3851","inReplyTo":null,"subject":"cg-admin-rewritehist --tree-filter revives removed files","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2006-04-11T19:26:39Z","receivedAt":"2006-04-11T19:26:39Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"I ran this on a small project:\n\n  cg-admin-rewritehist --tree-filter ':' testbranch\n\nThereafter, the tree in testbranch has all files that had been removed in the \noriginal history. I used cg-switch testbranch to check this.\n\nThe main loop in cg-admin-rewritehist does this (among others) for each commit \nin the original history:\n\nif [ \"$filter_tree\" ]; then\n\tgit-checkout-index -f -u -a\n\teval \"$filter_tree\"\n\tgit-diff-index -r $commit | cut -f 2- | tr '\\n' '\\0' | \\\n\t\txargs -0 git-update-index --add --replace --remove\n\tgit-ls-files --others | tr '\\n' '\\0' | \\\n\t\txargs -0 git-update-index --add --replace --remove\nfi\n\nAppearently, once files are checked out, they stay in the working directory \nand are readded in all subsequent iterations if the current commit's tree \ndoes not contain them.\n\nI'm not proficient enough to fix this problem myself, so I hope for help from \nthe list.\n\nThanks,\n-- Hannes\n"}]}