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

Re: [PATCH 2/3] gitweb: Filter out commit ID from @difftree in git_commit and git_commitdiff

From
Junio C Hamano <junkio@cox.net>
Date
Oct 25, 2006, 04:36 UTC
Message-ID
<7v1woxf1v9.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200610241354.49396.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> Filter out commit ID output that git-diff-tree adds when called with
> only one <tree-ish> (not only for --stdin) in git_commit and
> git_commitdiff.

I initially wondered why this, or other existing such sripping, is necessary in the first place.

The collected result is given to git_difftree_body() and it feeds parse_difftree_raw_line() with it. Interestingly enough, it _is_ prepared to handle the line with the commit object name.

However, the very initial part of git_difftree_body assumes that the array it gets does not have the commit object name (i.e. it counts the array members and says "N files changed").

So I think your change is probably a good one, but I suspect you probably are better off to make parse_difftree_raw_line() to barf when it gets the commit object name to make sure that all callers strip it at the same time; better yet, perhaps you can have a single function that invokes git-diff-tree -r (with different parameters) and returns the result that is already only the difftree body lines?

Previous: Jakub NarebskiNext: Jakub Narebski
Message 4 of 8 in “gitweb: Improvements to commitdiff oview”
  1. 0/3 gitweb: Improvements to commitdiff oviewJakub Narebski, Oct 24, 2006
  2. 1/3 gitweb: Get rid of git_print_simplified_logJakub Narebski, Oct 24, 2006
  3. 2/3 gitweb: Filter out commit ID from @difftree in git_commit and git_commitdiffJakub Narebski, Oct 24, 2006
  4. Junio C HamanoOct 25, 2006
  5. Jakub NarebskiOct 25, 2006
  6. 4/3 gitweb: Use --no-commit-id in git_commit and git_commitdiffJakub Narebski, Oct 25, 2006
  7. 2/3 gitweb: Use --no-commit-id in git_commit and git_commitdiffJakub Narebski, Oct 25, 2006
  8. 3/3 gitweb: Print commit message without title in commitdiff only if there is anyJakub Narebski, Oct 24, 2006

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.