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

Re: Git log can not show history before rename

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 30, 2009, 17:17 UTC
Message-ID
<alpine.LFD.2.00.0901300910580.3150@localhost.localdomain>
In-Reply-To
<1976ea660901300429i6d9b3594m91222314c284d184@mail.gmail.com>
On Fri, 30 Jan 2009, Frank Li wrote:
>
> Does it conflict with --parents?
Yes. --follow and --parents do not play well together.

That's simply because --follow is a total hack, meant to just satisfy ex-SVN users who never knew anything about things like parenthood or nice revision graphs anyway.

It's not totally fundamental, but the current implementation of "--follow" is really a quick preprocessing thing bolted onto the revision walking logic, rather than beign anything really integral.

If you want --follow to really work together with --parents (and to do the right thing wrt merges etc - different renames coming in through different branches), you'd really have to rewrite the whole --follow logic.

One approach is to use --follow as the quick hack it is - and then when you see "oh, file X was renamed from file Y", and you want to see the nice full history, you go back to the native git model (which is not --follow), which is based on pathname pattherns, and then do

	gitk -- X Y

to see the history of _both_ names, and now the rename will show up properly (and now you'll get proper parenthood because you're no longer using the hackish --follow thing).

If somebody wants to do a more intelligent --follow, I can only applaud, but I'm personally not likely to look into it.

			Linus
Previous: Jeff KingNext: Linus Torvalds
Message 8 of 9 in “Git log can not show history before rename”
  1. Frank LiJan 30, 2009
  2. Santi BéjarJan 30, 2009
  3. Jakub NarebskiJan 30, 2009
  4. Frank LiJan 30, 2009
  5. Santi BéjarJan 30, 2009
  6. Thomas RastJan 30, 2009
  7. Jeff KingJan 31, 2009
  8. Linus TorvaldsJan 30, 2009
  9. Linus TorvaldsJan 30, 2009

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.