threads / discuss / 3851

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

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

## tl;dr

One message between Apr 11, 2006 and Apr 11, 2006.

replies: 0people: 1as markdown or json

Johannes Sixt· Apr 11, 2006, 19:26 UTC · lore
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

← back to recent threads