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

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

From
Jeff King <peff@peff.net>
Date
May 12, 2010, 11:38 UTC
Message-ID
<20100512113855.GB23847@coredump.intra.peff.net>
In-Reply-To
<19429.3589.823244.270582@winooski.ccs.neu.edu>
On Sat, May 08, 2010 at 03:08:53AM -0400, Eli Barzilay wrote:
Show 7 quoted lines
> So I think that it would really help if (1) the diff options in the
> git-log man page move to after its own options, and (2) they appeared
> after a title saying that these are the diff options, (3) `--follow'
> moves up before the few preceding options that seem to me less
> important.  To clarify, I added a simple patch to the end of this
> message.  (`git-format-patch' has the same thing, but there it looks
> more sensible to leave it as is.)

I have no opinion on moving --follow around, but I definitely agree that more clearly marking the diff-options (and including them after revision traversal options) is much better.

Show 13 quoted lines
> How about these options:
> 
>   git config log.follow if-single-file
>     makes it use --follow only when there's a single file path given,
>     ignoring it otherwise (with no confusion about it now)
> 
>   git config log.follow if-possible
>     makes it do the same, but might also do it for more cases if/when
>     they become available (so this is the "do the best you can"
>     option)
> 
>   git config log.follow true
>     invalid until it is always possible to use --follow

I'm not thrilled with it. It still leaves the confusing behavior, but because we forced the user to pick the confusing behavior, we get to claim it is their fault. So while we may be guilt-free, I'm not happy with an option that produces such confusing behavior.

I really wonder if it would be that hard to just fix the code to follow several files. It shouldn't be conceptually different. When any file matching the pathspec we're following has a creation event going from the parent to the commit in question, then we would do rename detection for that file (and any others created in the same commit). Any detected sources get added to the pathspec.

Show 9 quoted lines
> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> index fb184ba..6bc7064 100644
> --- a/Documentation/git-log.txt
> +++ b/Documentation/git-log.txt
> @@ -24,7 +24,6 @@ OPTIONS
>  -------
>  
>  :git-log: 1
> -include::diff-options.txt[]

This ":git-log: 1" magic should probably follow the include. It sets up an attribute for diff-options.txt to conditionally include some log-specific bits.

-Peff
Previous: Eli BarzilayNext: Eli Barzilay
Message 12 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.