[PATCH] Adjust for the new way of enabling the default post-update hook

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Adjust for the new way of enabling the default post-update hook

Petr Baudis
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 <[hidden email]>
---

 Documentation/RelNotes-1.6.0.txt   |    4 ++++
 Documentation/gitcore-tutorial.txt |   15 ++++++++-------
 Documentation/user-manual.txt      |    2 +-
 t/t5540-http-push.sh               |    2 +-
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Documentation/RelNotes-1.6.0.txt b/Documentation/RelNotes-1.6.0.txt
index 8afb5b2..ad19122 100644
--- a/Documentation/RelNotes-1.6.0.txt
+++ b/Documentation/RelNotes-1.6.0.txt
@@ -28,6 +28,10 @@ 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.
 
+The standard way of making repositories friendly to dumb protocols
+(i.e. HTTP) changed: instead of making hooks/post-update executable,
+hooks/post-update.sample is to be moved to hooks/post-update.
+
 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
diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt
index 49179b0..a417e59 100644
--- a/Documentation/gitcore-tutorial.txt
+++ b/Documentation/gitcore-tutorial.txt
@@ -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.
diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
index e999211..08d1310 100644
--- a/Documentation/user-manual.txt
+++ b/Documentation/user-manual.txt
@@ -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
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index f8c17cd..b0d242e 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -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"
 '

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Adjust for the new way of enabling the default post-update hook

Junio C Hamano
Petr Baudis <[hidden email]> writes:

> 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.

Thanks for attention to the details.

> This patch emphasizes this change in the release notes (since
> I believe this is rather noticeable backwards-incompatible change).

Anybody who tries to chmod an nonexisting file would notice, so I
personally think you are making a mountain out of a molehill.

Nevertheless, mentioning it in the release notes would be a good finishing
touch.

> +The standard way of making repositories friendly to dumb protocols
> +(i.e. HTTP) changed: instead of making hooks/post-update executable,
> +hooks/post-update.sample is to be moved to hooks/post-update.

I'm actually not very happy with the above wording that makes it sound as
if any of the samples are part of any "standard way".

The only standard thing is to make sure update-server-info runs.  You do
not have to start from the sample hook to do so, even though it may be one
of the easiest ways.

The rest of the patches look good, but have you actually made sure
AsciiDoc markups are correct (I am not complaining, just asking, as I
haven't)?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Adjust for the new way of enabling the default post-update hook

Petr Baudis
On Mon, Aug 11, 2008 at 03:57:36PM -0700, Junio C Hamano wrote:

> Petr Baudis <[hidden email]> writes:
>
> > This patch emphasizes this change in the release notes (since
> > I believe this is rather noticeable backwards-incompatible change).
>
> Anybody who tries to chmod an nonexisting file would notice, so I
> personally think you are making a mountain out of a molehill.
>
> Nevertheless, mentioning it in the release notes would be a good finishing
> touch.

Well, my only point is that you might want to know that you have to
modify your scripts _before_ they break.

> > +The standard way of making repositories friendly to dumb protocols
> > +(i.e. HTTP) changed: instead of making hooks/post-update executable,
> > +hooks/post-update.sample is to be moved to hooks/post-update.
>
> I'm actually not very happy with the above wording that makes it sound as
> if any of the samples are part of any "standard way".
>
> The only standard thing is to make sure update-server-info runs.  You do
> not have to start from the sample hook to do so, even though it may be one
> of the easiest ways.

Then the question is what is "standard" defined as, and why shouldn't
this be the standard way? This is how our user documentation (both the
User Manual and the Git Core Tutorial) teaches the users to do it.

> The rest of the patches look good, but have you actually made sure
> AsciiDoc markups are correct (I am not complaining, just asking, as I
> haven't)?

I haven't - actually, for various technical reasons, I don't even have
AsciiDoc installed on my notebook right now. I plan to get around
to investigate the problem, but didn't yet and I didn't want to hold
this off.

--
                                Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC.  -- Bill Gates
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Adjust for the new way of enabling the default post-update hook

Junio C Hamano
Petr Baudis <[hidden email]> writes:

>> The rest of the patches look good, but have you actually made sure
>> AsciiDoc markups are correct (I am not complaining, just asking, as I
>> haven't)?
>
> I haven't - actually, for various technical reasons, I don't even have
> AsciiDoc installed on my notebook right now. I plan to get around
> to investigate the problem, but didn't yet and I didn't want to hold
> this off.

Thanks, I just wanted to know if I have to be extra careful about the
mark-up.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html