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

Re: Re: git log -M -- filename is not working?

From
Eli Barzilay <eli@barzilay.org>
Date
May 8, 2010, 05:12 UTC
Message-ID
<19428.62170.654092.308682@winooski.ccs.neu.edu>
In-Reply-To
<20100508044434.GC14998@coredump.intra.peff.net>
On May  8, Jeff King wrote:
Show 7 quoted lines
> On Fri, May 07, 2010 at 02:37:09PM -0400, Eli Barzilay wrote:
> 
> > BTW, I've had at least 4 people now who got confused by this.  Is
> > there any use for -M/-C without --follow?  In any case, it will be
> > very helpful if the -M/-C descriptions said "see also --follow".
> 
> Yes, it detects renames when doing diffs.

OK, so just to clear this up: -C and -M (and --find-copies-harder) are for `diff', and --follow is for `log' with a single file (and each will pass it on to the other)?

> Documentation patch is below.

Thanks! (It would also be nice to mention it in -C, but not critical since it's right after -M.)

Show 5 quoted lines
> > Also, is there a way to set this as the default for `git log'?
> 
> If you mean --follow, then no. Nor would you probably want to,
> because the --follow mechanism (as currently implemented) is pretty
> restricted.  It can only take a single path currently.
Well, the "algorithm" I used was probably one that is very popular:
* use `git log some-file' with something that got renamed recently
* be horrified that all history is gone
* remember something vague about git detecting renames => go look at
  the man page
* Find -M, add it, try it, still doesn't work
* Go back to scanning the man page, repeat
* At the end I end up with:
    -C -M --find-copies-harder --follow
So if there was some single
  --do-whatever-you-can-as-much-as-you-can-to-find-all-renames

option that would just turn everything on for all commands (eg, -M and -C and --find-copies harder for diffs, --follow for log for a single file, and in some future when it's implemented, --follow for multiple files and directories), I'd happily jump on that. For any command that can accept it. If there was a way to make it the default, I'd love to turn it on.

Even with the chain of more flags with descriptions that sound like they're trying to scare me away by promising that my machine will work for a REALLY LONG TIME, I'd still want to turn it on -- if it got something slower I sure didn't notice it so far, and that's on a real repository which is not that small (but with git's reputation I won't be surprised if "slower" means that I had to way a whole extra 20ms for an answer...). If something would really take too long, as in me sitting any waiting for an answer, *then* I can try to remove that and see if I ran into some of the horrible edge cases...

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Previous: Jeff KingNext: Jeff King
Message 8 of 26 in “git log -M -- filename is not working?”
  1. Eugene SajineMay 7, 2010
  2. Jacob HelwigMay 7, 2010
  3. Eugene SajineMay 7, 2010
  4. Eli BarzilayMay 7, 2010
  5. Matthieu MoyMay 7, 2010
  6. Jakub NarebskiMay 7, 2010
  7. Jeff KingMay 8, 2010
  8. Eli BarzilayMay 8, 2010
  9. Jeff KingMay 8, 2010
  10. Junio C HamanoMay 8, 2010
  11. Eli BarzilayMay 8, 2010
  12. Jeff KingMay 12, 2010
  13. Eli BarzilayMay 12, 2010
  14. Jeff KingMay 12, 2010
  15. Jeff KingMay 12, 2010
  16. Eli BarzilayMay 12, 2010
  17. Bo YangMay 12, 2010
  18. Jeff KingMay 12, 2010
  19. Bo YangMay 13, 2010
  20. Eli BarzilayMay 13, 2010
  21. Jeff KingMay 14, 2010
  22. Eli BarzilayMay 14, 2010
  23. Bo YangMay 12, 2010
  24. Jeff KingMay 12, 2010
  25. Eli BarzilayMay 12, 2010
  26. Bo YangMay 12, 2010

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.