mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
Adjust for the new way of enabling the default post-update hook
The post-update hook, which is required to be enabled in order for the repository to be accessible over HTTP, is not enabled by chmod a+x anymore, but instead by dropping the .sample suffix. This patch emphasizes this change in the release notes (since I believe this is rather noticeable backwards-incompatible change). It also adjusts the documentation which still described the old way and fixes t/t5540-http-push.sh, which was broken for 1.5 month but apparently noone ever runs this test. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
2860b57a87
commit
7dce9918c7
|
@ -28,6 +28,16 @@ introduced in v1.5.2 and v1.4.4.5. If you want to keep your repositories
|
|||
backwards compatible past these versions, set repack.useDeltaBaseOffset
|
||||
to false or pack.indexVersion to 1, respectively.
|
||||
|
||||
We used to prevent sample hook scripts shipped in templates/ from
|
||||
triggering by default by relying on the fact that we install them as
|
||||
unexecutable, but on some filesystems, this approach does not work.
|
||||
They are now shipped with ".sample" suffix. If you want to activate
|
||||
any of these samples as-is, rename them to drop the ".sample" suffix,
|
||||
instead of running "chmod +x" on them. For example, you can rename
|
||||
hooks/post-update.sample to hooks/post-update to enable the sample
|
||||
hook that runs update-server-info, in order to make repositories
|
||||
friendly to dumb protocols (i.e. HTTP).
|
||||
|
||||
GIT_CONFIG, which was only documented as affecting "git config", but
|
||||
actually affected all git commands, now only affects "git config".
|
||||
GIT_LOCAL_CONFIG, also only documented as affecting "git config" and
|
||||
|
@ -56,11 +66,7 @@ Updates since v1.5.6
|
|||
gangs.
|
||||
|
||||
* Sample hook scripts shipped in templates/ are now suffixed with
|
||||
*.sample. We used to prevent them from triggering by default by
|
||||
relying on the fact that we install them as unexecutable, but on
|
||||
some filesystems this approach does not work. Instead of running
|
||||
"chmod +x" on them, the users who want to activate these samples
|
||||
as-is can now rename them dropping *.sample suffix.
|
||||
*.sample.
|
||||
|
||||
* perl's in-place edit (-i) does not work well without backup files on Windows;
|
||||
some tests are rewritten to cope with this.
|
||||
|
|
|
@ -1366,8 +1366,9 @@ your login shell is 'bash', only `.bashrc` is read and not
|
|||
|
||||
[NOTE]
|
||||
If you plan to publish this repository to be accessed over http,
|
||||
you should do `chmod +x my-git.git/hooks/post-update` at this
|
||||
point. This makes sure that every time you push into this
|
||||
you should do `mv my-git.git/hooks/post-update.sample
|
||||
my-git.git/hooks/post-update` at this point.
|
||||
This makes sure that every time you push into this
|
||||
repository, `git update-server-info` is run.
|
||||
|
||||
Your "public repository" is now ready to accept your changes.
|
||||
|
@ -1486,11 +1487,11 @@ A recommended workflow for a "project lead" goes like this:
|
|||
If other people are pulling from your repository over dumb
|
||||
transport protocols (HTTP), you need to keep this repository
|
||||
'dumb transport friendly'. After `git init`,
|
||||
`$GIT_DIR/hooks/post-update` copied from the standard templates
|
||||
would contain a call to 'git-update-server-info' but the
|
||||
`post-update` hook itself is disabled by default -- enable it
|
||||
with `chmod +x post-update`. This makes sure 'git-update-server-info'
|
||||
keeps the necessary files up-to-date.
|
||||
`$GIT_DIR/hooks/post-update.sample` copied from the standard templates
|
||||
would contain a call to 'git-update-server-info'
|
||||
but you need to manually enable the hook with
|
||||
`mv post-update.sample post-update`. This makes sure
|
||||
'git-update-server-info' keeps the necessary files up-to-date.
|
||||
|
||||
3. Push into the public repository from your primary
|
||||
repository.
|
||||
|
|
|
@ -1890,7 +1890,7 @@ adjustments to give web clients some extra information they need:
|
|||
$ mv proj.git /home/you/public_html/proj.git
|
||||
$ cd proj.git
|
||||
$ git --bare update-server-info
|
||||
$ chmod a+x hooks/post-update
|
||||
$ mv hooks/post-update.sample hooks/post-update
|
||||
-------------------------------------------------
|
||||
|
||||
(For an explanation of the last two lines, see
|
||||
|
|
|
@ -41,7 +41,7 @@ test_expect_success 'setup remote repository' '
|
|||
git clone --bare test_repo test_repo.git &&
|
||||
cd test_repo.git &&
|
||||
git --bare update-server-info &&
|
||||
chmod +x hooks/post-update &&
|
||||
mv hooks/post-update.sample hooks/post-update &&
|
||||
cd - &&
|
||||
mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
|
||||
'
|
||||
|
|
Loading…
Reference in a new issue