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

Re: Segfault in git when using git logs

From
Jeff King <peff@peff.net>
Date
Nov 3, 2020, 18:57 UTC
Message-ID
<20201103185711.GA461461@coredump.intra.peff.net>
In-Reply-To
<xmqq361qs31a.fsf@gitster.c.googlers.com>
On Tue, Nov 03, 2020 at 10:34:09AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> > On our side, I don't think it would be _wrong_ to catch and disallow the
> > combination. But it may be nicer to them if we continue to quietly
> > ignore --follow and the pathspec in that case, for working with older
> > versions. (OTOH, if I understand correctly they're segfaulting every
> > time VS Code is used with v2.29 now, so they may have to accept it as an
> > urgent fix anyway).
> 
> So something like this won't harm VS Code more than we currently do,
> while telling users what is wrong with their command line?

Yeah, I was wondering if we'd want the patch you sent, or if we should turn those die() calls into warning() and disable the flags up front.

> We may still want the "silently disable follow" at low-level
> protection, but that does not give feedback why the end-user option
> is silently ignored, so...

I'd be just as happy to leave it out, if we think it isn't triggerable. The segfault would let people know we missed a spot. ;)

Show 11 quoted lines
> diff --git c/builtin/log.c w/builtin/log.c
> index 9f939e6cdf..8811084f02 100644
> --- c/builtin/log.c
> +++ w/builtin/log.c
> @@ -206,6 +206,13 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
>  	if (argc > 1)
>  		die(_("unrecognized argument: %s"), argv[1]);
>  
> +	if (rev->line_level_traverse) {
> +		if (rev->diffopt.filter)
> +			die(_("-L<range>:<file> cannot be used with pathspec"));
Should this be checking rev->diffopt.pathspec.nr?

I could well believe that --diff-filter=A does not work with "-L" either, but that is a separate story.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 23 in “Segfault in git when using git logs”
  1. Sathyajith BhatNov 2, 2020
  2. Jeff KingNov 2, 2020
  3. Junio C HamanoNov 2, 2020
  4. SZEDER GáborNov 3, 2020
  5. Christian CouderNov 3, 2020
  6. Elijah NewrenNov 3, 2020
  7. Jeff KingNov 3, 2020
  8. Junio C HamanoNov 3, 2020
  9. Jeff KingNov 3, 2020
  10. Junio C HamanoNov 3, 2020
  11. Jeff KingNov 4, 2020
  12. Junio C HamanoNov 4, 2020
  13. Re*: Segfault in git when using git logsJunio C Hamano, Nov 4, 2020
  14. Jeff KingNov 4, 2020
  15. Junio C HamanoNov 4, 2020
  16. log: diagnose -L used with pathspec as an errorJunio C Hamano, Nov 4, 2020
  17. Jeff KingNov 4, 2020
  18. Derrick StoleeNov 3, 2020
  19. Sathyajith BhatNov 3, 2020
  20. Jeff KingNov 3, 2020
  21. Derrick StoleeNov 3, 2020
  22. Derrick StoleeNov 3, 2020
  23. Sathyajith BhatNov 4, 2020

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.