git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] add GIT_PATHSPEC_GLOB environment variable
Date: Wed, 19 Dec 2012 17:12:50 -0500	[thread overview]
Message-ID: <20121219221250.GA22823@sigill.intra.peff.net> (raw)
In-Reply-To: <7v7god8zz0.fsf@alter.siamese.dyndns.org>

On Wed, Dec 19, 2012 at 02:00:03PM -0800, Junio C Hamano wrote:

> > Subject: add GIT_PATHSPEC_GLOB environment variable
> 
> Seems cleanly done from a quick look.
> 
> Given that the normal mode of operation is to use globbing, I
> suspect that the names would have been more natural if the toggle
> were GIT_PATHSPEC_LITERAL and the boolean function were
> limit_pathspec_to_literal(), instead of "allow_pathspec_glob()",
> sounding as if using glob is done only upon request.
> 
> But that is a minor issue.

Yeah, I was trying to avoid the double-negation of "noglob=false" for
the default behavior. I guess calling it literal is another way of
accomplishing that, and it keeps the default at "false". I don't have a
strong preference.

> > This patch introduces an environment variable to turn all
> > pathspecs into literal strings. This makes it easy to turn
> > off the globbing behavior for a whole environment (e.g., if
> > you are serving repos via a web interface that is only going
> > to use literal programmatic pathspecs), or for a particular
> > run.
> 
> I am not sure if "web interface" is a particularly good example,
> though.  Is it unusual to imagine a Web UI that takes pathspecs from
> the user to limit its output (e.g. "diff" or "ls-tree") to those
> paths that match them?  In such a case, the user would expect their
> pathspecs to work the same way as the Git installed on their
> desktop, I would think.

Yes. If you want to provide for user-provided globbing pathspecs, then
you'd have to annotate each invocation with whether you want globbing or
not. What I was trying to illustrate was more how "gitweb" will let you
click on the "history" link for "foo" in a tree listing, resulting in a
page that is generated by calling "git rev-list foo". You would probably
not want pathspec globbing there.

> Will queue; thanks.

Do we want to change the variable name and invert the logic? Now is
probably the best time to do it.

-Peff

  reply	other threads:[~2012-12-19 22:13 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
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 [this message]
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=20121219221250.GA22823@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).