{"thread":{"id":"14190","subject":"[RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","startedAt":"2008-06-27T20:10:01Z","lastAt":"2008-06-30T02:39:37Z","messageCount":7,"participants":["Jonathan Nieder","Alex Riesen","Junio C Hamano","Jeff King","jrnieder@uchicago.edu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"81465","messageId":"20080627151001.BIA19424@m4500-01.uchicago.edu","threadId":"14190","inReplyTo":null,"subject":"[RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Jonathan Nieder","fromEmail":"jrnieder@uchicago.edu","sentAt":"2008-06-27T20:10:01Z","receivedAt":"2008-06-27T20:10:01Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Starting with Git 1.5.4, use of dashed forms of git commands in\nscripts without \"PATH=$(git --exec-path):$PATH\" was deprecated. Thus\nwe generally advertise the non-dashed forms of commands. git-sh-setup\nand git-parse-remote do not have non-dashed forms because they are\nmeant to be sourced from a script using .; thus the only recommended\nway to use them is by updating PATH first. This patch changes the\ndocumentation accordingly.\n\nThis does not matter as much for releases before 1.6.0, because\nby default the GIT_EXEC_PATH is in the PATH already.\n\nSigned-off-by: Jonathan Nieder <jrnieder@uchicago.edu>\n---\n\n I wrote:\n\n > I wanted to just change the \". git-sh-setup\" line to \". git sh-setup\",\n > but of course that will not work. Am I missing something?\n\n Yes, I am.\n\n I do not have asciidoc installed, so this patch is completely untested.\n\n Documentation/git-parse-remote.txt |    2 ++\n Documentation/git-sh-setup.txt     |    3 ++-\n 2 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt\nindex 951dbd6..56d0505 100644\n--- a/Documentation/git-parse-remote.txt\n+++ b/Documentation/git-parse-remote.txt\n@@ -8,6 +8,8 @@ git-parse-remote - Routines to help parsing remote repository access\n \n SYNOPSIS\n --------\n+[verse]\n+'PATH=$(git --exec-path):$PATH'\n '. git-parse-remote'\n \n DESCRIPTION\ndiff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt\nindex c543170..95b0c13 100644\n--- a/Documentation/git-sh-setup.txt\n+++ b/Documentation/git-sh-setup.txt\n@@ -7,7 +7,8 @@ git-sh-setup - Common git shell script setup code\n \n SYNOPSIS\n --------\n-'git-sh-setup'\n+'PATH=$(git --exec-path):$PATH'\n+'. git-sh-setup'\n \n DESCRIPTION\n -----------\n-- \n1.5.5.GIT\n"},{"id":"81580","messageId":"20080628205817.GB3172@steel.home","threadId":"14190","inReplyTo":"20080627151001.BIA19424@m4500-01.uchicago.edu","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-06-28T20:58:17Z","receivedAt":"2008-06-28T20:58:17Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Jonathan Nieder, Fri, Jun 27, 2008 22:10:01 +0200:\n>  --------\n> +[verse]\n> +'PATH=$(git --exec-path):$PATH'\n>  '. git-parse-remote'\n\nYou missed quoting. exec-path can contain whitespace. What do you need\nexec-path in PATH for?\n"},{"id":"81582","messageId":"7vvdztmfrk.fsf@gitster.siamese.dyndns.org","threadId":"14190","inReplyTo":"20080628205817.GB3172@steel.home","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-28T21:05:51Z","receivedAt":"2008-06-28T21:05:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Jonathan Nieder, Fri, Jun 27, 2008 22:10:01 +0200:\n>>  --------\n>> +[verse]\n>> +'PATH=$(git --exec-path):$PATH'\n>>  '. git-parse-remote'\n>\n> You missed quoting. exec-path can contain whitespace.\n\nDo you understand shell quoting rules?\n\n\t$ foo='c d'\n\t$ foo=$(echo a b):$foo\n        $ echo \"$foo\"\n        a b:c d\n        $ exit\n\n> What do you need exec-path in PATH for?\n\nWhen git-parse-remote is not installed in $(bindir) anymore, the shell\nscript library won't be found on user's $PATH in general.\n"},{"id":"81598","messageId":"20080629053823.GA8262@sigill.intra.peff.net","threadId":"14190","inReplyTo":"7vvdztmfrk.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-29T05:38:23Z","receivedAt":"2008-06-29T05:38:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jun 28, 2008 at 02:05:51PM -0700, Junio C Hamano wrote:\n\n> > What do you need exec-path in PATH for?\n> \n> When git-parse-remote is not installed in $(bindir) anymore, the shell\n> script library won't be found on user's $PATH in general.\n\nI think the right question is:\n\n  PATH=$PATH:$(git --exec-path)\n  . git-sh-setup\n\nor\n\n  . \"$(git --exec-path)/git-sh-setup\"\n\n?\n\nGenerally, I would prefer the latter because it has no side effects. For\nnow at least, though, shell scripts probably want git's exec-path in\ntheir PATH so \"git-foo\" invocations don't break.\n\n-Peff\n"},{"id":"81650","messageId":"Pine.GSO.4.62.0806291026310.8371@harper.uchicago.edu","threadId":"14190","inReplyTo":"20080629053823.GA8262@sigill.intra.peff.net","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"","fromEmail":"jrnieder@uchicago.edu","sentAt":"2008-06-29T16:10:20Z","receivedAt":"2008-06-29T16:10:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"On Sun, 29 Jun 2008, Jeff King wrote:\n\n> I think the right question is:\n> \n>   PATH=$PATH:$(git --exec-path)\n>   . git-sh-setup\n> \n> or\n> \n>   . \"$(git --exec-path)/git-sh-setup\"\n> \n> ?\n> \n> Generally, I would prefer the latter because it has no side effects.\n\nOn Sun, 28 Jun 2008, Alex Riesen wrote:\n\n> . \"$(git --exec-path)/git-sh-setup\"\n\nI agree. I was blindly following the instructions from the release notes\nto Git 1.5.4. After thinking about it a little and reading git-sh-setup.sh\nand git-parse-remote.sh, it does seem safe not to add the exec-path to PATH.\n\nHow about this documentation patch? (This time tested! With hg-fast-export\nappropriately modified:\n  $ hg clone http://hg.sharesource.org/asciidoc\n  $ mkdir asciidoc-git && cd asciidoc-git\n  $ git init && hg-fast-export.sh -r /path/to/asciidoc --quiet\n  $ git checkout\n  $ sudo ./install.sh\n  $ cd /path/to/git/Documentation && make git-{sh-setup,parse-remote}.html\nI haven't tried rebuilding manpages, though.)\n\nJunio: I stole the commit message from you. I hope you don't mind.\n\n-- %< --\n\nSubject: [PATCH] Documentation: don't assume git-sh-setup and git-parse-remote are in PATH\n\nWhen git-parse-remote and git-sh-setup are not installed in\n$(bindir) anymore, the shell script library won't be found on\nuser's $PATH in general.\n\nSigned-off-by: Jonathan Nieder <jrnieder@uchicago.edu>\n---\n Documentation/git-parse-remote.txt |    2 +-\n Documentation/git-sh-setup.txt     |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt\nindex 951dbd6..421312e 100644\n--- a/Documentation/git-parse-remote.txt\n+++ b/Documentation/git-parse-remote.txt\n@@ -8,7 +8,7 @@ git-parse-remote - Routines to help parsing remote repository access parameters\n \n SYNOPSIS\n --------\n-'. git-parse-remote'\n+'. \"$(git --exec-path)/git-parse-remote\"'\n \n DESCRIPTION\n -----------\ndiff --git a/Documentation/git-sh-setup.txt b/Documentation/git-sh-setup.txt\nindex c543170..6731f9a 100644\n--- a/Documentation/git-sh-setup.txt\n+++ b/Documentation/git-sh-setup.txt\n@@ -7,7 +7,7 @@ git-sh-setup - Common git shell script setup code\n \n SYNOPSIS\n --------\n-'git-sh-setup'\n+'. \"$(git --exec-path)/git-sh-setup\"'\n \n DESCRIPTION\n -----------\n-- \n1.5.5.1.328.gbfcc6\n"},{"id":"81659","messageId":"7vbq1kawje.fsf@gitster.siamese.dyndns.org","threadId":"14190","inReplyTo":"Pine.GSO.4.62.0806291026310.8371@harper.uchicago.edu","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-29T19:08:53Z","receivedAt":"2008-06-29T19:08:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"jrnieder@uchicago.edu writes:\n\n> How about this documentation patch? (This time tested! With hg-fast-export\n> appropriately modified:\n>   $ hg clone http://hg.sharesource.org/asciidoc\n>   $ mkdir asciidoc-git && cd asciidoc-git\n>   $ git init && hg-fast-export.sh -r /path/to/asciidoc --quiet\n>   $ git checkout\n>   $ sudo ./install.sh\n>   $ cd /path/to/git/Documentation && make git-{sh-setup,parse-remote}.html\n> I haven't tried rebuilding manpages, though.)\n>\n> Junio: I stole the commit message from you. I hope you don't mind.\n\nI don't, but reading the script again, I suspect it is not clear enough\nthat the user is also responsible for setting up GIT_DIR appropriately\nbefore using it, perhaps by sourcing git-sh-setup.  We probably would want\nto add it in a separate patch.\n"},{"id":"81701","messageId":"Pine.GSO.4.62.0806292131390.28041@harper.uchicago.edu","threadId":"14190","inReplyTo":"7vbq1kawje.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] Documentation: Don't assume git-sh-setup and git-parse-remote are in the PATH","fromName":"Jonathan Nieder","fromEmail":"jrnieder@uchicago.edu","sentAt":"2008-06-30T02:39:37Z","receivedAt":"2008-06-30T02:39:37Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> jrnieder@uchicago.edu writes:\n>\n>> [patch to use . \"$(git --exec-path)/git-{parse-remote,sh-setup}\"\n>> instead of assuming they are in PATH]\n>>\n>> Junio: I stole the commit message from you. I hope you don't mind.\n> \n> I don't, but reading the script again, I suspect it is not clear enough\n> that the user is also responsible for setting up GIT_DIR appropriately\n> before using it, perhaps by sourcing git-sh-setup.  We probably would want\n> to add it in a separate patch.\n\nDoesn't git-parse-remote.sh begin\n\n\tGIT_DIR=$(git rev-parse --git-dir 2>/dev/null) || :;\n\n? And I don't imagine we want people to source git-sh-setup before\nsourcing git-sh-setup...\n\nConfused,\nJonathan\n"}]}