From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.3 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 0E94A20986 for ; Fri, 7 Oct 2016 14:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754997AbcJGOUN (ORCPT ); Fri, 7 Oct 2016 10:20:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:61723 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618AbcJGOUK (ORCPT ); Fri, 7 Oct 2016 10:20:10 -0400 Received: from virtualbox ([37.24.142.40]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MGAdz-1bdMtb0oYp-00FCT4; Fri, 07 Oct 2016 16:19:28 +0200 Date: Fri, 7 Oct 2016 16:19:13 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: =?UTF-8?Q?Jakub_Nar=C4=99bski?= cc: Junio C Hamano , =?UTF-8?Q?Nguy=E1=BB=85n_Th=C3=A1i_Ng=E1=BB=8Dc_Duy?= , git@vger.kernel.org Subject: Re: [PATCH/RFC] git.c: support "!!" aliases that do not move cwd In-Reply-To: Message-ID: References: <20161006114124.4966-1-pclouds@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-799723535-1475849968=:35196" X-Provags-ID: V03:K0:vggH7JlnGDu5f3FkK/aK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Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-799723535-1475849968=:35196 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi Kuba, On Fri, 7 Oct 2016, Jakub Nar=C4=99bski wrote: > W dniu 07.10.2016 o 13:20, Johannes Schindelin pisze: > > On Thu, 6 Oct 2016, Junio C Hamano wrote: > >> Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc 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 mak= e > >>> handling path arguments hard because they are relative to the origina= l > >>> 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. > >=20 > > 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?". >=20 > Well, "!" as a prefix is not intuitive either. You do not use vi, do you? :-P In vi, if you enter command mode (typing a colon) and then want to execute, say, `pwd`, you type !pwd > Perhaps "!.", because "." is current directory, and the "." command > (that is, alias to "source") doesn't make sense in git aliases. If you want to execute, say, `pwd` in the current directory, that would mean you want to write =09!.pwd But that already means "execute `.pwd`"... > 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 completes the aliases' names, not their values. Ciao, Dscho --8323329-799723535-1475849968=:35196--