{"thread":{"id":"17917","subject":"pre-commit hook","startedAt":"2009-02-20T09:11:27Z","lastAt":"2009-02-22T14:13:59Z","messageCount":7,"participants":["bill lam","Junio C Hamano","Michael J Gruber","Sverre Rabbelier"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"105588","messageId":"20090220091127.GA7415@b2j","threadId":"17917","inReplyTo":null,"subject":"pre-commit hook","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-02-20T09:11:27Z","receivedAt":"2009-02-20T09:11:27Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"The pre-commit hooks as follows.\n\n 10 # This is slightly modified from Andrew Morton's Perfect Patch.\n 11 # Lines you introduce should not have trailing whitespace.\n 12 # Also check for an indentation that has SP before a TAB.\n 13 \n 14 if git-rev-parse --verify HEAD 2>/dev/null\n 15 then\n 16   git-diff-index -p -M --cached HEAD --\n 17 else\n 18   # NEEDSWORK: we should produce a diff with an empty tree here\n 19   # if we want to do the same verification for the initial import.\n 20   :                                                                                                                        \n 21 fi |\n 22 perl -e '\n\nWill it also include binary files and thus corrupt data? And\n\"git-rev-parse\" should already deprecated.\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n唐詩232 孟浩然  春曉\n    春眠不覺曉  處處聞啼鳥  夜來風雨聲  花落知多少\n"},{"id":"105622","messageId":"7v63j5t6r3.fsf@gitster.siamese.dyndns.org","threadId":"17917","inReplyTo":"20090220091127.GA7415@b2j","subject":"Re: pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-20T16:25:52Z","receivedAt":"2009-02-20T16:25:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"bill lam <cbill.lam@gmail.com> writes:\n\n> The pre-commit hooks as follows.\n>\n>  10 # This is slightly modified from Andrew Morton's Perfect Patch.\n>  11 # Lines you introduce should not have trailing whitespace.\n\nThat's a sample hook from an ancient version of git.  We do not ship that\nversion anymore since late last June.  You should be able to replace it\nwith the version shipped with v1.6.0 or later if your git is recent\nenough.\n\n    #!/bin/sh\n    #\n    # An example hook script to verify what is about to be committed.\n    # Called by git-commit with no arguments.  The hook should\n    # exit with non-zero status after issuing an appropriate message if\n    # it wants to stop the commit.\n    #\n    # To enable this hook, rename this file to \"pre-commit\".\n\n    if git-rev-parse --verify HEAD 2>/dev/null\n    then\n            against=HEAD\n    else\n            # Initial commit: diff against an empty tree object\n            against=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n    fi\n\n    exec git diff-index --check --cached $against --\n\nPerhaps a time to upgrade?  People should be running at least 1.6.0 these\ndays ;-).\n"},{"id":"105687","messageId":"20090221035748.GC7409@b2j","threadId":"17917","inReplyTo":"7v63j5t6r3.fsf@gitster.siamese.dyndns.org","subject":"Re: pre-commit hook","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-02-21T03:57:48Z","receivedAt":"2009-02-21T03:57:48Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"On Fri, 20 Feb 2009, Junio C Hamano wrote:\n>     if git-rev-parse --verify HEAD 2>/dev/null\n\nIsn't git-rev-parse (and all git-??? ) was deprecated in 1.6.2 ?\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n唐詩311 無名氏  雜詩\n    盡寒食雨草萋萋  著麥苗風柳映堤  等是有家歸未得  杜鵑休向耳邊啼\n"},{"id":"105705","messageId":"499FE579.1050700@drmicha.warpmail.net","threadId":"17917","inReplyTo":"20090221035748.GC7409@b2j","subject":"Re: pre-commit hook","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-02-21T11:28:57Z","receivedAt":"2009-02-21T11:28:57Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"bill lam venit, vidit, dixit 21.02.2009 04:57:\n> On Fri, 20 Feb 2009, Junio C Hamano wrote:\n>>     if git-rev-parse --verify HEAD 2>/dev/null\n> \n> Isn't git-rev-parse (and all git-??? ) was deprecated in 1.6.2 ?\n> \n\nIt's OK in hooks because the path is set appropriately there.\n\nMichael\n"},{"id":"105758","messageId":"20090222105838.GB8029@b2j","threadId":"17917","inReplyTo":"499FE579.1050700@drmicha.warpmail.net","subject":"Re: pre-commit hook","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-02-22T10:58:38Z","receivedAt":"2009-02-22T10:58:38Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"On Sat, 21 Feb 2009, Michael J Gruber wrote:\n> > Isn't git-rev-parse (and all git-??? ) was deprecated in 1.6.2 ?\n> > \n> \n> It's OK in hooks because the path is set appropriately there.\n\nI make and install with prefix=/usr/bin , however I can only find git\ninside /usr/bin; other git-???? are missing although they are built.\n\"which git-rev-parse\" return nothing but \"git rev-parse\" can work.\nWhere are these git commands stored and how does the git locate them ?\n \n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n唐詩169 僧皎然  尋陸鴻漸不遇\n    移家雖帶郭  野徑入桑麻  近種籬邊菊  秋來未著花\n    扣門無犬吠  欲去問西家  報到山中去  歸來每日斜\n"},{"id":"105760","messageId":"fabb9a1e0902220317m3f241bf4y118c5dee4cf0c06b@mail.gmail.com","threadId":"17917","inReplyTo":"20090222105838.GB8029@b2j","subject":"Re: pre-commit hook","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-02-22T11:17:53Z","receivedAt":"2009-02-22T11:17:53Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"2009/2/22 bill lam <cbill.lam@gmail.com>:\n> I make and install with prefix=/usr/bin , however I can only find git\n> inside /usr/bin; other git-???? are missing although they are built.\n> \"which git-rev-parse\" return nothing but \"git rev-parse\" can work.\n> Where are these git commands stored and how does the git locate them ?\n\nHave a look at the output of `git --exec-path`.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"105772","messageId":"20090222141359.GA7403@b2j","threadId":"17917","inReplyTo":"fabb9a1e0902220317m3f241bf4y118c5dee4cf0c06b@mail.gmail.com","subject":"Re: pre-commit hook","fromName":"bill lam","fromEmail":"cbill.lam@gmail.com","sentAt":"2009-02-22T14:13:59Z","receivedAt":"2009-02-22T14:13:59Z","isPatch":false,"sender":{"key":"cbill.lam@gmail.com","avatar":null},"body":"On Sun, 22 Feb 2009, Sverre Rabbelier wrote:\n> Have a look at the output of `git --exec-path`.\n\nThanks, Sverre.\n\n-- \nregards,\n====================================================\nGPG key 1024D/4434BAB3 2008-08-24\ngpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3\n唐詩021 王昌齡  同從弟南齋翫月憶山陰崔少府\n    高臥南齋時  開帷月初吐  清輝淡水木  演漾在窗戶  苒苒幾盈虛  澄澄變今古\n    美人清江畔  是夜越吟苦  千里其如何  微風吹蘭杜\n"}]}