From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: James <rouzier@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] clean: new option --exclude-from
Date: Sat, 05 Dec 2015 19:51:03 -0800 [thread overview]
Message-ID: <xmqqr3j0nsk8.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20151202175144.GA18550@sigill.intra.peff.net> (Jeff King's message of "Wed, 2 Dec 2015 12:51:45 -0500")
Jeff King <peff@peff.net> writes:
> My motivation isn't exactly code sharing. It is that you sometimes want
> to affect sub-commands of a program, and cannot pass command line
> options to them yourself.
>
> For instance, "git-stash --include-untracked" will call "git clean"
> under the hood. There is no way to say "...and treat foo.* as ignored
> for this invocation". It could grow its own "-e" option, but that does
> not help any other third-party scripts which call "git clean".
>
> So IMHO this is not really about command-line options, but about the
> environment in which a command is executed. Environment variables are
> the obvious way to do that; "git --foo" options are just syntactic sugar
> to set the variables. We could just add variables without matching
> options.
I'd be even more wary of that, as different commands use ignore
patterns for different purposes. A script may invoke "clean" and
"add" and would want to use different sets of ignore patterns to
emulate "precious" class (which we do not have), for example, by
giving a wider ignore pattern for "add" to prevent a file that must
be kept untracked outside the index while telling "clean -X" that
that file is not expendable with a narrower ignore pattern. That is
just one example that comes to me without thinking about the issues
too hard, so I am reasonably sure that it would hurt the ecosystem
to promote that the ignore pattern can be used for specifying
important per-invocation input to a script.
In any case, what we've been discussing may be an interesting and
potentially important tangent, but it still is a tangent while
evaluating the patch in question. I do not think I'd be using the
new "--exclude-from=<file>" option to "clean" (simply because I do
not think I've ever used the existing "-e" option to it unless I am
merely testing the command to make sure it works as advertised)
myself, but I do not immediately see how it would hurt us in the
future to add it now. So...
next prev parent reply other threads:[~2015-12-06 3:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 14:44 [PATCH] clean: new option --exclude-from James
2015-11-30 2:24 ` Eric Sunshine
[not found] ` <CAGjXF72PgdjBw03ERVYxj+atvsBXK0LeJ6O3zTZgi3-kv9BWsw@mail.gmail.com>
2015-12-01 22:25 ` Eric Sunshine
2015-12-06 14:58 ` [PATCH v2 1/2] modernize t7300 James
2015-12-06 14:58 ` [PATCH v2 2/2] clean: new option --exclude-from James
2015-12-07 20:56 ` Jeff King
2015-12-07 21:44 ` Junio C Hamano
2015-12-07 22:53 ` Eric Sunshine
2015-12-07 21:40 ` [PATCH v2 1/2] modernize t7300 Junio C Hamano
2015-12-07 22:46 ` Eric Sunshine
2015-12-07 22:50 ` Junio C Hamano
2015-12-07 22:43 ` Eric Sunshine
2015-12-02 0:53 ` [PATCH] clean: new option --exclude-from Jeff King
2015-12-02 2:18 ` Junio C Hamano
2015-12-02 2:44 ` Jeff King
2015-12-02 16:40 ` Junio C Hamano
2015-12-02 16:47 ` Jeff King
2015-12-02 17:25 ` Junio C Hamano
2015-12-02 17:51 ` Jeff King
2015-12-06 3:51 ` Junio C Hamano [this message]
2015-12-07 19:39 ` 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=xmqqr3j0nsk8.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=rouzier@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.