Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-26 Thread Junio C Hamano
Duy Nguyen writes: > I don't object the alias.. approach though. It's > definitely a cleaner one in my opinion. It just needs people who can > spend time to follow up until the end. But if someone decides to do > that now, I'll drop the "(properties)!command" and try to support > him/her. I don'

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-26 Thread Duy Nguyen
On Tue, Oct 11, 2016 at 10:01 PM, Jeff King wrote: > On Tue, Oct 11, 2016 at 11:44:50AM +0200, Johannes Schindelin wrote: > >> > Yeah, that's reasonable, too. So: >> > >> > [alias] >> > d2u = "!dos2unix" >> > >> > acts exactly as if: >> > >> > [alias "d2u"] >> > command = dos2unix >> >

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread Jeff King
On Tue, Oct 11, 2016 at 11:44:50AM +0200, Johannes Schindelin wrote: > > Yeah, that's reasonable, too. So: > > > > [alias] > > d2u = "!dos2unix" > > > > acts exactly as if: > > > > [alias "d2u"] > > command = dos2unix > > type = shell > > > > was specified at that point, which

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread Jakub Narębski
W dniu 11.10.2016 o 13:51, SZEDER Gábor pisze: > Quoting Duy Nguyen : >> On Fri, Oct 7, 2016 at 10:55 PM, Jakub Narębski wrote: >>> W dniu 07.10.2016 o 16:19, Johannes Schindelin pisze: On Fri, 7 Oct 2016, Jakub Narębski wrote: >>> > Note that we would have to teach git completion about n

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread SZEDER Gábor
Quoting Duy Nguyen : On Fri, Oct 7, 2016 at 10:55 PM, Jakub Narębski wrote: W dniu 07.10.2016 o 16:19, Johannes Schindelin pisze: On Fri, 7 Oct 2016, Jakub Narębski wrote: Note that we would have to teach git completion about new syntax; or new configuration variable if we go that route.

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread Johannes Schindelin
Hi Duy, On Tue, 11 Oct 2016, Duy Nguyen wrote: > On Tue, Oct 11, 2016 at 4:44 PM, Johannes Schindelin > wrote: > > > > On Sun, 9 Oct 2016, Jeff King wrote: > > > >> On Sun, Oct 09, 2016 at 06:32:38PM +0700, Duy Nguyen wrote: > >> > >> > > If you mean ambiguity between the old "alias.X" and the n

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread Duy Nguyen
On Tue, Oct 11, 2016 at 4:44 PM, Johannes Schindelin wrote: > Hi, > > On Sun, 9 Oct 2016, Jeff King wrote: > >> On Sun, Oct 09, 2016 at 06:32:38PM +0700, Duy Nguyen wrote: >> >> > > If you mean ambiguity between the old "alias.X" and the new "alias.X.*", >> > > then yes, I think that's an unavoida

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-11 Thread Johannes Schindelin
Hi, On Sun, 9 Oct 2016, Jeff King wrote: > On Sun, Oct 09, 2016 at 06:32:38PM +0700, Duy Nguyen wrote: > > > > 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 precedenc

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-10 Thread Junio C Hamano
Jeff King writes: > ... My main motive in switching to the > "alias.$cmd.key" syntax is that it fixes the ancient mistake of putting > arbitrary content into the key (just like pager.*, as we've discussed > elsewhere). Yup, we are on the same page. It's not too grave a mistake (we said "these a

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-10 Thread Jeff King
On Mon, Oct 10, 2016 at 10:52:26AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Having separate exec/shell boolean options just punts the overlap from > > the command key to those keys. If you have two mutually exclusive > > options, I think the best thing is a single option, like: > >

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-10 Thread Junio C Hamano
Jeff King writes: > Having separate exec/shell boolean options just punts the overlap from > the command key to those keys. If you have two mutually exclusive > options, I think the best thing is a single option, like: > > type = > > and then it is obvious that a second appearance of "type" ov

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-09 Thread Jeff King
On Sun, Oct 09, 2016 at 06:32:38PM +0700, Duy Nguyen wrote: > > 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 fr

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-09 Thread Duy Nguyen
On Sun, Oct 9, 2016 at 1:01 PM, Jeff King wrote: > On Sat, Oct 08, 2016 at 10:36:13AM +0200, Johannes Schindelin wrote: > >> > > Maybe it's time to aim for >> > > >> > > git config alias.d2u.shell \ >> > >'f() { git ls-files "$@" | xargs dos2unix; }; f' >> > > git config alias.d2u.cdup

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Jeff King
On Sat, Oct 08, 2016 at 10:36:13AM +0200, Johannes Schindelin wrote: > > > Maybe it's time to aim for > > > > > > git config alias.d2u.shell \ > > >'f() { git ls-files "$@" | xargs dos2unix; }; f' > > > git config alias.d2u.cdup false > > > git d2u *.c # yada! > > > > That would

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Jeff King
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 in

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-08 Thread Johannes Schindelin
Hi Peff & Hannes, On Fri, 7 Oct 2016, Jeff King wrote: > On Fri, Oct 07, 2016 at 07:42:35PM +0200, Johannes Sixt wrote: > > > Maybe it's time to aim for > > > > git config alias.d2u.shell \ > >'f() { git ls-files "$@" | xargs dos2unix; }; f' > > git config alias.d2u.cdup false > >

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Duy Nguyen
On Fri, Oct 7, 2016 at 10:55 PM, Jakub Narębski wrote: > W dniu 07.10.2016 o 16:19, Johannes Schindelin pisze: >> On Fri, 7 Oct 2016, Jakub Narębski wrote: > >>> Note that we would have to teach git completion about new syntax; >>> or new configuration variable if we go that route. >> >> Why would

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Jeff King
On Fri, Oct 07, 2016 at 07:42:35PM +0200, Johannes Sixt wrote: > Maybe it's time to aim for > > git config alias.d2u.shell \ >'f() { git ls-files "$@" | xargs dos2unix; }; f' > git config alias.d2u.cdup false > git d2u *.c # yada! That would be nice. It would also allow "alias.fo

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Johannes Sixt
Am 07.10.2016 um 14:27 schrieb Duy Nguyen: On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin wrote: Hi Junio, On Thu, 6 Oct 2016, Junio C Hamano wrote: Nguyễn Thái Ngọc Duy writes: Throwing something at the mailing list to see if anybody is interested. Current '!' aliases move cwd to

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Jakub Narębski
W dniu 07.10.2016 o 16:19, Johannes Schindelin pisze: > On Fri, 7 Oct 2016, Jakub Narębski wrote: >> Note that we would have to teach git completion about new syntax; >> or new configuration variable if we go that route. > > Why would we? Git's completion does not expand aliases, it only complet

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Matthieu Moy
Johannes Schindelin writes: > Hi Matthieu, > > On Fri, 7 Oct 2016, Matthieu Moy wrote: > >> Another possibility: !(nocd), which leaves room >> for !(keyword1,keyword2,...) if needed later. Also, it is consistent >> with the :(word) syntax of pathspecs. > > But is this backwards-compatible? Don't

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Johannes Schindelin
Hi Kuba, On Fri, 7 Oct 2016, Jakub Narębski wrote: > W dniu 07.10.2016 o 13:20, Johannes Schindelin pisze: > > On Thu, 6 Oct 2016, Junio C Hamano wrote: > >> Nguyễn Thái Ngọc Duy writes: > >> > >>> Throwing something at the mailing list to see if anybody is > >>> interested. > >>> > >>> Current

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Jeff King
On Fri, Oct 07, 2016 at 04:11:34PM +0200, Johannes Schindelin wrote: > Possibly a better idea would be to use *another* special symbol, one that > makes intuitive sense as a modifier, such as: > > [alias] > # This works as before > xyz = !pwd > # As

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Johannes Schindelin
Hi Matthieu, On Fri, 7 Oct 2016, Matthieu Moy wrote: > Duy Nguyen writes: > > > On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin > > wrote: > >> Hi Junio, > >> > >> On Thu, 6 Oct 2016, Junio C Hamano wrote: > >> > >>> Nguyễn Thái Ngọc Duy writes: > >>> > >>> > Throwing something at the ma

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Johannes Schindelin
Hi Duy, On Fri, 7 Oct 2016, Duy Nguyen wrote: > On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin > wrote: > > > > On Thu, 6 Oct 2016, Junio C Hamano wrote: > > > >> Nguyễn Thái Ngọc Duy writes: > >> > >> > Throwing something at the mailing list to see if anybody is > >> > interested. > >> >

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Jakub Narębski
Hello, Johannes W dniu 07.10.2016 o 13:20, Johannes Schindelin pisze: > On Thu, 6 Oct 2016, Junio C Hamano wrote: >> Nguyễn Thái Ngọc Duy writes: >> >>> Throwing something at the mailing list to see if anybody is >>> interested. >>> >>> Current '!' aliases move cwd to $GIT_WORK_TREE first, which

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Matthieu Moy
Duy Nguyen writes: > On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin > wrote: >> Hi Junio, >> >> On Thu, 6 Oct 2016, Junio C Hamano wrote: >> >>> Nguyễn Thái Ngọc Duy writes: >>> >>> > Throwing something at the mailing list to see if anybody is >>> > interested. >>> > >>> > Current '!' ali

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Duy Nguyen
On Fri, Oct 7, 2016 at 7:47 PM, Matthieu Moy wrote: > Duy Nguyen writes: > >> On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin >> wrote: >>> Hi Junio, >>> >>> On Thu, 6 Oct 2016, Junio C Hamano wrote: >>> Nguyễn Thái Ngọc Duy writes: > Throwing something at the mailing list t

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Duy Nguyen
On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin wrote: > Hi Junio, > > On Thu, 6 Oct 2016, Junio C Hamano wrote: > >> Nguyễn Thái Ngọc Duy writes: >> >> > Throwing something at the mailing list to see if anybody is >> > interested. >> > >> > Current '!' aliases move cwd to $GIT_WORK_TREE fir

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-07 Thread Johannes Schindelin
Hi Junio, On Thu, 6 Oct 2016, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > > > Throwing something at the mailing list to see if anybody is > > interested. > > > > Current '!' aliases move cwd to $GIT_WORK_TREE first, which could make > > handling path arguments hard because they are

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-06 Thread Jeff King
On Thu, Oct 06, 2016 at 03:00:14PM -0400, Jeff King wrote: > PS I think your "!!" syntax conflicts with something like: > > git -c alias.has-changes='!! git diff --quiet' has-changes > >I don't know if that is worth worrying about or not. I also notice >that using "!!git diff" with n

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-06 Thread Jeff King
On Thu, Oct 06, 2016 at 06:41:24PM +0700, Nguyễn Thái Ngọc Duy wrote: > Throwing something at the mailing list to see if anybody is > interested. > > Current '!' aliases move cwd to $GIT_WORK_TREE first, which could make > handling path arguments hard because they are relative to the original > c

Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-06 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Throwing something at the mailing list to see if anybody is > interested. > > Current '!' aliases move cwd to $GIT_WORK_TREE first, which could make > handling path arguments hard because they are relative to the original > cwd. We set GIT_PREFIX to work around it,

[PATCH/RFC] git.c: support "!!" aliases that do not move cwd

2016-10-06 Thread Nguyễn Thái Ngọc Duy
Throwing something at the mailing list to see if anybody is interested. Current '!' aliases move cwd to $GIT_WORK_TREE first, which could make handling path arguments hard because they are relative to the original cwd. We set GIT_PREFIX to work around it, but I still think it's more natural to kee