{"thread":{"id":"5891","subject":"cg-commit does not run pre-commit hook?","startedAt":"2006-10-11T20:30:54Z","lastAt":"2006-10-12T17:20:57Z","messageCount":8,"participants":["Wolfgang Denk","Petr Baudis","Andreas Ericsson","Linus Torvalds","Josef Weidendorfer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"28627","messageId":"20061011203054.C5F80353A48@atlas.denx.de","threadId":"5891","inReplyTo":null,"subject":"cg-commit does not run pre-commit hook?","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2006-10-11T20:30:54Z","receivedAt":"2006-10-11T20:30:54Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"Hi,\n\nI noticed that cg-commit does not run the pre-commit  hook.  Is  this\nintentional,  or  am  I  doing anyhting wrong? When I use git-coimmit\ninstead the hook is run just  fine.  This  is  with  git-1.4.2.1  and\ncogito-0.18 of FC4 / FC5 systems.\n\nBest regards,\n\nWolfgang Denk\n\n-- \nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\nThere are bugs and then there are bugs.  And then there are bugs.\n                                                    - Karl Lehenbauer\n"},{"id":"28650","messageId":"20061012011548.GT20017@pasky.or.cz","threadId":"5891","inReplyTo":"20061011203054.C5F80353A48@atlas.denx.de","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-12T01:15:48Z","receivedAt":"2006-10-12T01:15:48Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi,\n\nDear diary, on Wed, Oct 11, 2006 at 10:30:54PM CEST, I got a letter\nwhere Wolfgang Denk <wd@denx.de> said that...\n> I noticed that cg-commit does not run the pre-commit  hook.  Is  this\n> intentional,  or  am  I  doing anyhting wrong? When I use git-coimmit\n> instead the hook is run just  fine.  This  is  with  git-1.4.2.1  and\n> cogito-0.18 of FC4 / FC5 systems.\n\n  historically, Git and Cogito use a different set of hooks (Cogito got\nhooks first but Git picked own names and usage and now is prevalent).\nI have plans for making Cogito support Git hooks and slowly deprecate\nthose own ones for which Git has counterparts, but didn't get to it yet.\nI might do today during the more boring lectures... ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"},{"id":"28664","messageId":"20061012142736.74DE7353BDE@atlas.denx.de","threadId":"5891","inReplyTo":"20061012011548.GT20017@pasky.or.cz","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2006-10-12T14:27:36Z","receivedAt":"2006-10-12T14:27:36Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"Dear Petr,\n\nin message <20061012011548.GT20017@pasky.or.cz> you wrote:\n> \n>   historically, Git and Cogito use a different set of hooks (Cogito got\n> hooks first but Git picked own names and usage and now is prevalent).\n\nI see. And current versions of cogito don't support any pre-commit\nscript, right?\n\n> I have plans for making Cogito support Git hooks and slowly deprecate\n> those own ones for which Git has counterparts, but didn't get to it yet.\n> I might do today during the more boring lectures... ;-)\n\nKeeping my fingers crossed :-)\n\nI'm looking for a way  to  register  the  commit  message  into  some\nchangelog  file  which  gets  checked  in with the same commit. Or is\nthere another way to do this? \n\nBest regards,\n\nWolfgang Denk\n\n-- \nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\nThe goal of science is to build better mousetraps. The goal of nature\nis to build better mice.\n"},{"id":"28665","messageId":"452E545F.6060406@op5.se","threadId":"5891","inReplyTo":"20061012142736.74DE7353BDE@atlas.denx.de","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-10-12T14:42:39Z","receivedAt":"2006-10-12T14:42:39Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Wolfgang Denk wrote:\n> Dear Petr,\n> \n> in message <20061012011548.GT20017@pasky.or.cz> you wrote:\n>>   historically, Git and Cogito use a different set of hooks (Cogito got\n>> hooks first but Git picked own names and usage and now is prevalent).\n> \n> I see. And current versions of cogito don't support any pre-commit\n> script, right?\n> \n>> I have plans for making Cogito support Git hooks and slowly deprecate\n>> those own ones for which Git has counterparts, but didn't get to it yet.\n>> I might do today during the more boring lectures... ;-)\n> \n> Keeping my fingers crossed :-)\n> \n> I'm looking for a way  to  register  the  commit  message  into  some\n> changelog  file  which  gets  checked  in with the same commit. Or is\n> there another way to do this? \n> \n\ngit log\n\nThe commit message is already saved and git (and cogito, I presume) \nprovide tools to fetch those messages in the relevant different orders \n(although ordering by date is flakey sometimes; see list-archives for \ndiscussion).\n\nOne part of why a proper SCM is so good to use is that you shouldn't \nhave to maintain a separate changelog. The SCM should create one for you \nwhen you ask it, based on the comments you've entered when actually \nmaking the changes.\n\nThat aside, for actual releases, I generally write a short, gisted \n\"what's new\" thingie inside the tag, based on the shortlog output and my \nown memory. This comes in handy when management wants to have their \nversion of the shortlog, and developers can pretty easily find new \nfeatures by just sifting through the tag-messages.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"28669","messageId":"20061012155444.27391353BDE@atlas.denx.de","threadId":"5891","inReplyTo":"452E545F.6060406@op5.se","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2006-10-12T15:54:44Z","receivedAt":"2006-10-12T15:54:44Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"Dear Andreas,\n\nin message <452E545F.6060406@op5.se> you wrote:\n>\n> > I'm looking for a way  to  register  the  commit  message  into  some\n> > changelog  file  which  gets  checked  in with the same commit. Or is\n> > there another way to do this? \n> \n> git log\n\nSorry, this does not work, as I can access the  commit  message  only\n*after* the commit completed, and then it's too late to get it into a\nfile that shall be included with the very same commit.\n\n> The commit message is already saved and git (and cogito, I presume) \n> provide tools to fetch those messages in the relevant different orders \n\nYes, but only *after* doing the job. That's why  I'm  looking  for  a\npre-commit hook.\n\n> One part of why a proper SCM is so good to use is that you shouldn't \n> have to maintain a separate changelog. The SCM should create one for you \n> when you ask it, based on the comments you've entered when actually \n> making the changes.\n\nTrue, as long as you can work within the SCM. The changelog file  I'm\ntalking  about is mostly for people who just work with exported trees\n(for example, when they download a tarball).\n\n\nBest regards,\n\nWolfgang Denk\n\n-- \nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\nEveryting looks interesting until you do it. Then you find it's  just\nanother job.                     - Terry Pratchett, _Moving Pictures_\n"},{"id":"28673","messageId":"Pine.LNX.4.64.0610120957460.3952@g5.osdl.org","threadId":"5891","inReplyTo":"20061012155444.27391353BDE@atlas.denx.de","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-10-12T16:59:24Z","receivedAt":"2006-10-12T16:59:24Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 12 Oct 2006, Wolfgang Denk wrote:\n> > \n> > git log\n> \n> Sorry, this does not work, as I can access the  commit  message  only\n> *after* the commit completed, and then it's too late to get it into a\n> file that shall be included with the very same commit.\n\nWhy? That's just stupid.\n\nIf you want to have a ChangeLog file, it's _much_ better to just \nauto-generate it after the fact. When you cut a tar-file, just have the \nscript autogenerate the changelog then and there. Why do it inside the \nSCM that keeps track of the data _anyway_.\n\n> True, as long as you can work within the SCM. The changelog file  I'm\n> talking  about is mostly for people who just work with exported trees\n> (for example, when they download a tarball).\n\nRight - but it's easy enough to add it to the tar-ball, so..\n\n\t\tLinus\n"},{"id":"28674","messageId":"200610121902.14829.Josef.Weidendorfer@gmx.de","threadId":"5891","inReplyTo":"20061012155444.27391353BDE@atlas.denx.de","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-10-12T17:02:14Z","receivedAt":"2006-10-12T17:02:14Z","isPatch":false,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Thursday 12 October 2006 17:54, Wolfgang Denk wrote:\n> Yes, but only *after* doing the job. That's why  I'm  looking  for  a\n> pre-commit hook.\n\npre-commit is not good either, as it runs *before* the editor pops up.\nSo it can not access the commit message.\nYou ask for a \"pre-commit-post-edit\" hook, which AFAIK currently\nis not available in git.\n\n> True, as long as you can work within the SCM. The changelog file  I'm\n> talking  about is mostly for people who just work with exported trees\n> (for example, when they download a tarball).\n\nCan't you create the Changelog directly before preparing such an\ntarball?\n\nUsually when making a release/snapshot for a typical project, you\ncan not directly take the newest tree from the SCM, but need\nto generate some files (like configure with automake/autoconf).\n\nJosef\n\n> \n> \n> Best regards,\n> \n> Wolfgang Denk\n> \n"},{"id":"28675","messageId":"Pine.LNX.4.64.0610121011110.3952@g5.osdl.org","threadId":"5891","inReplyTo":"Pine.LNX.4.64.0610120957460.3952@g5.osdl.org","subject":"Re: cg-commit does not run pre-commit hook?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-10-12T17:20:57Z","receivedAt":"2006-10-12T17:20:57Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 12 Oct 2006, Linus Torvalds wrote:\n> \n> Why? That's just stupid.\n\nBtw, let me explain that strong statement, because it _is_ a strong \nstatement, but it's true.\n\nThe problem with trying to generate a changelog entry at commit time is \nthat it is fundamentally a broken concept in a distributed environment.\n\nWhat happens at a merge event? Sure, you can have special merge magic to \ntry to sort out the mess, but it _is_ a mess. You can make things \"work\", \nbut you can never actually make the result really make _sense_. The \nchangelog is fundamentally a serialization of something that wasn't \nserial.\n\nNow, the same serialization problem obviously exists when you \nauto-generate the changelog file when doing a release tar-ball or \nsomething like that, but at that point you basically \"fix\" it in time, so \nat that point the changelog actually makes sense.\n\nIt also turns out that in many situations, you can sort the result in \nother ways: the shortlog format, for example, is often superior to the \ndefault \"git log\" ordering, just because sorting things by person tends to \nactually result in a better view of what changed (it tells you something \nnew: clumping by author not onyl tends to clump similar commits together \nand thus tell more of a \"story\", but it also has the added advantage of \ntelling people who does what).\n\nGenerating things after-the-fact would also allow ordering things by what \nfiles (or subdirectories) they touch, although we've never done such a \nscript. I do that quite often privately by just restricting the log to \ncertain subsystems, though, and it's a damn useful thing to have. I would \nnot be surprised at all if it might make sense to actually do a \"tar-ball\" \nchangelog that way for certain projects - especially if they have clearly \nseparated sub-components.\n\n[ Btw, this whole \"do things by pathname\" has been so successful, that \n  I've come to realize that I would probably never accept an SCM that \n  doesn't allow something like that. Being able to do\n\n\tgitk some/random/set of/directories and/files\n\n  is just _incredibly_ useful. Maybe others don't do it as much as I do, \n  but as a top-level maintainer, being able to look at history from the \n  viewpoint of just a random subset of the tree is incredibly powerful.\n\n  I very strongly suspect that doing logs that way is often a good idea \n  too. ]\n\n\t\tLinus\n"}]}