{"thread":{"id":"6988","subject":"Replacement for cvs2cl, for generating ChangeLog","startedAt":"2007-02-27T11:41:28Z","lastAt":"2007-02-28T21:31:27Z","messageCount":19,"participants":["Simon Josefsson","Junio C Hamano","Johannes Schindelin","Andy Parkins","Sergey Vlasov","Robin Rosenberg","Yann Dirson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35593","messageId":"877iu3q13r.fsf@latte.josefsson.org","threadId":"6988","inReplyTo":null,"subject":"Replacement for cvs2cl, for generating ChangeLog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-02-27T11:41:28Z","receivedAt":"2007-02-27T11:41:28Z","isPatch":false,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Hi!  I'm considering switching to git for my projects (shishi, gsasl,\ngnutls, libtasn1, opencdk, ...) and I have some questions:\n\n* How do I discard all locally modified or added files?  'cvs upd -C'\n  does some of that, but I've been using a tool 'cvsco' which quickly\n  restore a CVS checkout into a pristine state.\n\n* Is there a tool that produce ChangeLog files in the GNU format,\n  based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n  should look like:\n\n2007-02-22  Simon Josefsson <simon@josefsson.org>\n\n\t* link-warning.h, gl/getaddrinfo.c, gl/gnulib.mk, gl/string_.h,\n\tgl/m4/gnulib-comp.m4, gl/m4/string_h.m4, lgl/Makefile.am,\n\tlgl/snprintf.c, lgl/snprintf.h, lgl/stdio_.h, lgl/string_.h,\n\tlgl/unistd_.h, lgl/m4/gnulib-comp.m4, lgl/m4/intdiv0.m4,\n\tlgl/m4/snprintf.m4, lgl/m4/stdio_h.m4, lgl/m4/string_h.m4,\n\tlgl/m4/unistd_h.m4: Update.\n\nThanks,\nSimon\n"},{"id":"35596","messageId":"7vzm6zg56d.fsf@assigned-by-dhcp.cox.net","threadId":"6988","inReplyTo":"877iu3q13r.fsf@latte.josefsson.org","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T12:23:38Z","receivedAt":"2007-02-27T12:23:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Simon Josefsson <simon@josefsson.org> writes:\n\n> Hi!  I'm considering switching to git for my projects (shishi, gsasl,\n> gnutls, libtasn1, opencdk, ...) and I have some questions:\n>\n> * How do I discard all locally modified or added files?  'cvs upd -C'\n>   does some of that, but I've been using a tool 'cvsco' which quickly\n>   restore a CVS checkout into a pristine state.\n\n\"git reset --hard\" (RTFM).\n\n> * Is there a tool that produce ChangeLog files in the GNU format,\n>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n>   should look like:\n\nNo, but that should probably be trivial.  I would suggest you\npostprocess \"git log --pretty --numstat --summary\" output, which\nis probably the most parsable.\n"},{"id":"35600","messageId":"Pine.LNX.4.63.0702271336050.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"877iu3q13r.fsf@latte.josefsson.org","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T12:37:23Z","receivedAt":"2007-02-27T12:37:23Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Simon Josefsson wrote:\n\n> Hi!  I'm considering switching to git for my projects (shishi, gsasl,\n> gnutls, libtasn1, opencdk, ...) and I have some questions:\n> \n> * How do I discard all locally modified or added files?  'cvs upd -C'\n>   does some of that, but I've been using a tool 'cvsco' which quickly\n>   restore a CVS checkout into a pristine state.\n\nThe command in git is called \"git reset --hard\". Beware: this really, \nreally loses _all_ local changes. And no need to worry when it completes \nmuch faster than you expected it to... See \"git status\" to see that it \nworked, indeed.\n \n> * Is there a tool that produce ChangeLog files in the GNU format,\n>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n>   should look like:\n> \n> 2007-02-22  Simon Josefsson <simon@josefsson.org>\n> \n> \t* link-warning.h, gl/getaddrinfo.c, gl/gnulib.mk, gl/string_.h,\n> \tgl/m4/gnulib-comp.m4, gl/m4/string_h.m4, lgl/Makefile.am,\n> \tlgl/snprintf.c, lgl/snprintf.h, lgl/stdio_.h, lgl/string_.h,\n> \tlgl/unistd_.h, lgl/m4/gnulib-comp.m4, lgl/m4/intdiv0.m4,\n> \tlgl/m4/snprintf.m4, lgl/m4/stdio_h.m4, lgl/m4/string_h.m4,\n> \tlgl/m4/unistd_h.m4: Update.\n\nLet me hack something.\n\nCiao,\nDscho\n"},{"id":"35608","messageId":"200702271257.37437.andyparkins@gmail.com","threadId":"6988","inReplyTo":"877iu3q13r.fsf@latte.josefsson.org","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-02-27T12:57:36Z","receivedAt":"2007-02-27T12:57:36Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 February 27 11:41, Simon Josefsson wrote:\n\n> * How do I discard all locally modified or added files?  'cvs upd -C'\n>   does some of that, but I've been using a tool 'cvsco' which quickly\n>   restore a CVS checkout into a pristine state.\n\nIf I understand you correctly (\"locally\" has slightly ambiguous meaning when \nthe repository is local as well), the following would restore a working \ndirectory to be identical to the current HEAD.\n\n git checkout -f HEAD\n\nThe \"-f\" means force - i.e. don't worry about discarding local changes :-)\n\n> * Is there a tool that produce ChangeLog files in the GNU format,\n>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n>   should look like:\n\nNot that I know of, but git has some lovely log generation tools, so I'm sure \nit could be easily done with a snippet of perl - or perhaps a change to git's \nown log generator to support\n\n git-rev-list --pretty=gnucl\n\nwould be more appropriate.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"35620","messageId":"20070227174035.f85e8643.vsu@altlinux.ru","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702271336050.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Sergey Vlasov","fromEmail":"vsu@altlinux.ru","sentAt":"2007-02-27T14:40:35Z","receivedAt":"2007-02-27T14:40:35Z","isPatch":false,"sender":{"key":"vsu@altlinux.ru","avatar":"https://avatars.githubusercontent.com/u/616082?v=4"},"body":"On Tue, 27 Feb 2007 13:37:23 +0100 (CET) Johannes Schindelin wrote:\n\n> On Tue, 27 Feb 2007, Simon Josefsson wrote:\n>\n> > Hi!  I'm considering switching to git for my projects (shishi, gsasl,\n> > gnutls, libtasn1, opencdk, ...) and I have some questions:\n> >\n> > * How do I discard all locally modified or added files?  'cvs upd -C'\n> >   does some of that, but I've been using a tool 'cvsco' which quickly\n> >   restore a CVS checkout into a pristine state.\n>\n> The command in git is called \"git reset --hard\". Beware: this really,\n> really loses _all_ local changes. And no need to worry when it completes\n> much faster than you expected it to... See \"git status\" to see that it\n> worked, indeed.\n\nBut \"git reset --hard\" won't touch untracked files (this command is\nsimilar to \"cvs update -C\", but does not save old contents anywhere).\nIf what is really needed is to clean out build products, editor backups\nand other files which are not tracked by git, \"git clean -d -x\" will do\nit (but this command will keep local changes to tracked files - an\nadditional \"git reset --hard\" is needed to restore them to the last\ncommitted state).\n"},{"id":"35622","messageId":"Pine.LNX.4.63.0702271618210.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702271336050.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T15:19:33Z","receivedAt":"2007-02-27T15:19:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Johannes Schindelin wrote:\n\n> On Tue, 27 Feb 2007, Simon Josefsson wrote:\n> \n> > * Is there a tool that produce ChangeLog files in the GNU format,\n> >   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n> >   should look like:\n> > \n> > 2007-02-22  Simon Josefsson <simon@josefsson.org>\n> > \n> > \t* link-warning.h, gl/getaddrinfo.c, gl/gnulib.mk, gl/string_.h,\n> > \tgl/m4/gnulib-comp.m4, gl/m4/string_h.m4, lgl/Makefile.am,\n> > \tlgl/snprintf.c, lgl/snprintf.h, lgl/stdio_.h, lgl/string_.h,\n> > \tlgl/unistd_.h, lgl/m4/gnulib-comp.m4, lgl/m4/intdiv0.m4,\n> > \tlgl/m4/snprintf.m4, lgl/m4/stdio_h.m4, lgl/m4/string_h.m4,\n> > \tlgl/m4/unistd_h.m4: Update.\n> \n> Let me hack something.\n\nSee my next three posts. This patch series is on top of \"next\" (it does \nnot apply cleanly to \"master\", since the format \"format:\" conflicts...).\n\nCiao,\nDscho\n"},{"id":"35631","messageId":"Pine.LNX.4.63.0702271648430.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"200702271257.37437.andyparkins@gmail.com","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T15:56:32Z","receivedAt":"2007-02-27T15:56:32Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Andy Parkins wrote:\n\n> [...] perhaps a change to git's own log generator to support\n> \n>  git-rev-list --pretty=gnucl\n> \n> would be more appropriate.\n\nI was already hacking on a builtin changelog command, because I was \nconvinced that this breaks our model in builtin-log: We show the commit \ninformation first, and _then_ we call the diff machinery. And GNU \nChangeLog format mixes these informations: the date and the author are \ncommit information, but the files are tree information, and the oneline is \ncommit information again.\n\nHowever, your mail made me think again.\n\nI now reused (AKA misused) the stats separator to take the oneline \ndescription, which is set in show_log() when revs->commit_format == \nCMIT_FMT_CHANGELOG, which is output by diff_flush() when the \ndiff_options->output_format == DIFF_FORMAT_CHANGELOG.\n\nBTW I already found a subtle bug. In finalize_changelog(), \noptions->stat_sep can be NULL, if no oneline was found.\n\nBut AFAIK we do not allow empty commit messages, so this bug would never \nhave been triggered.\n\nCiao,\nDscho\n"},{"id":"35650","messageId":"7v8xejflk2.fsf@assigned-by-dhcp.cox.net","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702271336050.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T19:27:25Z","receivedAt":"2007-02-27T19:27:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Tue, 27 Feb 2007, Simon Josefsson wrote:\n>\n>> * Is there a tool that produce ChangeLog files in the GNU format,\n>>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n>>   should look like:\n>> ...\n> Let me hack something.\n\nI do not know why you want to pile something like this into\nbuiltin-log.  It would add maintenance burden and I do not see a\ngain from it.\n\nOne beauty of git is being scriptable.  When somebody new asks\nfor something like this, I think it is much more productive to\ndemonstrate the power of scriptability than piling random crap\nin the core.\n"},{"id":"35654","messageId":"Pine.LNX.4.63.0702272040440.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"7v8xejflk2.fsf@assigned-by-dhcp.cox.net","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T19:45:03Z","receivedAt":"2007-02-27T19:45:03Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Tue, 27 Feb 2007, Simon Josefsson wrote:\n> >\n> >> * Is there a tool that produce ChangeLog files in the GNU format,\n> >>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n> >>   should look like:\n> >> ...\n> > Let me hack something.\n> \n> I do not know why you want to pile something like this into builtin-log.  \n> It would add maintenance burden and I do not see a gain from it.\n> \n> One beauty of git is being scriptable.  When somebody new asks for \n> something like this, I think it is much more productive to demonstrate \n> the power of scriptability than piling random crap in the core.\n\nWell, I briefly considered writing a little Perl script using the output \nof \"git log --stat\".\n\nBUT. GNU ChangeLog is a really often asked-for feature. And before risking \nsome Haskell script producing GNU ChangeLog output in git.git, which I \nhave to rewrite as plugin eventually anyway, I thought that I include it \nright away.\n\nDemonstrating the ease of Git's core, and hacking on Git was a benefit \nfrom it.\n\nAs were the first two patches: I think print_wrapped_text() only now got \nusable. And show_date() with an enum should be an improvement, too.\n\nAnyway, it was the third time I read about such a request, and I had a go \nat it. If you don't like it, don't take it. I have no problems with that.\n\nCiao,\nDscho\n"},{"id":"35684","messageId":"Pine.LNX.4.63.0702272152460.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702272040440.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T20:54:10Z","receivedAt":"2007-02-27T20:54:10Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Johannes Schindelin wrote:\n\n> On Tue, 27 Feb 2007, Junio C Hamano wrote:\n> \n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > \n> > > On Tue, 27 Feb 2007, Simon Josefsson wrote:\n> > >\n> > >> * Is there a tool that produce ChangeLog files in the GNU format,\n> > >>   based on the git logs?  Similar to the 'cvs2cl' tool.  The output\n> > >>   should look like:\n> > >> ...\n> > > Let me hack something.\n> > \n> > I do not know why you want to pile something like this into \n> > builtin-log.  It would add maintenance burden and I do not see a gain \n> > from it.\n> > \n> > One beauty of git is being scriptable.  When somebody new asks for \n> > something like this, I think it is much more productive to demonstrate \n> > the power of scriptability than piling random crap in the core.\n> \n> Well, I briefly considered writing a little Perl script using the output \n> of \"git log --stat\".\n\nSide note. I am not a good enough Perl/Shell/Python hacker to know how to \nwrap text correctly to reflect GNU ChangeLog format. That is why I wrote \nprint_wrapped_text() in the first place.\n\nCiao,\nDscho\n"},{"id":"35687","messageId":"200702272227.05244.robin.rosenberg.lists@dewire.com","threadId":"6988","inReplyTo":"200702271257.37437.andyparkins@gmail.com","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-02-27T21:27:05Z","receivedAt":"2007-02-27T21:27:05Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 27 februari 2007 13:57 skrev Andy Parkins:\n> On Tuesday 2007 February 27 11:41, Simon Josefsson wrote:\n> \n> > * How do I discard all locally modified or added files?  'cvs upd -C'\n> >   does some of that, but I've been using a tool 'cvsco' which quickly\n> >   restore a CVS checkout into a pristine state.\n> \n> Not that I know of, but git has some lovely log generation tools, so I'm sure \n> it could be easily done with a snippet of perl - or perhaps a change to git's \n> own log generator to support\n> \n>  git-rev-list --pretty=gnucl\n> \ngir-rev-list ??\n\nExtend git-shortlog with --gnucl instead. What seems missing is the grouping\nof changes by date. git-shortlog only groups by author.\n\n-- robin\n"},{"id":"35696","messageId":"7v649nclsq.fsf@assigned-by-dhcp.cox.net","threadId":"6988","inReplyTo":"200702272227.05244.robin.rosenberg.lists@dewire.com","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T21:50:29Z","receivedAt":"2007-02-27T21:50:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:\n\n> tisdag 27 februari 2007 13:57 skrev Andy Parkins:\n>> On Tuesday 2007 February 27 11:41, Simon Josefsson wrote:\n>> \n>> > * How do I discard all locally modified or added files?  'cvs upd -C'\n>> >   does some of that, but I've been using a tool 'cvsco' which quickly\n>> >   restore a CVS checkout into a pristine state.\n>> \n>> Not that I know of, but git has some lovely log generation tools, so I'm sure \n>> it could be easily done with a snippet of perl - or perhaps a change to git's \n>> own log generator to support\n>> \n>>  git-rev-list --pretty=gnucl\n>> \n> gir-rev-list ??\n>\n> Extend git-shortlog with --gnucl instead. What seems missing is the grouping\n> of changes by date. git-shortlog only groups by author.\n\nIf GNU changelog _were_ to have one entry per day, mixing\nchanges from different commits together, that might be a good\napproach. I do not think GNU changelog guideline can be _THAT_\nbroken.\n\nListing of filenames of changed files in the log, followed by\nshort description of the nature of the change (e.g. \"Updated to\ndo blah\", \"New File\"), shows the CVS mentality \"File matters\",\nand that was what Simon's original example showed.  It's been a\nwhile I looked at the coding guideline the last time, but I\nthink GNU convention wants you to say \"filename (function)\" when\napplicable.  Which I happen to think makes much more sense than\nthe filename alone.\n\nThe information that would appear in \"log -p --pretty\" output\nneeds to be condensed to obtain such a log entry.  You _could_\nstill do that as a built-in if you really wanted to, but I tend\nto think that it is much better to implement such a specialized\nprocessing (for one thing, what a function is depends on the\nprogramming language you are reading from) as an external\npostprocessing filter that people can more easily tweak for\ntheir specific needs.\n\nThat's why I keep stressing that one good thing about git is it\nis easily scriptable.\n"},{"id":"35701","messageId":"Pine.LNX.4.63.0702272227500.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"200702272227.05244.robin.rosenberg.lists@dewire.com","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T22:12:39Z","receivedAt":"2007-02-27T22:12:39Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Robin Rosenberg wrote:\n\n> tisdag 27 februari 2007 13:57 skrev Andy Parkins:\n> \n> > Not that I know of, but git has some lovely log generation tools, so \n> > I'm sure it could be easily done with a snippet of perl - or perhaps a \n> > change to git's own log generator to support\n> > \n> >  git-rev-list --pretty=gnucl\n> > \n> gir-rev-list ??\n> \n> Extend git-shortlog with --gnucl instead. What seems missing is the \n> grouping of changes by date. git-shortlog only groups by author.\n\nNo, the revision walker groups by commit (not by date, but you don't want \nthat anyway). git-shortlog works _on top_ of the revision walker.\n\nThe sane thing _is_ to use the revision walker.\n\nGiven the amount of projects using cvs2cl (I personally saw a couple), I \nexpect a couple of people to speak up in favour of including support for \n--pretty=cl or =changelog or =gnucl or whatever.\n\nCiao,\nDscho\n"},{"id":"35704","messageId":"Pine.LNX.4.63.0702272317510.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6988","inReplyTo":"7v649nclsq.fsf@assigned-by-dhcp.cox.net","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-27T22:22:11Z","receivedAt":"2007-02-27T22:22:11Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 27 Feb 2007, Junio C Hamano wrote:\n\n> It's been a while I looked at the coding guideline the last time, but I \n> think GNU convention wants you to say \"filename (function)\" when \n> applicable.  Which I happen to think makes much more sense than the \n> filename alone.\n> \n> The information that would appear in \"log -p --pretty\" output needs to \n> be condensed to obtain such a log entry.  You _could_ still do that as a \n> built-in if you really wanted to, but I tend to think that it is much \n> better to implement such a specialized processing (for one thing, what a \n> function is depends on the programming language you are reading from) as \n> an external postprocessing filter that people can more easily tweak for \n> their specific needs.\n\nIt would be easy to write a consume() function (called with context \n== 0) which takes the information from the \"@@\" lines.\n\nBut the builtin -- as the script -- would suffer from the following \nproblem:\n\n-- snip --\n+}\n+\n+static int new_function(void)\n-- snap --\n\n> That's why I keep stressing that one good thing about git is it is \n> easily scriptable.\n\nIMHO it is easier to get right as a builtin. But as I said, I am not \nfeeling too strongly about it.\n\nCiao,\nDscho\n"},{"id":"35804","messageId":"87bqje74u5.fsf_-_@latte.josefsson.org","threadId":"6988","inReplyTo":"20070227174035.f85e8643.vsu@altlinux.ru","subject":"gitco - replacement for cvsco","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-02-28T14:08:02Z","receivedAt":"2007-02-28T14:08:02Z","isPatch":false,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Sergey Vlasov <vsu@altlinux.ru> writes:\n\n> On Tue, 27 Feb 2007 13:37:23 +0100 (CET) Johannes Schindelin wrote:\n>\n>> On Tue, 27 Feb 2007, Simon Josefsson wrote:\n>>\n>> > Hi!  I'm considering switching to git for my projects (shishi, gsasl,\n>> > gnutls, libtasn1, opencdk, ...) and I have some questions:\n>> >\n>> > * How do I discard all locally modified or added files?  'cvs upd -C'\n>> >   does some of that, but I've been using a tool 'cvsco' which quickly\n>> >   restore a CVS checkout into a pristine state.\n>>\n>> The command in git is called \"git reset --hard\". Beware: this really,\n>> really loses _all_ local changes. And no need to worry when it completes\n>> much faster than you expected it to... See \"git status\" to see that it\n>> worked, indeed.\n>\n> But \"git reset --hard\" won't touch untracked files (this command is\n> similar to \"cvs update -C\", but does not save old contents anywhere).\n> If what is really needed is to clean out build products, editor backups\n> and other files which are not tracked by git, \"git clean -d -x\" will do\n> it (but this command will keep local changes to tracked files - an\n> additional \"git reset --hard\" is needed to restore them to the last\n> committed state).\n\nThanks!  This script solve my original question:\n\n#!/bin/sh\n# gitco - cruel checkout.  Discards everything that has not been\n# committed, and checkout missing files.\ngit-clean -d -x\ngit-reset --hard\n\nHowever, one problem with that, compared to 'cvsco', is that\n'git-reset --hard' does not tell me tell me which files were deleted\nand which file were restored.  May I suggest a --verbose or similar?\n\nHere is how to use \"gitco\":\n\njas@mocca:~/src/libtasn1$ sha1sum foo Makefile.am  gendocs.sh\nsha1sum: foo: No such file or directory\ne14704b0c3fe4a07e86e4f66df7c6888f619e7dc  Makefile.am\nea44aed92044fdafffae08a8ec4191ed357e4321  gendocs.sh\n\n# Ok, so we have two files, one which doesn't exists.\n\njas@mocca:~/src/libtasn1$ echo hej > foo; echo hej >> Makefile.am ; rm gendocs.sh\njas@mocca:~/src/libtasn1$ sha1sum foo Makefile.am  gendocs.sh\n32a0617aab4c9fe725f1b5bc441291180ad25b73  foo\ne83aa94eb841a329289395f9a88bd5f89a725535  Makefile.am\nsha1sum: gendocs.sh: No such file or directory\n\n# Ok, one file deleted, one new created, and one modified.\n\njas@mocca:~/src/libtasn1$ gitco\nRemoving foo\n\n# It isn't that informative...\n\njas@mocca:~/src/libtasn1$ sha1sum foo Makefile.am  gendocs.sh\nsha1sum: foo: No such file or directory\ne14704b0c3fe4a07e86e4f66df7c6888f619e7dc  Makefile.am\nea44aed92044fdafffae08a8ec4191ed357e4321  gendocs.sh\n\n# Ok, back to where we started.\n\nRegards,\nSimon\n"},{"id":"35805","messageId":"877iu274mx.fsf@latte.josefsson.org","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702271618210.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-02-28T14:12:22Z","receivedAt":"2007-02-28T14:12:22Z","isPatch":false,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Let me hack something.\n>\n> See my next three posts. This patch series is on top of \"next\" (it does \n> not apply cleanly to \"master\", since the format \"format:\" conflicts...).\n\nWow, that was quick!  Thanks.  I haven't built my own git yet, so\ntesting this may take some time...\n\nGenerally, I can sympathise with those who think this feature should\nnot be in the core git.  That would correspond to the cvs2cl tool, it\nis an external tool that uses cvs internally.  However, having it be\nincluded in core would be simpler for me.  I don't care strongly which\napproach is chosen (external tool vs included in core), but I can't\nswitch to git for my projects until this is resolved.\n\n/Simon\n"},{"id":"35806","messageId":"87zm6y5pdy.fsf@latte.josefsson.org","threadId":"6988","inReplyTo":"Pine.LNX.4.63.0702272227500.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Replacement for cvs2cl, for generating ChangeLog","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-02-28T14:27:05Z","receivedAt":"2007-02-28T14:27:05Z","isPatch":false,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"FYI, the GNU ChangeLog format is actually documented, see:\n\nhttp://www.gnu.org/prep/standards/html_node/Change-Logs.html\n\nAnd some parts of it (function names, CPP macro conditionals) are\nquite neat, although I'm not sure how much of it can be automatically\ngenerated, or if that is even something you'd want.\n\n/Simon\n"},{"id":"35880","messageId":"20070228195536.GB4149@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6988","inReplyTo":"87bqje74u5.fsf_-_@latte.josefsson.org","subject":"Re: gitco - replacement for cvsco","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-02-28T19:55:36Z","receivedAt":"2007-02-28T19:55:36Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"As a big fan of cvsco and friends, I admit I often miss that one in\ngit repos.\n\nOn Wed, Feb 28, 2007 at 03:08:02PM +0100, Simon Josefsson wrote:\n> However, one problem with that, compared to 'cvsco', is that\n> 'git-reset --hard' does not tell me tell me which files were deleted\n> and which file were restored.  May I suggest a --verbose or similar?\n\nHere is a small change to your script that does just that.  It is far\nfrom perfect:\n\n- uses cogito and not plain git.  Not sure how to achieve the same\ncompact layout with plain git - both cogito and stgit forge this type\nof output themselves.  Would be great to get it directly from git\nitself...\n\n- not very efficient, and not very secure, since we scan the tree once\nfor reporting and then once for deleting the files, leaving a window\nwhere files could be created by another program after the cg-status\ncall, and then removed by git-reset.\n\nYou've been warned :)\n\n#!/bin/sh\n# gitco - cruel checkout.  Discards everything that has not been\n# committed, and checkout missing files.\ngit clean -d -x\ncg status -w\ngit reset --hard\n"},{"id":"35888","messageId":"87y7mirmts.fsf@latte.josefsson.org","threadId":"6988","inReplyTo":"20070228195536.GB4149@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: gitco - replacement for cvsco","fromName":"Simon Josefsson","fromEmail":"simon@josefsson.org","sentAt":"2007-02-28T21:31:27Z","receivedAt":"2007-02-28T21:31:27Z","isPatch":false,"sender":{"key":"simon@josefsson.org","avatar":"https://gravatar.com/avatar/bbcf4eaca84bcb1c3d191a2d8868291127d072e3ed2cc92e8b835d8a009020d8?d=mp&s=160"},"body":"Yann Dirson <ydirson@altern.org> writes:\n\n> As a big fan of cvsco and friends, I admit I often miss that one in\n> git repos.\n>\n> On Wed, Feb 28, 2007 at 03:08:02PM +0100, Simon Josefsson wrote:\n>> However, one problem with that, compared to 'cvsco', is that\n>> 'git-reset --hard' does not tell me tell me which files were deleted\n>> and which file were restored.  May I suggest a --verbose or similar?\n>\n> Here is a small change to your script that does just that.  It is far\n> from perfect:\n>\n> - uses cogito and not plain git.  Not sure how to achieve the same\n> compact layout with plain git - both cogito and stgit forge this type\n> of output themselves.  Would be great to get it directly from git\n> itself...\n>\n> - not very efficient, and not very secure, since we scan the tree once\n> for reporting and then once for deleting the files, leaving a window\n> where files could be created by another program after the cg-status\n> call, and then removed by git-reset.\n>\n> You've been warned :)\n>\n> #!/bin/sh\n> # gitco - cruel checkout.  Discards everything that has not been\n> # committed, and checkout missing files.\n> git clean -d -x\n> cg status -w\n> git reset --hard\n\njas@mocca:~/src/libtasn1$ gitco\nRemoving foo\nM Makefile.am\n! gendocs.sh\njas@mocca:~/src/libtasn1$\n\nPerfect!\n\nThanks,\nSimon\n"}]}