git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Apr 11, 2006, 19:26 UTC
Message-ID
<200604112126.39365.johannes.sixt@telecom.at>
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

Message 1 of 1 in “cg-admin-rewritehist --tree-filter revives removed files”
  1. Johannes SixtApr 11, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.