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

Re: Common option parsing..

From
Junio C Hamano <junkio@cox.net>
Date
Apr 13, 2006, 05:03 UTC
Message-ID
<7vmzeq12zd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0604121828370.14565@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 8 quoted lines
> The easiest way to just solve all this mess would be to 
>  - add the diff-options into "struct rev_list" and make the 
>    "setup_revisions()" parser parse the diff flags too.
>  - get rid of "log_info" and "diff_options"
>  - possibly rename the resulting super-options structure as "struct 
>    git_options" or something if we want to.
>...
> What do you think?

I think it all makes sense. And once this kind of clean-up is done, I suspect the implementations of "git diff", "git log" and "git show" would become quite similar -- one notable difference being "git diff" with a single rev and "git show" with a single rev would be quite different, but that is just how the arguments are interpreted, not parsed.

However, I am not sure about the two-revs case. I suspect the incoming items are sorted in the revs->commits list, and we wouldn't be able to tell which is src and which is dst when setup_revisions() returns.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 3 in “Common option parsing..”
  1. Linus TorvaldsApr 13, 2006
  2. Junio C HamanoApr 13, 2006
  3. Linus TorvaldsApr 13, 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.