From af6fb4c822a5a65c7671d810127171759dff38f6 Mon Sep 17 00:00:00 2001 From: Josh England Date: Tue, 11 Sep 2007 10:59:04 -0600 Subject: 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 Signed-off-by: Junio C Hamano --- Documentation/hooks.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Documentation/hooks.txt') diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt index 50535a7983..58b9547596 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 -- cgit v1.2.1