A post-fetch hook would run on the local repository after a git-fetch or git-pull. It would probably make sense for the hook to be sent the same format input as the post-receive hook (although I don't need that information myself). Like post-receive, it would not affect the outcome of the fetch. It should be called late enough that it can manipulate the git repository using the fetched refs. My use case is in git-annex. It maintains its own, rather notes-like branch. When remote versions of the branch have changed, they are automatically merged into the local branch, using a union merge, the next time git-annex is run. So normally it does not need this hook. But, consider the case where git-annex has locally modified its branch, and the remote tracking branch has also been modified. Now the user does "git pull; git push". With the two git-annex branches diverged the push fails. The user has to manually run "git annex merge" before pushing to handle this. If there was a post-fetch hook, git-annex could make it always run git annex merge, and users would not need to deal with this situation. -- see shy jo
Attachment:
signature.asc
Description: Digital signature