On Sun, Oct 09, 2016 at 02:01:49AM -0400, Jeff King wrote:

> > So what about this?
> > 
> >     [alias]
> >             d2u = !dos2unix
> >     [alias "d2u"]
> >             shell = 'f() { git ls-files "$@" | xargs dos2unix; }; f'
> >             exec = C:/cygwin64/bin/dos2unix.exe
> > 
> > You introduce all kinds of ambiguities here that did not exist before...
> 
> If you mean ambiguity between the old "alias.X" and the new "alias.X.*",
> then yes, I think that's an unavoidable part of the transition.  IMHO,
> the new should take precedence over the old, and people will gradually
> move from one to the other.
> 
> If you mean the ambiguity between alias.X.shell and alias.X.exec in your
> example, the problem is that you have keys with overlapping meanings.
> One solution is "don't do that" (so have a key like "cmd", and another
> to select "shell or git-cmd", etc). Another is to define some rule, like
> "last one wins" (so "exec" overrides "shell" in your example).
> 
> I'd prefer the "don't do that" path. The config you showed is
> nonsensical, and it doesn't really matter that much how we behave. But
> it is better still if we have a config scheme that makes it hard to
> write nonsensical things in the first place.

Just to be clear on my "don't do that", I don't mean "the user should
not do that", but "do not design a config scheme with keys that have
overlapping meanings".

-Peff

Reply via email to