cg-admin-rewritehist --tree-filter revives removed files

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:42:23

I ran this on a small project:

  cg-admin-rewritehist --tree-filter ':' testbranch

Thereafter, the tree in testbranch has all files that had been removed in the 
original history. I used cg-switch testbranch to check this.

The main loop in cg-admin-rewritehist does this (among others) for each commit 
in the original history:

if [ "$filter_tree" ]; then
	git-checkout-index -f -u -a
	eval "$filter_tree"
	git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \
		xargs -0 git-update-index --add --replace --remove
	git-ls-files --others | tr '\n' '\0' | \
		xargs -0 git-update-index --add --replace --remove
fi

Appearently, once files are checked out, they stay in the working directory 
and are readded in all subsequent iterations if the current commit's tree 
does not contain them.

I'm not proficient enough to fix this problem myself, so I hope for help from 
the list.

Thanks,
-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help