Re: [PATCH 00/19] Add git-list-files
- From
Jeff King <peff@peff.net>
- Date
- Dec 2, 2014, 20:18 UTC
- Message-ID
- <20141202201837.GC23461@peff.net>
- In-Reply-To
- <CACsJy8DBkGVhaJnCTs9_E+g6FYYr4V-6S=XB5wrGBFPjHnEu1A@mail.gmail.com>
On Tue, Dec 02, 2014 at 06:45:52PM +0700, Duy Nguyen wrote:
Show 6 quoted lines
> > As a side note, I wonder if it would be sensible to whitelist some > > commands as porcelain, and allow aliases to override them (either > > entirely, or just to add-in some options). > > Agreed. Maybe not all porcelain (some like git-branch almost functions > like plumbing).
Yeah, many things straddle the plumbing/porcelain line (e.g., "commit" is porcelain, but it's basically the only sane way for scripts to make a commit, so many use it). So I'd pick just a few things that should be safe to override.
> We also need away to stop alias (e.g. in scripts).
Do we? I think the point of allowing this only for porcelain is that you do not have to care about scripts. That is, a script running "git ls" would get whatever the user's preferences are for "ls" output. A script parsing the output of "ls" deserves whatever crap it gets.
Show 5 quoted lines
> In scripts I can specify full path to a command to make sure I won't > hit an alias. I guess we can't do the same here. The closet to "full > path" is git-cmd form, as opposed to "git cmd" form) but I think we > don't want to bring back git-cmd. Maybe just a "git --no-alias cmd" > and GIT_NO_ALIAS..
Yeah, I think "--no-alias"/GIT_NO_ALIAS would work. But the problem is one of compatibility. Scripts are not written to specify no-alias, so you cannot just turn on the override-commands-with-aliases feature immediately (and likewise, scripts have little incentive to bother annotating their calls if it the override feature is not enabled).
-Peff