@matheusbsbs / matheus-bagliano / commits / 7dce9918c7
Fork 0

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>

Petr Baudis committed Aug 12, 2008 at 00:34 UTC 7dce9918c72148139c3eb7a2a5c66b0df9ed415d
4 files changed +21 -14
Documentation/RelNotes-1.6.0.txt
+11 -5
@@ -28,6 +28,16 @@ introduced in v1.5.2 and v1.4.4.5. If you want to keep your repositories
28 backwards compatible past these versions, set repack.useDeltaBaseOffset
29 to false or pack.indexVersion to 1, respectively.
30
31 +We used to prevent sample hook scripts shipped in templates/ from
32 +triggering by default by relying on the fact that we install them as
33 +unexecutable, but on some filesystems, this approach does not work.
34 +They are now shipped with ".sample" suffix. If you want to activate
35 +any of these samples as-is, rename them to drop the ".sample" suffix,
36 +instead of running "chmod +x" on them. For example, you can rename
37 +hooks/post-update.sample to hooks/post-update to enable the sample
38 +hook that runs update-server-info, in order to make repositories
39 +friendly to dumb protocols (i.e. HTTP).
40 +
41 GIT_CONFIG, which was only documented as affecting "git config", but
42 actually affected all git commands, now only affects "git config".
43 GIT_LOCAL_CONFIG, also only documented as affecting "git config" and
@@ -56,11 +66,7 @@ Updates since v1.5.6
66 gangs.
67
68 * Sample hook scripts shipped in templates/ are now suffixed with
59 - *.sample. We used to prevent them from triggering by default by
60 - relying on the fact that we install them as unexecutable, but on
61 - some filesystems this approach does not work. Instead of running
62 - "chmod +x" on them, the users who want to activate these samples
63 - as-is can now rename them dropping *.sample suffix.
69 + *.sample.
70
71 * perl's in-place edit (-i) does not work well without backup files on Windows;
72 some tests are rewritten to cope with this.
Documentation/gitcore-tutorial.txt
+8 -7
@@ -1366,8 +1366,9 @@ your login shell is 'bash', only `.bashrc` is read and not
1366
1367 [NOTE]
1368 If you plan to publish this repository to be accessed over http,
1369 -you should do `chmod +x my-git.git/hooks/post-update` at this
1370 -point. This makes sure that every time you push into this
1369 +you should do `mv my-git.git/hooks/post-update.sample
1370 +my-git.git/hooks/post-update` at this point.
1371 +This makes sure that every time you push into this
1372 repository, `git update-server-info` is run.
1373
1374 Your "public repository" is now ready to accept your changes.
@@ -1486,11 +1487,11 @@ A recommended workflow for a "project lead" goes like this:
1487 If other people are pulling from your repository over dumb
1488 transport protocols (HTTP), you need to keep this repository
1489 'dumb transport friendly'. After `git init`,
1489 -`$GIT_DIR/hooks/post-update` copied from the standard templates
1490 -would contain a call to 'git-update-server-info' but the
1491 -`post-update` hook itself is disabled by default -- enable it
1492 -with `chmod +x post-update`. This makes sure 'git-update-server-info'
1493 -keeps the necessary files up-to-date.
1490 +`$GIT_DIR/hooks/post-update.sample` copied from the standard templates
1491 +would contain a call to 'git-update-server-info'
1492 +but you need to manually enable the hook with
1493 +`mv post-update.sample post-update`. This makes sure
1494 +'git-update-server-info' keeps the necessary files up-to-date.
1495
1496 3. Push into the public repository from your primary
1497 repository.
Documentation/user-manual.txt
+1 -1
@@ -1890,7 +1890,7 @@ adjustments to give web clients some extra information they need:
1890 $ mv proj.git /home/you/public_html/proj.git
1891 $ cd proj.git
1892 $ git --bare update-server-info
1893 -$ chmod a+x hooks/post-update
1893 +$ mv hooks/post-update.sample hooks/post-update
1894 -------------------------------------------------
1895
1896 (For an explanation of the last two lines, see
t/t5540-http-push.sh
+1 -1
@@ -41,7 +41,7 @@ test_expect_success 'setup remote repository' '
41 git clone --bare test_repo test_repo.git &&
42 cd test_repo.git &&
43 git --bare update-server-info &&
44 - chmod +x hooks/post-update &&
44 + mv hooks/post-update.sample hooks/post-update &&
45 cd - &&
46 mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
47 '