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

Re: [PATCH] log: add log.follow config option

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jul 1, 2015, 21:16 UTC
Message-ID
<vpq8uazo9y6.fsf@anie.imag.fr>
In-Reply-To
<1435777439-5002-1-git-send-email-dturner@twopensource.com>
David Turner <dturner@twopensource.com> writes:
Show 18 quoted lines
> diff --git a/builtin/log.c b/builtin/log.c
> index 8781049..11b8d82 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -31,6 +31,7 @@ static const char *default_date_mode = NULL;
>  
>  static int default_abbrev_commit;
>  static int default_show_root = 1;
> +static int default_follow = 0;
>  static int decoration_style;
>  static int decoration_given;
>  static int use_mailmap_config;
> @@ -102,6 +103,8 @@ static void cmd_log_init_defaults(struct rev_info *rev)
>  {
>  	if (fmt_pretty)
>  		get_commit_format(fmt_pretty, rev);
> +	if (default_follow)
> +		DIFF_OPT_SET(&rev->diffopt, FOLLOW_RENAMES);

Doesn't it activate --follow all the time, including when the user provides several paths?

In this case, you get this:

$ git log --follow *.c fatal: --follow requires exactly one pathspec

So activating --follow for all "git log" calls would prevent log from being used with several pathspecs.

Or, do you have a preparation patch that allows --follow with multiple pathspecs? ;-)

In any case, you have to test "git log -- path1 path2" with the option activated.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: David TurnerNext: Junio C Hamano
Message 2 of 6 in “log: add log.follow config option”
  1. log: add log.follow config optionDavid Turner, Jul 1, 2015
  2. Matthieu MoyJul 1, 2015
  3. Junio C HamanoJul 1, 2015
  4. David TurnerJul 2, 2015
  5. Matthieu MoyJul 3, 2015
  6. Junio C HamanoJul 3, 2015

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.