From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] add core.pathspecGlob config option
Date: Wed, 19 Dec 2012 16:09:19 -0500 [thread overview]
Message-ID: <20121219210919.GA11894@sigill.intra.peff.net> (raw)
In-Reply-To: <7vk3sd930z.fsf@alter.siamese.dyndns.org>
On Wed, Dec 19, 2012 at 12:54:04PM -0800, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > ... doing ":(noglob)" right would mean converting
> > the whole codebase to use "struct pathspec", as the usual
> > "const char **pathspec" cannot represent extra per-item
> > flags.
>
> As that is the longer-term direction we would want to go, I'd rather
> not to take the approach in this patch for introducing user-facing
> support of literal pathspecs.
>
> Having said that, even when we have the ':(noglob)' magic pathspec
> support, it would make sense to introduce a command line option to
> make it easier for scripted Porcelains that call plumbing commands
> to pass literal pathspecs (i.e. they know exactly what paths they
> want to operate, not what patterns the paths they want to operate
> would match).
Right, that is my use case. Even once ":(noglob)" exists, it will still
be much simpler for me to use a single option, since I would never have
mixed patterns and literal paths (and I suspect most use cases that
would care about the distinction would be in the same boat). And that is
what led me to submit this at all, as it is not just "well, it is a hack
until :(noglob) works", but "this is not as fine a granularity as
:(noglob), but it better matches what callers want".
> I do not think configuration variable makes much sense (unless you are
> thinking "git -c core.literalpathspec=true" as that command line
> option).
The configuration variable is much more convenient for me, because
otherwise I have to instrument every call to git with a "--no-glob"
option. Because I have a very restricted environment, and happen to know
that globs will _never_ be useful on my repos (or, say, on commands run
by a particular user who has this in their ~/.gitconfig), it makes sense
to just turn off the feature with one switch.
And my thinking was that for people who are not in such a restricted
environment, "git -c core.pathspecglob=false" could serve as that
command-line option, as you mentioned.
It's perhaps a better match to make it an environment variable. Then it
is tied to a particular flow of execution, rather than having it be a
property of a system, user, or repo (which is what config does). So for
my restricted environment, it would be sufficient for me to set the
environment variable for the user who runs the scripts. And people who
want a command-line option can set it via the shell, or we can provide
"git --no-pathspec-glob" to set it.
-Peff
next prev parent reply other threads:[~2012-12-19 21:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 20:34 [PATCH] add core.pathspecGlob config option Jeff King
2012-12-19 20:54 ` Junio C Hamano
2012-12-19 21:09 ` Jeff King [this message]
2012-12-19 21:50 ` [PATCH] add GIT_PATHSPEC_GLOB environment variable Jeff King
2012-12-19 22:00 ` Junio C Hamano
2012-12-19 22:12 ` Jeff King
2012-12-19 22:16 ` Junio C Hamano
2012-12-19 22:20 ` Jeff King
2012-12-19 22:37 ` Jeff King
2012-12-19 21:30 ` [PATCH] add core.pathspecGlob config option Junio C Hamano
2012-12-19 21:45 ` Jeff King
2012-12-20 1:28 ` Nguyen Thai Ngoc Duy
2012-12-20 3:13 ` Jeff King
2012-12-20 3:51 ` Junio C Hamano
2012-12-20 3:55 ` Jeff King
2012-12-20 4:06 ` Jeff King
2012-12-20 4:11 ` Jeff King
2012-12-20 5:26 ` Junio C Hamano
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=20121219210919.GA11894@sigill.intra.peff.net \
--to=peff@peff.net \
--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 NNTP newsgroup(s).