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

Re: [PATCH] Lose perl dependency. (fwd)

From
Junio C Hamano <junkio@cox.net>
Date
Jan 20, 2007, 03:30 UTC
Message-ID
<7vfya69xym.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0701200213020.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> P.S.: Perhaps you should just stop worrying and learn to love --reverse 
> ;-)

Another thing to think about is how --reverse should interact with --max-count and --skip (and perhaps --max-age but I am not sure about that one).

I think there are two very valid ways. You determine what you would spit out as if there is no --reverse, and then reverse the result, or you do not limit with them to get everthing, reverse the result and do the counting limit on that reversed list.

The former is probably more efficient (I do not think you would need to artificially make it limited like your patch does if you go this route), while the latter may or may not be more useful for what the end users would want to do.

For example, "git log -4" would show the topmost four commits. If you do the former, "git log --reverse -4" would give you the same four but in the chronological order (we usually show in the reverse order and --reverse would make it the forward order ;-), and you do not need to do the limiting for this. You need to capture them and reverse them yourself anyway, so not having to limit may not be a big deal, though.

If you do the latter, you would be able to get the first four commits in the chronological order. I do not think that is usually of much practical value (although people new to git always seem to ask "how do I get to the root commit" at least once), but there may be some valid uses for that kind of behaviour.

Previous: Johannes SchindelinNext: Simon 'corecode' Schubert
Message 13 of 31 in “Re: [PATCH] Lose perl dependency. (fwd)”
  1. Johannes SchindelinJan 18, 2007
  2. Simon 'corecode' SchubertJan 18, 2007
  3. Johannes SchindelinJan 18, 2007
  4. Simon 'corecode' SchubertJan 18, 2007
  5. Andy ParkinsJan 18, 2007
  6. Johannes SchindelinJan 18, 2007
  7. Junio C HamanoJan 19, 2007
  8. Johannes SchindelinJan 19, 2007
  9. Junio C HamanoJan 20, 2007
  10. Johannes SchindelinJan 20, 2007
  11. Junio C HamanoJan 20, 2007
  12. Johannes SchindelinJan 20, 2007
  13. Junio C HamanoJan 20, 2007
  14. Simon 'corecode' SchubertJan 20, 2007
  15. Johannes SchindelinJan 20, 2007
  16. Junio C HamanoJan 20, 2007
  17. Johannes SchindelinJan 20, 2007
  18. Robin RosenbergJan 21, 2007
  19. Johannes SchindelinJan 21, 2007
  20. Bill LearJan 21, 2007
  21. Junio C HamanoJan 21, 2007
  22. David KågedalJan 21, 2007
  23. Johannes SchindelinJan 21, 2007
  24. Krzysztof HalasaJan 23, 2007
  25. David KågedalJan 23, 2007
  26. Krzysztof HalasaJan 23, 2007
  27. Randal L. SchwartzJan 23, 2007
  28. Krzysztof HalasaJan 23, 2007
  29. Krzysztof HalasaJan 23, 2007
  30. Simon 'corecode' SchubertJan 21, 2007
  31. Teach revision machinery about --reverseJohannes Schindelin, Jan 21, 2007

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.