Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Sep 05 2018, Tim Schumacher wrote: > On 05.09.18 19:34, Jeff King wrote: >> >> It could also extend to ! aliases if we wanted (i.e., my '!git foo' >> example from earlier), but you'd have to carry the counter through the >> environment between processes. > > That is a question about "sho

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-06 Thread Ævar Arnfjörð Bjarmason
On Wed, Sep 05 2018, Tim Schumacher wrote: > On 05.09.18 19:34, Jeff King wrote: >> On Wed, Sep 05, 2018 at 10:54:27AM +0200, Tim Schumacher wrote: >> >>> Aliases can only contain non-alias git commands and their >>> arguments, not other user-defined aliases. Resolving further >>> (nested) alias

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Junio C Hamano
Jeff King writes: >> This is what I've come up with to prevent looping aliases. I'm not too >> happy with the number of indentations needed, but this seemed to be the >> easiest way to search an array for a value. > > I think this approach is OK, though I wonder if we'd also be fine with > just:

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Tim Schumacher
On 05.09.18 19:34, Jeff King wrote: On Wed, Sep 05, 2018 at 10:54:27AM +0200, Tim Schumacher wrote: Aliases can only contain non-alias git commands and their arguments, not other user-defined aliases. Resolving further (nested) aliases is prevented by breaking the loop after the first alias was

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Tim Schumacher
On 05.09.18 19:12, Junio C Hamano wrote: Tim Schumacher writes: @@ -691,17 +693,34 @@ static int run_argv(int *argcp, const char ***argv) /* .. then try the external ones */ execv_dashed_external(*argv); + /* Increase the array size and add the current +

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Tim Schumacher
On 05.09.18 17:48, Duy Nguyen wrote: On Wed, Sep 5, 2018 at 10:56 AM Tim Schumacher wrote: Aliases can only contain non-alias git commands and their arguments, not other user-defined aliases. Resolving further (nested) aliases is prevented by breaking the loop after the first alias was process

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Jeff King
On Wed, Sep 05, 2018 at 10:54:27AM +0200, Tim Schumacher wrote: > Aliases can only contain non-alias git commands and their > arguments, not other user-defined aliases. Resolving further > (nested) aliases is prevented by breaking the loop after the > first alias was processed. Git then fails with

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Junio C Hamano
Tim Schumacher writes: > @@ -691,17 +693,34 @@ static int run_argv(int *argcp, const char ***argv) > /* .. then try the external ones */ > execv_dashed_external(*argv); > > + /* Increase the array size and add the current > + * command to it.

Re: [RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Duy Nguyen
On Wed, Sep 5, 2018 at 10:56 AM Tim Schumacher wrote: > > Aliases can only contain non-alias git commands and their > arguments, not other user-defined aliases. Resolving further > (nested) aliases is prevented by breaking the loop after the > first alias was processed. Git then fails with a comma

[RFC PATCH v2] Allow aliases that include other aliases

2018-09-05 Thread Tim Schumacher
Aliases can only contain non-alias git commands and their arguments, not other user-defined aliases. Resolving further (nested) aliases is prevented by breaking the loop after the first alias was processed. Git then fails with a command-not-found error. Allow resolving nested aliases by not breaki