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

Re: Formatting options are ignored when tracking functions

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 23, 2021, 19:28 UTC
Message-ID
<60aaacdb6a7da_53920893@natae.notmuch>
In-Reply-To
<d801fe76-f40d-91ef-653e-925aba0fbdf4@gmail.com>
Philippe Blain wrote:
Show 6 quoted lines
> Le 2021-05-23 à 14:11, Junio C Hamano a écrit :
> I do not have a clear opinion on a migration path; if consensus can be reached
> that not implying '--patch' is a better behaviour, then changing the behaviour
> would be OK. If some people use scripts that parse 'git log -L' ouptut expecting
> that '-p' is implied, I would expect it's pretty easy to notice the breakage and
> add the now-required switch... but I'll let others be the judge of that.

I agree; it should be easy to notice the breakage. I don't think any migration path would help, we should just switch. But the git project has a tendency to worry about hypothetical users.

This is the only thing I can imagine doing for those users:
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -262,8 +262,13 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
                load_ref_decorations(&decoration_filter, decoration_style);
        }
 
-       if (rev->line_level_traverse)
+       if (rev->line_level_traverse) {
+               if (!(rev->diffopt.output_format & DIFF_FORMAT_NO_OUTPUT) && !rev->diff) {
+                       advise("In the future you will need to specify --patch. Hit Enter to proceed.");
+                       getc(stdin);
+               }
                line_log_init(rev, line_cb.prefix, &line_cb.args);
+       }
 
        setup_pager();
 }
-- 
Felipe Contreras
Previous: Philippe Blain
Message 5 of 5 in “Re: Formatting options are ignored when tracking functions”
  1. Philippe BlainMay 22, 2021
  2. Bagas SanjayaMay 22, 2021
  3. Junio C HamanoMay 23, 2021
  4. Philippe BlainMay 23, 2021
  5. Felipe ContrerasMay 23, 2021

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.