git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "Wincent Colaiuta" <win@wincent.com>,
	"Mislav Marohnić" <mislav.marohnic@gmail.com>
Subject: Re: [PATCH] add--interactive: do not expand pathspecs with ls-files
Date: Tue, 14 Mar 2017 15:03:34 -0700	[thread overview]
Message-ID: <xmqqd1djh5xl.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170314163024.et2cp5e3imrrrf7k@sigill.intra.peff.net> (Jeff King's message of "Tue, 14 Mar 2017 12:30:24 -0400")

Jeff King <peff@peff.net> writes:

> We can improve this by skipping "ls-files" completely, and
> just feeding the original pathspecs to the diff commands.
> This solution was discussed in 2010:
>
>   http://public-inbox.org/git/20100105041438.GB12574@coredump.intra.peff.net/
>
> but at the time the diff code's pathspecs were more
> primitive than those used by ls-files (e.g., they did not
> support globs). Making the change would have caused a
> user-visible regression, so we didn't.

Heh.  The change and the reasoning are both obviously correct, but
how did you find this?  Do you have a pile of "old patches that
should be resurrected when time is right" and this was picked out of
it, or did you see somebody else hit the same thing recently and
then went back to the archive?

>   b. If the repository contains filenames with literal wildcard
>      characters (e.g., "foo*"), the original code expanded
>      them via "ls-files" and then fed those wildcard names
>      to "diff-index", which would have treated them as
>      wildcards. This was a bug, which is now fixed (though
>      unless you really go through some contortions with
>      ":(literal)", it's likely that your original pathspec
>      would match whatever the accidentally-expanded wildcard
>      would anyway).
>
>      So this takes us one step closer to working correctly
>      with files whose names contain wildcard characters, but
>      it's likely that others remain (e.g., if "git add -i"
>      feeds the selected paths to "git add").

We didn't run with --literal-pathspecs which was a bug, but I
suspect that it didn't exist back then ;-).

  parent reply	other threads:[~2017-03-14 22:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 16:30 [PATCH] add--interactive: do not expand pathspecs with ls-files Jeff King
2017-03-14 16:31 ` Jeff King
2017-03-14 17:25 ` Brandon Williams
2017-03-14 17:31   ` Jeff King
2017-03-14 22:03 ` Junio C Hamano [this message]
2017-03-14 22:09   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqd1djh5xl.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mislav.marohnic@gmail.com \
    --cc=peff@peff.net \
    --cc=win@wincent.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).