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

Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH

From
jrnieder@uchicago.edu <jrnieder@uchicago.edu>
Date
Jun 29, 2008, 16:10 UTC
Message-ID
<Pine.GSO.4.62.0806291026310.8371@harper.uchicago.edu>
In-Reply-To
<20080629053823.GA8262@sigill.intra.peff.net>
On Sun, 29 Jun 2008, Jeff King wrote:
Show 12 quoted lines
> I think the right question is:
> 
>   PATH=$PATH:$(git --exec-path)
>   . git-sh-setup
> 
> or
> 
>   . "$(git --exec-path)/git-sh-setup"
> 
> ?
> 
> Generally, I would prefer the latter because it has no side effects.
On Sun, 28 Jun 2008, Alex Riesen wrote:
> . "$(git --exec-path)/git-sh-setup"

I agree. I was blindly following the instructions from the release notes to Git 1.5.4. After thinking about it a little and reading git-sh-setup.sh and git-parse-remote.sh, it does seem safe not to add the exec-path to PATH.

How about this documentation patch? (This time tested! With hg-fast-export
appropriately modified:
  $ hg clone http://hg.sharesource.org/asciidoc
  $ mkdir asciidoc-git && cd asciidoc-git
  $ git init && hg-fast-export.sh -r /path/to/asciidoc --quiet
  $ git checkout
  $ sudo ./install.sh
  $ cd /path/to/git/Documentation && make git-{sh-setup,parse-remote}.html
I haven't tried rebuilding manpages, though.)
Junio: I stole the commit message from you. I hope you don't mind.
-- %< --
Subject: [PATCH] Documentation: don't assume git-sh-setup and git-parse-remote are in PATH

When git-parse-remote and git-sh-setup are not installed in $(bindir) anymore, the shell script library won't be found on user's $PATH in general.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
---
 Documentation/git-parse-remote.txt |    2 +-
 Documentation/git-sh-setup.txt     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt
index 951dbd6..421312e 100644
--- a/Documentation/git-parse-remote.txt
+++ b/Documentation/git-parse-remote.txt
@@ -8,7 +8,7 @@ git-parse-remote - Routines to help parsing remote repository access parameters
 
 SYNOPSIS
 --------
-'. git-parse-remote'
+'. "$(git --exec-path)/git-parse-remote"'
 
 DESCRIPTION
 -----------
diff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt
index c543170..6731f9a 100644
--- a/Documentation/git-sh-setup.txt
+++ b/Documentation/git-sh-setup.txt
@@ -7,7 +7,7 @@ git-sh-setup - Common git shell script setup code
 
 SYNOPSIS
 --------
-'git-sh-setup'
+'. "$(git --exec-path)/git-sh-setup"'
 
 DESCRIPTION
 -----------
-- 
1.5.5.1.328.gbfcc6
Previous: Jeff KingNext: Junio C Hamano
Message 5 of 7 in “Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH”
  1. Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATHJonathan Nieder, Jun 27, 2008
  2. Alex RiesenJun 28, 2008
  3. Junio C HamanoJun 28, 2008
  4. Jeff KingJun 29, 2008
  5. jrnieder@uchicago.eduJun 29, 2008
  6. Junio C HamanoJun 29, 2008
  7. Jonathan NiederJun 30, 2008

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.