summaryrefslogtreecommitdiff
path: root/Documentation/hooks.txt
diff options
context:
space:
mode:
authorJosh England <jjengla@sandia.gov>2007-09-11 16:59:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-19 00:40:24 (GMT)
commitaf6fb4c822a5a65c7671d810127171759dff38f6 (patch)
tree8e72a9501f770d21dd28dd6363c96ff50d570811 /Documentation/hooks.txt
parent46232915d5ac84fb033ad395bbf161c9645c42c9 (diff)
downloadgit-af6fb4c822a5a65c7671d810127171759dff38f6.zip
git-af6fb4c822a5a65c7671d810127171759dff38f6.tar.gz
git-af6fb4c822a5a65c7671d810127171759dff38f6.tar.bz2
Added example hook script to save/restore permissions/ownership.
Usage info is emebed in the script, but the gist of it is to run the script from a pre-commit hook to save permissions/ownership data to a file and check that file into the repository. Then, a post_merge hook reads the file and updates working tree permissions/ownership. All updates are transparent to the user (although there is a --verbose option). Merge conflicts are handled in the "read" phase (in pre-commit), and the script aborts the commit and tells you how to fix things in the case of a merge conflict in the metadata file. This same idea could be extended to handle file ACLs or other file metadata if desired. Signed-off-by: Josh England <jjengla@sandia.gov> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/hooks.txt')
-rw-r--r--Documentation/hooks.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt
index 50535a7..58b9547 100644
--- a/Documentation/hooks.txt
+++ b/Documentation/hooks.txt
@@ -97,7 +97,8 @@ This hook cannot affect the outcome of `git-merge`.
This hook can be used in conjunction with a corresponding pre-commit hook to
save and restore any form of metadata associated with the working tree
-(eg: permissions/ownership, ACLS, etc).
+(eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl
+for an example of how to do this.
[[pre-receive]]
pre-receive