Tell curl to follow redirects for commit-msg hook

An HTTP server may reasonably want to redirect e.g. http to https, so
use -L to instruct curl to follow such a redirect.

Change-Id: Ie8d9caee68330335fc1e915c5e87d9191f29ea65
This commit is contained in:
Dave Borowitz
2013-05-10 16:17:10 +01:00
parent f95bd17c34
commit 572d5992af
5 changed files with 7 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ copy it to your local system:
====
$ scp -p -P 29418 john.doe@review.example.com:bin/gerrit-cherry-pick ~/bin/
$ curl -o ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick
$ curl -Lo ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick
====
GERRIT

View File

@@ -61,7 +61,7 @@ You can use either of the below commands:
====
$ scp -p -P 29418 <your username>@<your Gerrit review server>:hooks/commit-msg <local path to your git>/.git/hooks/
$ curl -o <local path to your git>/.git/hooks/commit-msg <your Gerrit http URL>/tools/hooks/commit-msg
$ curl -Lo <local path to your git>/.git/hooks/commit-msg <your Gerrit http URL>/tools/hooks/commit-msg
====
A specific example of this might look something like this:
@@ -70,7 +70,7 @@ A specific example of this might look something like this:
====
$ scp -p -P 29418 john.doe@review.example.com:hooks/commit-msg ~/duhproject/.git/hooks/
$ curl -o ~/duhproject/.git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
$ curl -Lo ~/duhproject/.git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
====
Make sure the hook file is executable:

View File

@@ -12,8 +12,8 @@ To download a client command or hook, use scp or an http client:
$ scp -p -P 29418 john.doe@review.example.com:bin/gerrit-cherry-pick ~/bin/
$ scp -p -P 29418 john.doe@review.example.com:hooks/commit-msg .git/hooks/
$ curl -o ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick
$ curl -o .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
$ curl -Lo ~/bin/gerrit-cherry-pick http://review.example.com/tools/bin/gerrit-cherry-pick
$ curl -Lo .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
For more details on how to determine the correct SSH port number,
see link:user-upload.html#test_ssh[Testing Your SSH Connection].

View File

@@ -53,7 +53,7 @@ of the local Git repository:
$ scp -p -P 29418 john.doe@review.example.com:hooks/commit-msg .git/hooks/
$ curl -o .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
$ curl -Lo .git/hooks/commit-msg http://review.example.com/tools/hooks/commit-msg
Then ensure that the execute bit is set on the hook script:

View File

@@ -510,7 +510,7 @@ public class CommitValidators {
if (hostKeys.isEmpty()) {
String p = ".git/hooks/commit-msg";
return String.format(
" curl -o %s %s/tools/hooks/commit-msg ; chmod +x %s", p,
" curl -Lo %s %s/tools/hooks/commit-msg ; chmod +x %s", p,
getGerritUrl(canonicalWebUrl), p);
}