From: Fredrik Noring Date: Mon, 14 Apr 2008 19:56:30 GMT Subject: Re: [PATCH] Calculate lines changed for cvs log command Message-ID: In-Reply-To: <200804132243.40909.jnareb@gmail.com> Hi Jakub, 13 apr 2008 kl. 22.43 skrev Jakub Narebski: > First, having patch as attachement, moreover as _binary_ and _encoded_ > attachement makes it hard to comment on it. And if you make it hard > to > comment on patch, people woundn't do it. Again, my sincere apologies. I have a feeling my current mailer never will meet the patch submission requirements for this mailing list. However, I will replace it at the next opportunity in order to comply. The goal with these patches is to make cvsserver commands such as "cvs log" identical to the real thing, so that cvs users would feel at home after a cvs import to git. I'm getting closer with these tweaks/fixes to the cvsserver. So far mainly handling of whitespace and calculating proper "shortstats". Decent performance would be nice as well. I'm playing around with this but I'm in no hurry, so feel free to ignore. :) > Second, your approach with "--pretty=format:%s%n%b" might be a good > idea, but you don't get all the information as you get from > git-cat-file: no tree info, no true (recorded) parents info, no > committer info, no author info. I don't know if git-cvsserver makes > use of that info or not; from the patch it looks as if it discards > all but commit message (message body). Yeah -- it's all discarded. A small issue is that "--pretty=format:%s%n %b" only outputs the same commit message as git-cat-file in ~95 % of my test cases. I've seen differences regarding newlines after the subject line (git-cat-file seems to output this correctly, but not %s%n %b). Something to investigate further, perhaps. > BTW. I'm not Perl expert, but if you want to discard two last > elements in arrays, wouldn't using splice (or just decreasing > $#lines by 2) be simpler solution? I went for clarity and felt pop() made the job. ;) > About git-log vs git-cat-file: take a look how gitweb does it, with > parse_commits and parse_commit_text, and commit 756bbf548dbef5b738c > by Robert Fitzsimons introducing it. Note that IIRC this commit > predates --pretty=format: option to git-log / git-rev-list. Sure, thanks! > BTW. cannot you turn off "format=flowed" in Apple Mail? Well, it appears easier to replace it altogether in order to follow the patch submission rules. I like Gnome Evolution and it'll hopefully work nicely in this case. > Could you please do not toppost? It is against natural reading order. > Heh. Very funny you wrote that as a toppost yourself. ;) Thanks, Fredrik