{"thread":{"id":"14944","subject":"[PATCH] Adjust for the new way of enabling the default post-update hook","startedAt":"2008-08-11T22:34:46Z","lastAt":"2008-08-11T23:15:58Z","messageCount":4,"participants":["Petr Baudis","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"86847","messageId":"20080811223446.8342.37008.stgit@localhost","threadId":"14944","inReplyTo":null,"subject":"[PATCH] Adjust for the new way of enabling the default post-update hook","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-11T22:34:46Z","receivedAt":"2008-08-11T22:34:46Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"The post-update hook, which is required to be enabled in order for\nthe repository to be accessible over HTTP, is not enabled by\nchmod a+x anymore, but instead by dropping the .sample suffix.\n\nThis patch emphasizes this change in the release notes (since\nI believe this is rather noticeable backwards-incompatible change).\nIt also adjusts the documentation which still described the old way\nand fixes t/t5540-http-push.sh, which was broken for 1.5 month\nbut apparently noone ever runs this test.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/RelNotes-1.6.0.txt   |    4 ++++\n Documentation/gitcore-tutorial.txt |   15 ++++++++-------\n Documentation/user-manual.txt      |    2 +-\n t/t5540-http-push.sh               |    2 +-\n 4 files changed, 14 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/RelNotes-1.6.0.txt b/Documentation/RelNotes-1.6.0.txt\nindex 8afb5b2..ad19122 100644\n--- a/Documentation/RelNotes-1.6.0.txt\n+++ b/Documentation/RelNotes-1.6.0.txt\n@@ -28,6 +28,10 @@ introduced in v1.5.2 and v1.4.4.5.  If you want to keep your repositories\n backwards compatible past these versions, set repack.useDeltaBaseOffset\n to false or pack.indexVersion to 1, respectively.\n \n+The standard way of making repositories friendly to dumb protocols\n+(i.e. HTTP) changed: instead of making hooks/post-update executable,\n+hooks/post-update.sample is to be moved to hooks/post-update.\n+\n GIT_CONFIG, which was only documented as affecting \"git config\", but\n actually affected all git commands, now only affects \"git config\".\n GIT_LOCAL_CONFIG, also only documented as affecting \"git config\" and\ndiff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt\nindex 49179b0..a417e59 100644\n--- a/Documentation/gitcore-tutorial.txt\n+++ b/Documentation/gitcore-tutorial.txt\n@@ -1366,8 +1366,9 @@ your login shell is 'bash', only `.bashrc` is read and not\n \n [NOTE]\n If you plan to publish this repository to be accessed over http,\n-you should do `chmod +x my-git.git/hooks/post-update` at this\n-point.  This makes sure that every time you push into this\n+you should do `mv my-git.git/hooks/post-update.sample\n+my-git.git/hooks/post-update` at this point.\n+This makes sure that every time you push into this\n repository, `git update-server-info` is run.\n \n Your \"public repository\" is now ready to accept your changes.\n@@ -1486,11 +1487,11 @@ A recommended workflow for a \"project lead\" goes like this:\n If other people are pulling from your repository over dumb\n transport protocols (HTTP), you need to keep this repository\n 'dumb transport friendly'.  After `git init`,\n-`$GIT_DIR/hooks/post-update` copied from the standard templates\n-would contain a call to 'git-update-server-info' but the\n-`post-update` hook itself is disabled by default -- enable it\n-with `chmod +x post-update`.  This makes sure 'git-update-server-info'\n-keeps the necessary files up-to-date.\n+`$GIT_DIR/hooks/post-update.sample` copied from the standard templates\n+would contain a call to 'git-update-server-info'\n+but you need to manually enable the hook with\n+`mv post-update.sample post-update`.  This makes sure\n+'git-update-server-info' keeps the necessary files up-to-date.\n \n 3. Push into the public repository from your primary\n    repository.\ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex e999211..08d1310 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -1890,7 +1890,7 @@ adjustments to give web clients some extra information they need:\n $ mv proj.git /home/you/public_html/proj.git\n $ cd proj.git\n $ git --bare update-server-info\n-$ chmod a+x hooks/post-update\n+$ mv hooks/post-update.sample hooks/post-update\n -------------------------------------------------\n \n (For an explanation of the last two lines, see\ndiff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh\nindex f8c17cd..b0d242e 100755\n--- a/t/t5540-http-push.sh\n+++ b/t/t5540-http-push.sh\n@@ -41,7 +41,7 @@ test_expect_success 'setup remote repository' '\n \tgit clone --bare test_repo test_repo.git &&\n \tcd test_repo.git &&\n \tgit --bare update-server-info &&\n-\tchmod +x hooks/post-update &&\n+\tmv hooks/post-update.sample hooks/post-update &&\n \tcd - &&\n \tmv test_repo.git \"$HTTPD_DOCUMENT_ROOT_PATH\"\n '\n"},{"id":"86849","messageId":"7vfxpbuplr.fsf@gitster.siamese.dyndns.org","threadId":"14944","inReplyTo":"20080811223446.8342.37008.stgit@localhost","subject":"Re: [PATCH] Adjust for the new way of enabling the default post-update hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-11T22:57:36Z","receivedAt":"2008-08-11T22:57:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n> The post-update hook, which is required to be enabled in order for\n> the repository to be accessible over HTTP, is not enabled by\n> chmod a+x anymore, but instead by dropping the .sample suffix.\n\nThanks for attention to the details.\n\n> This patch emphasizes this change in the release notes (since\n> I believe this is rather noticeable backwards-incompatible change).\n\nAnybody who tries to chmod an nonexisting file would notice, so I\npersonally think you are making a mountain out of a molehill.\n\nNevertheless, mentioning it in the release notes would be a good finishing\ntouch.\n\n> +The standard way of making repositories friendly to dumb protocols\n> +(i.e. HTTP) changed: instead of making hooks/post-update executable,\n> +hooks/post-update.sample is to be moved to hooks/post-update.\n\nI'm actually not very happy with the above wording that makes it sound as\nif any of the samples are part of any \"standard way\".\n\nThe only standard thing is to make sure update-server-info runs.  You do\nnot have to start from the sample hook to do so, even though it may be one\nof the easiest ways.\n\nThe rest of the patches look good, but have you actually made sure\nAsciiDoc markups are correct (I am not complaining, just asking, as I\nhaven't)?\n"},{"id":"86851","messageId":"20080811230540.GG10151@machine.or.cz","threadId":"14944","inReplyTo":"7vfxpbuplr.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Adjust for the new way of enabling the default post-update hook","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-11T23:05:40Z","receivedAt":"2008-08-11T23:05:40Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Mon, Aug 11, 2008 at 03:57:36PM -0700, Junio C Hamano wrote:\n> Petr Baudis <pasky@suse.cz> writes:\n> \n> > This patch emphasizes this change in the release notes (since\n> > I believe this is rather noticeable backwards-incompatible change).\n> \n> Anybody who tries to chmod an nonexisting file would notice, so I\n> personally think you are making a mountain out of a molehill.\n> \n> Nevertheless, mentioning it in the release notes would be a good finishing\n> touch.\n\nWell, my only point is that you might want to know that you have to\nmodify your scripts _before_ they break.\n\n> > +The standard way of making repositories friendly to dumb protocols\n> > +(i.e. HTTP) changed: instead of making hooks/post-update executable,\n> > +hooks/post-update.sample is to be moved to hooks/post-update.\n> \n> I'm actually not very happy with the above wording that makes it sound as\n> if any of the samples are part of any \"standard way\".\n> \n> The only standard thing is to make sure update-server-info runs.  You do\n> not have to start from the sample hook to do so, even though it may be one\n> of the easiest ways.\n\nThen the question is what is \"standard\" defined as, and why shouldn't\nthis be the standard way? This is how our user documentation (both the\nUser Manual and the Git Core Tutorial) teaches the users to do it.\n\n> The rest of the patches look good, but have you actually made sure\n> AsciiDoc markups are correct (I am not complaining, just asking, as I\n> haven't)?\n\nI haven't - actually, for various technical reasons, I don't even have\nAsciiDoc installed on my notebook right now. I plan to get around\nto investigate the problem, but didn't yet and I didn't want to hold\nthis off.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nThe next generation of interesting software will be done\non the Macintosh, not the IBM PC.  -- Bill Gates\n"},{"id":"86853","messageId":"7vbpzzuor5.fsf@gitster.siamese.dyndns.org","threadId":"14944","inReplyTo":"20080811230540.GG10151@machine.or.cz","subject":"Re: [PATCH] Adjust for the new way of enabling the default post-update hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-11T23:15:58Z","receivedAt":"2008-08-11T23:15:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>> The rest of the patches look good, but have you actually made sure\n>> AsciiDoc markups are correct (I am not complaining, just asking, as I\n>> haven't)?\n>\n> I haven't - actually, for various technical reasons, I don't even have\n> AsciiDoc installed on my notebook right now. I plan to get around\n> to investigate the problem, but didn't yet and I didn't want to hold\n> this off.\n\nThanks, I just wanted to know if I have to be extra careful about the\nmark-up.\n"}]}