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

Re: Finally implement "git log --follow"

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 19, 2007, 21:35 UTC
Message-ID
<alpine.LFD.0.98.0706191425240.3593@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.98.0706191358180.3593@woody.linux-foundation.org>
On Tue, 19 Jun 2007, Linus Torvalds wrote:
Show 7 quoted lines
> 
> People who want to improve on it should get rid of the memory leak I 
> introduced - I decided to not bother cleaning up the whole rename diff 
> queue, I just reset it. I'm lazy, and I'm a *man*. I do the rough manly 
> stuff, others can clean up after me.
> 
> *Burp*. That hit the spot. *Scratch*

On that note, if people want to decide that "git log" should *default* to follow when one filename is given, that's ok by me. A few warnings:

 - You should only do it for the "single file" case, and that's very
   *different* from the "single pattern" case. I often do "git log" on a 
   single directory, and that had better not start doing any "filename 
   following" by default.
   So before turning on "follow" automatically, it should be checked that 
   that exact file exists right now (might be as simplistic as just doing 
   a "lstat()" and verifying that it's a file or symlink in the current 
   working tree)
 - 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.

So if we want to turn on "follow" by default, then I'm certainly ok with it, but it needs to be done with care. so I'd almost suggest just adding an alias instead, aka

	git config alias.follow 'log --follow'
and then doing
	git follow filename
rather than changing the behaviour of "git log" itself.
			Linus
Previous: Linus TorvaldsNext: Marco Costalba
Message 2 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.