{"thread":{"id":"17803","subject":"[PATCH] Use \"git <command>\" instead of dashed form in sample hooks","startedAt":"2009-02-15T17:02:28Z","lastAt":"2009-02-15T17:19:48Z","messageCount":3,"participants":["Teemu Likonen","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"104788","messageId":"1234717348-20228-1-git-send-email-tlikonen@iki.fi","threadId":"17803","inReplyTo":null,"subject":"[PATCH] Use \"git <command>\" instead of dashed form in sample hooks","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-15T17:02:28Z","receivedAt":"2009-02-15T17:02:28Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Sample hook files used deprecated dashed form \"git-<command>\" which are\nnot installed in PATH anymore. This fixes them to use \"git <command>\"\nform instead.\n\nSigned-off-by: Teemu Likonen <tlikonen@iki.fi>\n---\n contrib/hooks/pre-auto-gc-battery          |    2 +-\n contrib/hooks/update-paranoid              |    6 +++---\n templates/hooks--commit-msg.sample         |    2 +-\n templates/hooks--post-update.sample        |    2 +-\n templates/hooks--pre-commit.sample         |    4 ++--\n templates/hooks--pre-rebase.sample         |   18 +++++++++---------\n templates/hooks--prepare-commit-msg.sample |    2 +-\n templates/hooks--update.sample             |    4 ++--\n templates/info--exclude                    |    2 +-\n 9 files changed, 21 insertions(+), 21 deletions(-)\n\ndiff --git a/contrib/hooks/pre-auto-gc-battery b/contrib/hooks/pre-auto-gc-battery\nindex 1f914c9..e28530a 100644\n--- a/contrib/hooks/pre-auto-gc-battery\n+++ b/contrib/hooks/pre-auto-gc-battery\n@@ -1,7 +1,7 @@\n #!/bin/sh\n #\n # An example hook script to verify if you are on battery, in case you\n-# are running Linux or OS X. Called by git-gc --auto with no arguments.\n+# are running Linux or OS X. Called by \"git gc --auto\" with no arguments.\n # The hook should exit with non-zero status after issuing an appropriate\n # message if it wants to stop the auto repacking.\n #\ndiff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid\nindex d18b317..412be9b 100644\n--- a/contrib/hooks/update-paranoid\n+++ b/contrib/hooks/update-paranoid\n@@ -11,7 +11,7 @@ my $debug      = 0;\n =doc\n Invoked as: update refname old-sha1 new-sha1\n \n-This script is run by git-receive-pack once for each ref that the\n+This script is run by \"git receive-pack\" once for each ref that the\n client is trying to modify.  If we exit with a non-zero exit value\n then the update for that particular ref is denied, but updates for\n other refs in the same run of receive-pack may still be allowed.\n@@ -23,9 +23,9 @@ look for \"new\" commits and tags (the new objects won't show up in\n \n This script loads and parses the content of the config file\n \"users/$this_user.acl\" from the $acl_branch commit of $acl_git ODB.\n-The acl file is a git-config style file, but uses a slightly more\n+The acl file is a \"git config\" style file, but uses a slightly more\n restricted syntax as the Perl parser contained within this script\n-is not nearly as permissive as git-config.\n+is not nearly as permissive as \"git config\".\n \n Example:\n \ndiff --git a/templates/hooks--commit-msg.sample b/templates/hooks--commit-msg.sample\nindex 6ef1d29..b58d118 100755\n--- a/templates/hooks--commit-msg.sample\n+++ b/templates/hooks--commit-msg.sample\n@@ -1,7 +1,7 @@\n #!/bin/sh\n #\n # An example hook script to check the commit log message.\n-# Called by git-commit with one argument, the name of the file\n+# Called by \"git commit\" with one argument, the name of the file\n # that has the commit message.  The hook should exit with non-zero\n # status after issuing an appropriate message if it wants to stop the\n # commit.  The hook is allowed to edit the commit message file.\ndiff --git a/templates/hooks--post-update.sample b/templates/hooks--post-update.sample\nindex 5323b56..ec17ec1 100755\n--- a/templates/hooks--post-update.sample\n+++ b/templates/hooks--post-update.sample\n@@ -5,4 +5,4 @@\n #\n # To enable this hook, rename this file to \"post-update\".\n \n-exec git-update-server-info\n+exec git update-server-info\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 0e49279..95e154c 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -1,13 +1,13 @@\n #!/bin/sh\n #\n # An example hook script to verify what is about to be committed.\n-# Called by git-commit with no arguments.  The hook should\n+# Called by \"git commit\" with no arguments.  The hook should\n # exit with non-zero status after issuing an appropriate message if\n # it wants to stop the commit.\n #\n # To enable this hook, rename this file to \"pre-commit\".\n \n-if git-rev-parse --verify HEAD 2>/dev/null\n+if git rev-parse --verify HEAD 2>/dev/null\n then\n \tagainst=HEAD\n else\ndiff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\nindex be1b06e..226301f 100755\n--- a/templates/hooks--pre-rebase.sample\n+++ b/templates/hooks--pre-rebase.sample\n@@ -2,7 +2,7 @@\n #\n # Copyright (c) 2006, 2008 Junio C Hamano\n #\n-# The \"pre-rebase\" hook is run just before \"git-rebase\" starts doing\n+# The \"pre-rebase\" hook is run just before \"git rebase\" starts doing\n # its job, and can prevent the command from running by exiting with\n # non-zero status.\n #\n@@ -43,7 +43,7 @@ git show-ref -q \"$topic\" || {\n }\n \n # Is topic fully merged to master?\n-not_in_master=`git-rev-list --pretty=oneline ^master \"$topic\"`\n+not_in_master=`git rev-list --pretty=oneline ^master \"$topic\"`\n if test -z \"$not_in_master\"\n then\n \techo >&2 \"$topic is fully merged to master; better remove it.\"\n@@ -51,11 +51,11 @@ then\n fi\n \n # Is topic ever merged to next?  If so you should not be rebasing it.\n-only_next_1=`git-rev-list ^master \"^$topic\" ${publish} | sort`\n-only_next_2=`git-rev-list ^master           ${publish} | sort`\n+only_next_1=`git rev-list ^master \"^$topic\" ${publish} | sort`\n+only_next_2=`git rev-list ^master           ${publish} | sort`\n if test \"$only_next_1\" = \"$only_next_2\"\n then\n-\tnot_in_topic=`git-rev-list \"^$topic\" master`\n+\tnot_in_topic=`git rev-list \"^$topic\" master`\n \tif test -z \"$not_in_topic\"\n \tthen\n \t\techo >&2 \"$topic is already up-to-date with master\"\n@@ -64,7 +64,7 @@ then\n \t\texit 0\n \tfi\n else\n-\tnot_in_next=`git-rev-list --pretty=oneline ^${publish} \"$topic\"`\n+\tnot_in_next=`git rev-list --pretty=oneline ^${publish} \"$topic\"`\n \tperl -e '\n \t\tmy $topic = $ARGV[0];\n \t\tmy $msg = \"* $topic has commits already merged to public branch:\\n\";\n@@ -157,13 +157,13 @@ B to be deleted.\n \n To compute (1):\n \n-\tgit-rev-list ^master ^topic next\n-\tgit-rev-list ^master        next\n+\tgit rev-list ^master ^topic next\n+\tgit rev-list ^master        next\n \n \tif these match, topic has not merged in next at all.\n \n To compute (2):\n \n-\tgit-rev-list master..topic\n+\tgit rev-list master..topic\n \n \tif this is empty, it is fully merged to \"master\".\ndiff --git a/templates/hooks--prepare-commit-msg.sample b/templates/hooks--prepare-commit-msg.sample\nindex 3652424..0bcfea4 100755\n--- a/templates/hooks--prepare-commit-msg.sample\n+++ b/templates/hooks--prepare-commit-msg.sample\n@@ -1,7 +1,7 @@\n #!/bin/sh\n #\n # An example hook script to prepare the commit log message.\n-# Called by git-commit with the name of the file that has the\n+# Called by \"git commit\" with the name of the file that has the\n # commit message, followed by the description of the commit\n # message's source.  The hook's purpose is to edit the commit\n # message file.  If the hook fails with a non-zero status,\ndiff --git a/templates/hooks--update.sample b/templates/hooks--update.sample\nindex 93c6055..a75649d 100755\n--- a/templates/hooks--update.sample\n+++ b/templates/hooks--update.sample\n@@ -1,7 +1,7 @@\n #!/bin/sh\n #\n # An example hook script to blocks unannotated tags from entering.\n-# Called by git-receive-pack with arguments: refname sha1-old sha1-new\n+# Called by \"git receive-pack\" with arguments: refname sha1-old sha1-new\n #\n # To enable this hook, rename this file to \"update\".\n #\n@@ -53,7 +53,7 @@ fi\n if [ \"$newrev\" = \"0000000000000000000000000000000000000000\" ]; then\n \tnewrev_type=delete\n else\n-\tnewrev_type=$(git-cat-file -t $newrev)\n+\tnewrev_type=$(git cat-file -t $newrev)\n fi\n \n case \"$refname\",\"$newrev_type\" in\ndiff --git a/templates/info--exclude b/templates/info--exclude\nindex 2c87b72..a5196d1 100644\n--- a/templates/info--exclude\n+++ b/templates/info--exclude\n@@ -1,4 +1,4 @@\n-# git-ls-files --others --exclude-from=.git/info/exclude\n+# git ls-files --others --exclude-from=.git/info/exclude\n # Lines that start with '#' are comments.\n # For a project mostly in C, the following would be a good set of\n # exclude patterns (uncomment them if you want to use them):\n-- \n1.6.2.rc0.91.g9947\n"},{"id":"104790","messageId":"alpine.DEB.1.00.0902151807010.10279@pacific.mpi-cbg.de","threadId":"17803","inReplyTo":"1234717348-20228-1-git-send-email-tlikonen@iki.fi","subject":"Re: [PATCH] Use \"git <command>\" instead of dashed form in sample hooks","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-15T17:10:38Z","receivedAt":"2009-02-15T17:10:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 15 Feb 2009, Teemu Likonen wrote:\n\n> Sample hook files used deprecated dashed form \"git-<command>\" which are\n> not installed in PATH anymore. This fixes them to use \"git <command>\"\n> form instead.\n\nAFAIR, GIT_EXEC_PATH will be added to the PATH before calling the hook.  \nSo this is not the fix you claim it to be.\n\nBut I agree that it is a nice cleanup to use undashed commands in the \nhooks (if only to make testing easier).\n\nAlso, I see that only 9 of your fixes touch code, the rest touches \ncomments.\n\nCiao,\nDscho\n"},{"id":"104791","messageId":"87y6w7r51n.fsf@iki.fi","threadId":"17803","inReplyTo":"alpine.DEB.1.00.0902151807010.10279@pacific.mpi-cbg.de","subject":"Re: [PATCH] Use \"git <command>\" instead of dashed form in sample hooks","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2009-02-15T17:19:48Z","receivedAt":"2009-02-15T17:19:48Z","isPatch":true,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"On 2009-02-15 18:10 (+0100), Johannes Schindelin wrote:\n\n> AFAIR, GIT_EXEC_PATH will be added to the PATH before calling the hook.  \n> So this is not the fix you claim it to be.\n>\n> But I agree that it is a nice cleanup to use undashed commands in the \n> hooks (if only to make testing easier).\n\nAh, OK. Let's say it's an \"inconsistency fix\", then. :-)\n"}]}