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

Re: [PATCH 2/2] filter-branch: subdirectory filter needs --full-history

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 9, 2007, 02:40 UTC
Message-ID
<alpine.LFD.0.98.0706081822500.4205@woody.linux-foundation.org>
In-Reply-To
<200706082328.50923.johannes.sixt@telecom.at>
On Fri, 8 Jun 2007, Johannes Sixt wrote:
Show 5 quoted lines
>
> When two branches are merged that modify a subdirectory (possibly in
> different intermediate steps) such that both end up identical, then
> rev-list chooses only one branch. But when we filter history, we want to
> keep both branches. Therefore, we must use --full-history.
--full-history needs to be fixed up for this, I think.

It leaves *too* many merges around, in particular, it leaves merges where both parents end up (after simplification) being related to each other.

As an example, do this:
	mkdir hello
	cd hello/
	git init
	echo "Initial state" > file-A
	echo "Another initial state" > file-B
	git add file-A file-B
	git commit -m "Initial commit"
	echo "Add a line" >> file-A
	echo "Add another line" >> file-B
	git commit -a -m "On master branch"
	git checkout -b another HEAD^
	echo "Add a line" >> file-A
	git commit -a -m "On another branch"
	git checkout master
	git merge another
and then do
	gitk --full-history file-B

and notice what happens.. There was no actual developmet on branch "another", so all the commits went away, but it left the merge (because that's how --full-history works), which has now become pointless.

So you should do a "merge cleanup" phase after running --full-history.
			Linus
Previous: Johannes SixtNext: Junio C Hamano
Message 2 of 3 in “filter-branch: subdirectory filter needs --full-history”
  1. 2/2 filter-branch: subdirectory filter needs --full-historyJohannes Sixt, Jun 8, 2007
  2. Linus TorvaldsJun 9, 2007
  3. Junio C HamanoJun 13, 2007

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.