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

[PATCH 0/3] handling pathspec magic with --follow

From
Jeff King <peff@peff.net>
Date
Jun 1, 2023, 17:37 UTC
Message-ID
<20230601173724.GA4158369@coredump.intra.peff.net>
In-Reply-To
<51012e79-c6ce-41dd-9755-960e065214ef@app.fastmail.com>
On Sat, May 27, 2023 at 09:00:27PM +0200, Jim Pryor wrote:
> Confirmed I have log.follow = true, and also GIT_NOGLOB_PATHSPECS set,
> thus the explicit `(glob)` magic.

OK, all of that makes sense. The same problem hits ":(icase)" and other pathspec magic, too. So talking about :(glob) too much is kind of a red herring, anyway.

> I'd be happy with --follow not working with the wildcard pathspecs,
> but with the crash avoided.

Here's a series that I think should improve things for you. For an explicit --follow, it finds the forbidden magic sooner (which gives us a nice error message instead of the BUG()), and for log.follow, it avoids follow-mode when forbidden pathspecs are used rather than enabling it and then complaining.

The interesting bits are in the third patch. The other two are preparatory.

  [1/3]: pathspec: factor out magic-to-name function
  [2/3]: diff: factor out --follow pathspec check
  [3/3]: diff: detect pathspec magic not supported by --follow
 builtin/log.c  |  2 +-
 diff.c         | 29 +++++++++++++++++++++++++++--
 diff.h         |  7 +++++++
 pathspec.c     | 19 ++++++++++++-------
 pathspec.h     |  8 ++++++++
 t/t4202-log.sh | 15 +++++++++++++++
 6 files changed, 70 insertions(+), 10 deletions(-)
Previous: Jim PryorNext: Jeff King
Message 4 of 12 in “git 2.40.1 tree-diff crashes with (glob) magic on pathspecs”
  1. Jim PryorMay 27, 2023
  2. Jeff KingMay 27, 2023
  3. Jim PryorMay 27, 2023
  4. 0/3 handling pathspec magic with --followJeff King, Jun 1, 2023
  5. 1/3 pathspec: factor out magic-to-name functionJeff King, Jun 1, 2023
  6. 2/3 diff: factor out --follow pathspec checkJeff King, Jun 1, 2023
  7. 3/3 diff: detect pathspec magic not supported by --followJeff King, Jun 1, 2023
  8. Junio C HamanoJun 2, 2023
  9. Jeff KingJun 15, 2023
  10. Junio C HamanoJun 15, 2023
  11. Junio C HamanoJun 1, 2023
  12. Jeff KingJun 1, 2023

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.