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

Re: Fixes for option parsing

From
Junio C Hamano <junkio@cox.net>
Date
Apr 17, 2006, 00:29 UTC
Message-ID
<7vbqv1oxie.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0604161433000.3701@g5.osdl.org>

Thanks for fixing this. I've applied and merged it to the "next" branch.

In the mid-term, I am hoping we can drop the generate_header() callchain _and_ the custom code that formats commit log in-core, found in cmd_log_wc(). rev->use_precomputed_header and perhaps rev->header can be dropped and replaced with a call to a function to print formatted log to stdout (or perhaps a FILE *, because I want to reuse this to make output part of "git-format-patch" internal) from log-tree.

For that, I'd need to define a new CMIT_FMT for the format-patch output. Another thing needed is to clean up the commit_prefix local variable defined in cmd_log_wc() -- it should use rev->header_prefix, but before that the part that rewrites opt->header_prefix to have a blank line between commits, in log-tree.c::do_diff_combined() and log_tree_commit() need to be cleaned up.

For the header_prefix line, there also is a subtle difference between the one-commit diff-tree and log. The former lists "this commit (from that commit)", which is perhaps useful for cut and paste purposes. The latter just says "this commit".

I wish this "diff-tree SHA1 (from ANOTHERSHA1)" format can be dropped and replaced with "commit SHA1" format like "git log" does uniformly, but it might be already depended upon by Porcelains.

If the commit is not a merge, "commit SHA1" means the same thing as "diff-tree SHA1 (from SHA1^)", and if it _is_ a merge, then the merge parents are listed on the "Merge: " line anyway for all formats other than --pretty=oneline, so unless this change breaks an Porcelain, there is really no downside.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 18 in “Fixes for option parsing”
  1. Linus TorvaldsApr 16, 2006
  2. Junio C HamanoApr 17, 2006
  3. Linus TorvaldsApr 17, 2006
  4. Linus TorvaldsApr 17, 2006
  5. Junio C HamanoApr 17, 2006
  6. Linus TorvaldsApr 17, 2006
  7. Log message printout cleanupsLinus Torvalds, Apr 17, 2006
  8. Junio C HamanoApr 17, 2006
  9. Linus TorvaldsApr 17, 2006
  10. Junio C HamanoApr 18, 2006
  11. Junio C HamanoApr 18, 2006
  12. Linus TorvaldsApr 18, 2006
  13. Junio C HamanoApr 18, 2006
  14. Linus TorvaldsApr 18, 2006
  15. Linus TorvaldsApr 18, 2006
  16. Junio C HamanoApr 18, 2006
  17. diff --stat: make sure to set recursive.Junio C Hamano, Apr 18, 2006
  18. Linus TorvaldsApr 18, 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.