From: Johannes Schindelin <Johannes.Schindelin@gmx•de>
To: Duy Nguyen <pclouds@gmail•com>
Cc: Junio C Hamano <gitster@pobox•com>,
Git Mailing List <git@vger•kernel.org>
Subject: Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd
Date: Fri, 7 Oct 2016 16:11:34 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1610071519450.35196@virtualbox> (raw)
In-Reply-To: <CACsJy8ASc7Fxm5XDHFiX9E+bQ8s1MtmEHfc7bZY4C-_GEQr0og@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2448 bytes --]
Hi Duy,
On Fri, 7 Oct 2016, Duy Nguyen wrote:
> On Fri, Oct 7, 2016 at 6:20 PM, Johannes Schindelin
> <Johannes.Schindelin@gmx•de> wrote:
> >
> > On Thu, 6 Oct 2016, Junio C Hamano wrote:
> >
> >> Nguyễn Thái Ngọc Duy <pclouds@gmail•com> 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, but I still think it's more
> >> > natural to keep cwd where it is.
> >> >
> >> > We have a way to do that now after 441981b (git: simplify environment
> >> > save/restore logic - 2016-01-26). It's just a matter of choosing the
> >> > right syntax. I'm going with '!!'. I'm not very happy with it. But I
> >> > do like this type of alias.
> >>
> >> I do not know why you are not happy with the syntax, but I
> >> personally think it brilliant, both the idea and the preliminary
> >> clean-up that made this possible with a simple patch like this.
> >
> > I guess he is not happy with it because "!!" is quite unintuitive a
> > construct. I know that *I* would have been puzzled by it, asking "What the
> > heck does this do?".
>
> Yep. And I wouldn't want to set a tradition for the next alias type
> '!!!'. There's no good choice to represent a new alias type with a
> leading symbol. This just occurred to me, however, what do you think
> about a new config group for it? With can have something like
> externalAlias.* (or some other name) that lives in parallel with
> alias.*. Then we don't need '!' (or '!!') at all.
But what would the precedence be? externalAlias.xyz wins over alias.xyz?
And we still would need '!' support: tons of people (including myself)
rely on it.
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 does this
stat = -p status
# This, however, is different:
duy = (nocd)!pwd
This is backwards compatible as "(" is not a part of any Git command, nor
of a valid alias, nor is it commonly used as part of a git-*
executable/script.
It is also kind of a bit more intuitive, I'd wager, and it is also
extensible to future options we may want to introduce.
Ciao,
Dscho
next prev parent reply other threads:[~2016-10-07 14:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 11:41 [PATCH/RFC] git.c: support "!!" aliases that do not move cwd Nguyễn Thái Ngọc Duy
2016-10-06 18:42 ` Junio C Hamano
2016-10-07 11:20 ` Johannes Schindelin
2016-10-07 12:27 ` Duy Nguyen
2016-10-07 12:47 ` Matthieu Moy
2016-10-07 13:07 ` Duy Nguyen
2016-10-07 14:12 ` Johannes Schindelin
2016-10-07 14:31 ` Matthieu Moy
2016-10-07 14:11 ` Johannes Schindelin [this message]
2016-10-07 14:20 ` Jeff King
2016-10-07 17:42 ` Johannes Sixt
2016-10-07 17:50 ` Jeff King
2016-10-08 8:36 ` Johannes Schindelin
2016-10-09 6:01 ` Jeff King
2016-10-09 6:08 ` Jeff King
2016-10-09 11:32 ` Duy Nguyen
2016-10-09 20:58 ` Jeff King
2016-10-10 17:52 ` Junio C Hamano
2016-10-10 18:21 ` Jeff King
2016-10-10 19:07 ` Junio C Hamano
2016-10-11 9:44 ` Johannes Schindelin
2016-10-11 10:53 ` Duy Nguyen
2016-10-11 11:28 ` Johannes Schindelin
2016-10-11 15:01 ` Jeff King
2016-10-26 13:23 ` Duy Nguyen
2016-10-26 16:08 ` Junio C Hamano
2016-10-07 13:31 ` Jakub Narębski
2016-10-07 14:19 ` Johannes Schindelin
2016-10-07 15:55 ` Jakub Narębski
2016-10-08 0:32 ` Duy Nguyen
2016-10-11 11:51 ` SZEDER Gábor
2016-10-11 13:24 ` Jakub Narębski
2016-10-06 19:00 ` Jeff King
2016-10-06 19:07 ` 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=alpine.DEB.2.20.1610071519450.35196@virtualbox \
--to=johannes.schindelin@gmx$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=pclouds@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox