From: Jeff King <peff@peff.net>
To: Jim Pryor <dubiousjim@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: [PATCH 0/3] handling pathspec magic with --follow
Date: Thu, 1 Jun 2023 13:37:24 -0400 [thread overview]
Message-ID: <20230601173724.GA4158369@coredump.intra.peff.net> (raw)
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(-)
next prev parent reply other threads:[~2023-06-01 17:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 13:53 git 2.40.1 tree-diff crashes with (glob) magic on pathspecs Jim Pryor
2023-05-27 17:39 ` Jeff King
2023-05-27 19:00 ` Jim Pryor
2023-06-01 17:37 ` Jeff King [this message]
2023-06-01 17:38 ` [PATCH 1/3] pathspec: factor out magic-to-name function Jeff King
2023-06-01 17:41 ` [PATCH 2/3] diff: factor out --follow pathspec check Jeff King
2023-06-01 17:43 ` [PATCH 3/3] diff: detect pathspec magic not supported by --follow Jeff King
2023-06-02 7:27 ` Junio C Hamano
2023-06-15 7:26 ` Jeff King
2023-06-15 19:00 ` Junio C Hamano
2023-06-01 5:38 ` git 2.40.1 tree-diff crashes with (glob) magic on pathspecs Junio C Hamano
2023-06-01 13:30 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230601173724.GA4158369@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=dubiousjim@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).