{"thread":{"id":"3598","subject":"Update hook in Cygwin","startedAt":"2006-03-08T12:16:56Z","lastAt":"2006-03-08T15:54:00Z","messageCount":4,"participants":["Niklas Höglund","Andreas Ericsson","Shawn Pearce","Christopher Faylor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17329","messageId":"ad8ce5c20603080416g5ed6d77el@mail.gmail.com","threadId":"3598","inReplyTo":null,"subject":"Update hook in Cygwin","fromName":"Niklas Höglund","fromEmail":"nhoglund@gmail.com","sentAt":"2006-03-08T12:16:56Z","receivedAt":"2006-03-08T12:16:56Z","isPatch":false,"sender":{"key":"nhoglund@gmail.com","avatar":"https://gravatar.com/avatar/7bacd9636e9e8e382a629679b90867195d3827a68acfe3094e59788afc1df9ac?d=mp&s=160"},"body":"Hi.\n\nAfter creating a couple of repositories and pushing and cloning them,\nI get the following:\n\n$ git push --all origin\n...\nhooks/update: line 88: mail: command not found\n\nThis is in cygwin. I'm rather glad I don't have the mail command\ninstalled, as I don't want mails going anywhere.\n\nThe update hook contains the following comment:\n\n# To enable this hook:\n# (1) change the recipient e-mail address\n# (2) make this file executable by \"chmod +x update\".\n\nBut my impression after a cursory look at it is that it would always\ncall \"mail\" whenever it is run, and since all files are executable in\nWindows (AFAIK), it would always be run.\n"},{"id":"17330","messageId":"440EDDE4.9070405@op5.se","threadId":"3598","inReplyTo":"ad8ce5c20603080416g5ed6d77el@mail.gmail.com","subject":"Re: Update hook in Cygwin","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-03-08T13:36:36Z","receivedAt":"2006-03-08T13:36:36Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Niklas Höglund wrote:\n> Hi.\n> \n> After creating a couple of repositories and pushing and cloning them,\n> I get the following:\n> \n> $ git push --all origin\n> ...\n> hooks/update: line 88: mail: command not found\n> \n> This is in cygwin. I'm rather glad I don't have the mail command\n> installed, as I don't want mails going anywhere.\n> \n> The update hook contains the following comment:\n> \n> # To enable this hook:\n> # (1) change the recipient e-mail address\n> # (2) make this file executable by \"chmod +x update\".\n> \n> But my impression after a cursory look at it is that it would always\n> call \"mail\" whenever it is run, and since all files are executable in\n> Windows (AFAIK), it would always be run.\n\n\nI was under the impression that the cygwin abstraction layer had some \nunixy permission thing on top of NTFS. Perhaps that's wrong. If you \nremove the hook it won't be called.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"17333","messageId":"20060308144413.GA516@spearce.org","threadId":"3598","inReplyTo":"440EDDE4.9070405@op5.se","subject":"Re: Update hook in Cygwin","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-03-08T14:44:13Z","receivedAt":"2006-03-08T14:44:13Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Andreas Ericsson <ae@op5.se> wrote:\n> Niklas Höglund wrote:\n> >Hi.\n> >\n> >After creating a couple of repositories and pushing and cloning them,\n> >I get the following:\n> >\n> >$ git push --all origin\n> >...\n> >hooks/update: line 88: mail: command not found\n> >\n> >This is in cygwin. I'm rather glad I don't have the mail command\n> >installed, as I don't want mails going anywhere.\n> >\n> >The update hook contains the following comment:\n> >\n> ># To enable this hook:\n> ># (1) change the recipient e-mail address\n> ># (2) make this file executable by \"chmod +x update\".\n> >\n> >But my impression after a cursory look at it is that it would always\n> >call \"mail\" whenever it is run, and since all files are executable in\n> >Windows (AFAIK), it would always be run.\n> \n> \n> I was under the impression that the cygwin abstraction layer had some \n> unixy permission thing on top of NTFS. Perhaps that's wrong. If you \n> remove the hook it won't be called.\n\nI've seen the same thing with the hooks on Cywin.  I would consider\nit to be a bug in either GIT or Cygwin but I haven't decided\nwhich yet.\n\nIf you look at the share/git-core/templates directory on a real\nUNIX system would see that the hooks are not marked executable by\ndefault when installed.  They are copied non-executable into each\nnew repository by git-init-db. Since they aren't executable they\ndon't get run.\n\n\nBut on Cygwin the hooks appear to be getting installed and are marked\nexecutable in share/git-core/templates.  So when git-init-db copies\nthem over to the new repository they are by default enabled.\n\nRemoving the execute bit from the files in share/git-core/templates\ndoesn't help; for some reason git-init-db is still copying them with\nthe execute bit enabled.  I haven't spent the time to figure out why\nyet; so I just run rm .git/hooks/* on every repository I come across.\n\nBTW: chmod a-x .git/hooks/* also works as the Cygwin unixy permission\nlayer will remember the change.\n\n-- \nShawn.\n"},{"id":"17334","messageId":"20060308155400.GE11231@trixie.casa.cgf.cx","threadId":"3598","inReplyTo":"20060308144413.GA516@spearce.org","subject":"Re: Update hook in Cygwin","fromName":"Christopher Faylor","fromEmail":"me@cgf.cx","sentAt":"2006-03-08T15:54:00Z","receivedAt":"2006-03-08T15:54:00Z","isPatch":false,"sender":{"key":"me@cgf.cx","avatar":null},"body":"On Wed, Mar 08, 2006 at 09:44:13AM -0500, Shawn Pearce wrote:\n>BTW: chmod a-x .git/hooks/* also works as the Cygwin unixy permission\n>layer will remember the change.\n\nUsing \"chmod a-x\" should work like linux as long as you're using an NTFS\nfilesystem and have not specifically turned off Cygwin's handling of this\nkind of thing with the CYGWIN=nontsec environment variable.\n\ni.e., it should work in most cases on W2K+\n\ncgf\n"}]}