git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Calculate lines changed for cvs log command

From
FNFredrik Noring <noring@nocrew.org>
Date
Apr 14, 2008, 19:56 UTC
Message-ID
<FFB8FCA9-AD9C-4F7F-9238-0CB0CA3204AF@nocrew.org>
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. :)

Show 6 quoted lines
> 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:<fmt> 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

Previous: Jakub Narebski
Message 5 of 5 in “Calculate lines changed for cvs log command”
  1. Calculate lines changed for cvs log commandFredrik Noring, Apr 13, 2008
  2. Jakub NarebskiApr 13, 2008
  3. Fredrik NoringApr 13, 2008
  4. Jakub NarebskiApr 13, 2008
  5. Fredrik NoringApr 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.