git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Drop some dashes from built-in invocations in scripts

From
Michael Forney <mforney@mforney.org>
Date
Aug 7, 2017, 17:58 UTC
Message-ID
<CAGw6cBvE-OJW0gSRCYOS5VT+Ff+eiCMdJg2A2rBi_HXFObdJRw@mail.gmail.com>
In-Reply-To
<xmqqo9rrqp3l.fsf@gitster.mtv.corp.google.com>
On 8/7/17, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> Just to avoid possible confusion, the above is not to say "once it
> is decided, you are not allowed to bring fresh arguments to the
> discussion".  As Peff said [*2*] in that old discussion thread, the
> circumstances may have changed over 9 years, and it may benefit to
> revisit some old decisions.
>
> So in that sense, I do not mind somebody makes a fresh proposal,
> which would probably be similar to what I did back then in [*3*],
> which is at the beginning of that old thread.  But I do not think I
> would be doing so myself, and I suspect that I would not be very
> supportive for such a proposal, because my gut feeling is that the
> upside is not big enough compared to downsides.
>
> The obvious upside is that you do not have to have many built-in
> commands on the filesystem, either as a hardlink, a copy, or a
> symbolic link.  But we will be breaking people's scripts by breaking
> the 11-year old promise that we will keep their "git-foo" working as
> long as they prepend $GIT_EXEC_PATH to their $PATH we we did so.
> Another downside is that we now will expose which subcommands are
> built-in and which are not, which is unnecessarily implementation
> detail we'd want end-users to rely on.
>
> The "'git co' may stop working" I mentioned in my previous message
> is not counted as a downside---if the upside is large enough, I
> think that "we respawn git-foo as dashed built-in when running an
> alias that expands to 'foo'" can be fixed to respawn "git foo"
> instead of "git-foo".  But there may be other downside that we may
> not be able to fix, and I suspect that "we'd be breaking the 11-year
> old promise" is something we would not be able to fix.  That is why
> I doubt that I would be advocating the removal of "git-foo" from the
> filesystem myself.
Thanks for the history and explanation, Junio. I agree with your analysis.

I didn't know that git aliases invoke the `git-foo` path for built-ins (I don't use them much myself, so didn't notice).

I also didn't know that it was supported to add GIT_EXEC_DIR to your PATH to be able to call `git-foo`. I generally think of /libexec as implementation-specific executables that a tool may call internally (in that sense, whether or not the commands are built-ins would remain an implementation-detail).

However, I still think the patch should be applied for self-consistency at least (git-submodule.sh currently calls both `git rev-parse` and `git-rev-parse`). Also, based on Johannes' reply, it may still be useful for git-for-windows.

Show 10 quoted lines
>
> [References]
>
> *1*
> https://public-inbox.org/git/alpine.LFD.1.10.0808261114070.3363@nehalem.linux-foundation.org/
>
> *2*
> https://public-inbox.org/git/20080826145719.GB5046@coredump.intra.peff.net/
>
> *3* https://public-inbox.org/git/7vprnzt7d5.fsf@gitster.siamese.dyndns.org/
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 16 in “Drop some dashes from built-in invocations in scripts”
  1. Drop some dashes from built-in invocations in scriptsMichael Forney, Aug 5, 2017
  2. Johannes SchindelinAug 5, 2017
  3. Junio C HamanoAug 5, 2017
  4. Michael ForneyAug 5, 2017
  5. Junio C HamanoAug 5, 2017
  6. Michael ForneyAug 6, 2017
  7. Junio C HamanoAug 7, 2017
  8. Johannes SchindelinAug 5, 2017
  9. Junio C HamanoAug 7, 2017
  10. Junio C HamanoAug 7, 2017
  11. Michael ForneyAug 7, 2017
  12. Junio C HamanoAug 7, 2017
  13. Johannes SchindelinAug 7, 2017
  14. Junio C HamanoAug 7, 2017
  15. Johannes SchindelinAug 7, 2017
  16. Junio C HamanoAug 7, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.