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

Re: Finally implement "git log --follow"

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jul 4, 2007, 13:21 UTC
Message-ID
<e5bfff550707040621o1339de98o62f10fdfe4ff0650@mail.gmail.com>
In-Reply-To
<alpine.LFD.0.98.0706191425240.3593@woody.linux-foundation.org>
On 6/19/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 12 quoted lines
>
>  - the commit simplification isn't done. So you cannot do "--follow"
>    together with somethign that wants a contiguous history (like gitk) and
>    uses "--parents".
>
>    This is pretty fundamental. The commit simplification is a separate
>    phase over the (non-linear!) commit space, and the "git log --follow"
>    logic is really a *different* logic over the _linear_ space (namely the
>    streaming "log output" space).
>
>    Two totally different things, in other words. And not compatible.
>
Of course I need exactly that!

Really don't want to thrash away the nice qgit graph, also in file histories, and at the same time I really like that '--follow' feature, so....

I've just started to hit the wall against the scary revision.c and friends, my goal is to find a solution (trick/hack) to get the renames also with --parents.

First of all I have commented out:
		/* Can't prune commits with rename following: the paths change.. */
// 		if (!revs->diffopt.follow_renames)
			revs->prune_fn = try_to_simplify_commit;

So I've see that with --parents set try_to_simplify_commit() does his job and when the processing arrives in diff_tree_sha1() it is already pruned, so also if the check

if (opt->follow_renames && diff_might_be_rename())

is true and the following try_to_follow_renames() is called, no alternative tree is found.

My idea, after have understood a little bit better how it works, is to 'resurrect' the pruned info before calling try_to_follow_renames(). To do this I was thinking of saving a pointer to some pruned tree information in try_to_simplify_commit() and in case use that pointer after in diff_tree_sha1() when needed.

Nightmares??? Perhaps, I'm just starting with this difficult piece of code and probably (90%) I will give up before the end and very probably (99%) all said before is just brain dead, but...anyway I have to start from somewhere.

Marco
Previous: Linus TorvaldsNext: Marco Costalba
Message 3 of 11 in “Finally implement "git log --follow"”
  1. Linus TorvaldsJun 19, 2007
  2. Linus TorvaldsJun 19, 2007
  3. Marco CostalbaJul 4, 2007
  4. Marco CostalbaJun 20, 2007
  5. Linus TorvaldsJun 20, 2007
  6. Marco CostalbaJun 21, 2007
  7. Linus TorvaldsJun 21, 2007
  8. Johannes SchindelinJun 21, 2007
  9. Linus TorvaldsJun 21, 2007
  10. Linus TorvaldsJun 21, 2007
  11. Junio C HamanoJun 21, 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.