{"thread":{"id":"8984","subject":"Hook after pull ?","startedAt":"2007-07-11T14:41:19Z","lastAt":"2007-07-11T21:26:18Z","messageCount":5,"participants":["Claudio Scordino","Alex Riesen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47036","messageId":"4694EC0F.10003@gmail.com","threadId":"8984","inReplyTo":null,"subject":"Hook after pull ?","fromName":"Claudio Scordino","fromEmail":"cloud.of.andor@gmail.com","sentAt":"2007-07-11T14:41:19Z","receivedAt":"2007-07-11T14:41:19Z","isPatch":false,"sender":{"key":"cloud.of.andor@gmail.com","avatar":null},"body":"Hi all.\n\nDoes any hook being called after the pull (that means, after fetch or merge) ?\n\nIf no, does exist any easy way of creating such hook ?\n\nMany thanks in advance,\n\n           Claudio\n"},{"id":"47037","messageId":"81b0412b0707110751i7947ac5bv819e1c2de4e94621@mail.gmail.com","threadId":"8984","inReplyTo":"4694EC0F.10003@gmail.com","subject":"Re: Hook after pull ?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-11T14:51:44Z","receivedAt":"2007-07-11T14:51:44Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/11/07, Claudio Scordino <cloud.of.andor@gmail.com> wrote:\n> Hi all.\n>\n> Does any hook being called after the pull (that means, after fetch or merge) ?\n>\n\nThere are some\n\n> If no, does exist any easy way of creating such hook ?\n>\n\nWhat for? What do you want to do?\n"},{"id":"47042","messageId":"4694F74F.8050908@gmail.com","threadId":"8984","inReplyTo":"81b0412b0707110751i7947ac5bv819e1c2de4e94621@mail.gmail.com","subject":"Re: Hook after pull ?","fromName":"Claudio Scordino","fromEmail":"cloud.of.andor@gmail.com","sentAt":"2007-07-11T15:29:19Z","receivedAt":"2007-07-11T15:29:19Z","isPatch":false,"sender":{"key":"cloud.of.andor@gmail.com","avatar":null},"body":"Alex Riesen wrote:\n> On 7/11/07, Claudio Scordino <cloud.of.andor@gmail.com> wrote:\n>> Hi all.\n>>\n>> Does any hook being called after the pull (that means, after fetch or \n>> merge) ?\n>>\n> \n> There are some\n\nWhich one of those inside the .git/hooks directory is called afret a pull?\n\n> \n>> If no, does exist any easy way of creating such hook ?\n>>\n> \n> What for? What do you want to do?\n> \nI just need my script to be called after a pull. My script just sends an email \nsaying that the repository has been pulled (I already did it for the push).\n\nThanks,\n\n         Claudio\n"},{"id":"47055","messageId":"20070711183341.GA2798@steel.home","threadId":"8984","inReplyTo":"4694F74F.8050908@gmail.com","subject":"Re: Hook after pull ?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-11T18:33:41Z","receivedAt":"2007-07-11T18:33:41Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Claudio Scordino, Wed, Jul 11, 2007 17:29:19 +0200:\n> >>If no, does exist any easy way of creating such hook ?\n> >\n> >What for? What do you want to do?\n> >\n> I just need my script to be called after a pull. My script just sends an \n> email saying that the repository has been pulled (I already did it for the \n> push).\n\nAch, on _remote_ repo. Where it is _pulled_from_.\nThere are none. You can catch log output of git-daemon, but...\nIsn't it a bit extreme? A fetch (part of a pull) is *very* common\noperation, sometime you'll get a *real* lot of mail.\n\nP.S. BTW, there is no hooks for pull in local (where it is pulled\ninto): it is not needed, you already control everything what happens.\nBut it is not your situation, as far I understand.\n"},{"id":"47080","messageId":"7vk5t63a4l.fsf@assigned-by-dhcp.cox.net","threadId":"8984","inReplyTo":"20070711183341.GA2798@steel.home","subject":"Re: Hook after pull ?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-11T21:26:18Z","receivedAt":"2007-07-11T21:26:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alex Riesen <raa.lkml@gmail.com> writes:\n\n> Claudio Scordino, Wed, Jul 11, 2007 17:29:19 +0200:\n>> >>If no, does exist any easy way of creating such hook ?\n>> >\n>> >What for? What do you want to do?\n>> >\n>> I just need my script to be called after a pull. My script just sends an \n>> email saying that the repository has been pulled (I already did it for the \n>> push).\n>\n> Ach, on _remote_ repo. Where it is _pulled_from_.\n> There are none. You can catch log output of git-daemon, but...\n> Isn't it a bit extreme? A fetch (part of a pull) is *very* common\n> operation, sometime you'll get a *real* lot of mail.\n>\n> P.S. BTW, there is no hooks for pull in local (where it is pulled\n> into): it is not needed, you already control everything what happens.\n\nI am not sure I am reading this exchange correctly, but I think\nClaudio wants to say\n\n\t$ git pull repo.or.cz:somebody/project.git/ the-branch \n\nand have it automatically send e-mail to the somebody (obviously\nthe hook script needs to have a mapping from the repository to\nwhom to notify).  As the daemon side cannot tell if the local is\nonly fetching (and possibly discarding the result) or pulling\n(resulting in a merge), I do not think it is reasonable to do\nthe hooking on the remote side.  It has to be done on the local\nif ever.\n\nAs you said, the local side has all the control, so in the\nstrictest sense there is no need for post-* hook, but we do\nsupport a few hooks for local operations, such as post-commit.\n\n(Sam Vilain CC'ed as he wanted to have hooks during and after a\nmerge).\n\nI suspect that a post merge hook (that also is called in\nfast-forward case) would be a good thing to have if people would\nwant to do this kind of thing often.  The hook most likely wants\nto get the ORIG_HEAD and the updated HEAD as parameters, and can\nact differently based on the nature of the merge (e.g. was it\nfast-forward, was it a merge between the commits made by the\nsame committer as myself, etc.)\n"}]}