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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 5, 2017, 23:30 UTC
Message-ID
<alpine.DEB.2.21.1.1708060127330.4271@virtualbox>
In-Reply-To
<xmqqlgmxskm6.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Sat, 5 Aug 2017, Junio C Hamano wrote:
Show 16 quoted lines
> Michael Forney <mforney@mforney.org> writes:
> 
> > This way, they still work even if the built-in symlinks aren't
> > installed.
> >
> > Signed-off-by: Michael Forney <mforney@mforney.org>
> > ---
> > It looks like there was an effort to do this a number of years ago (through
> > `make remove-dashes`). These are just a few I noticed were still left in the
> > .sh scripts.
> 
> Thanks for working on this.  
> 
> Have you made sure that all of these scripts, before calling
> 'git-foo' in the current code, update their PATH so that these found
> in the bog standard place (i.e. GIT_EXEC_PATH)?
The scripts do not update their PATH. `git` does, before they are called.

For example, if you call `git stash`, the `git` executable will first figure out that `stash` is not a builtin (unless you run with the experimental patch series that still has not seen much review, more is the shame, including on myself), and then call the dashed form. At this point, `git` will already have added the exec path to the PATH variable so that `git-stash` is found. So then `git-stash` runs, and does not even need to take pains to adjust the PATH variable again! Magic!

;-)

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.