{"thread":{"id":"28920","subject":"RFC: post-fetch hook","startedAt":"2011-11-12T19:44:14Z","lastAt":"2011-11-12T19:44:14Z","messageCount":1,"participants":["Joey Hess"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"179359","messageId":"20111112194414.GA3439@gnu.kitenet.net","threadId":"28920","inReplyTo":null,"subject":"RFC: post-fetch hook","fromName":"Joey Hess","fromEmail":"joey@kitenet.net","sentAt":"2011-11-12T19:44:14Z","receivedAt":"2011-11-12T19:44:14Z","isPatch":false,"sender":{"key":"joey@kitenet.net","avatar":"https://avatars.githubusercontent.com/u/16392?v=4"},"body":"A post-fetch hook would run on the local repository after a git-fetch or\ngit-pull. It would probably make sense for the hook to be sent the same\nformat input as the post-receive hook (although I don't need that information\nmyself). Like post-receive, it would not affect the outcome of the fetch. It\nshould be called late enough that it can manipulate the git repository\nusing the fetched refs.\n\nMy use case is in git-annex. It maintains its own, rather notes-like\nbranch. When remote versions of the branch have changed, they are\nautomatically merged into the local branch, using a union merge,\nthe next time git-annex is run. So normally it does not need this hook.\n\nBut, consider the case where git-annex has locally modified its branch,\nand the remote tracking branch has also been modified. Now the user does\n\"git pull; git push\". With the two git-annex branches diverged the\npush fails. The user has to manually run \"git annex merge\" before\npushing to handle this.\n\nIf there was a post-fetch hook, git-annex could make it always run\ngit annex merge, and users would not need to deal with this situation.\n\n-- \nsee shy jo\n"}]}