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

Re: [PATCH 2/2] git-log (internal): more options.

From
Junio C Hamano <junkio@cox.net>
Date
Mar 1, 2006, 20:06 UTC
Message-ID
<7vwtfedj5j.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0603010730520.22647@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> Most helpers that want a list of commits probably want the printing 
> options too, and the ones that do not probably simply don't care (ie if 
> they silently pass a "--pretty=raw" without it affecting anything, who 
> really cares?)

Perhaps (meaning, agree in general but not 100% convinced and haven't made up my mind yet).

> I can actually imagine using "--parents" as a way of parsing both the 
> commit log and the history. Of course, any such use is likely in a script, 
> at which point the script probably doesn't actually want "git log", but 
> just a raw "git-rev-list".
Yes, that is exactly why I did not see why "log viewer" wants --parents.
> To me, the question whether a flag would be parsed in the "revision.c" 
> library or in the "rev-list.c" binary was more a question of whether that 
> flag makes sense for other things than just "git log". 

Good to know we are in agreement (iow, I wasn't totally off the mark) that revision.c should handle things that are common. That means:

 * --bisect and --parents are for scripted use only and do not
   concern log viewer, so we would leave them in rev-list.
 * --header is good for anything that shows more than one
   record, so it may be worthwhile to have it in generic.
Show 8 quoted lines
> For example, "git whatchanged" and "git diff" could both use 
> setup_revision(), although "git diff" wouldn't actually _walk_ the 
> revisions (it would just look at the "revs->commits" list to see what was 
> passed in).
>
> "git whatchanged" would obviously take all the same flags "git log" does, 
> and "git diff" could take them and just test the values for sanity (ie 
> error out if min/max_date is not -1, for example).
Perhaps.
> "git show" is like a "git-whatchanged" except it wouldn't walk the diffs 
> (I considered adding a "--nowalk" option to setup_revisions(), which would 
> just suppress the "add_parents_to_list()" entirely)

Umm. The current "git show -4" walks and I find the behaviour useful. They are the same program with different defaults.

Previous: Linus TorvaldsNext: Martin Langhoff
Message 11 of 13 in “git-rev-list libification effort: the next stage”
  1. 0/3 git-rev-list libification effort: the next stageLinus Torvalds, Feb 28, 2006
  2. 1/3 git-rev-list libification: rev-list walkingLinus Torvalds, Feb 28, 2006
  3. 2/3 Introduce trivial new pager.c helper infrastructureLinus Torvalds, Feb 28, 2006
  4. 3/3 Tie it all together: "git log"Linus Torvalds, Feb 28, 2006
  5. Linus TorvaldsFeb 28, 2006
  6. Junio C HamanoFeb 28, 2006
  7. Linus TorvaldsFeb 28, 2006
  8. 1/2 git-log (internal): add approxidate.Junio C Hamano, Mar 1, 2006
  9. 2/2 git-log (internal): more options.Junio C Hamano, Mar 1, 2006
  10. Linus TorvaldsMar 1, 2006
  11. Junio C HamanoMar 1, 2006
  12. Martin LanghoffFeb 28, 2006
  13. Junio C HamanoMar 1, 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.