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

Re: [PATCH 1/5] Add some functions for commit lists

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 24, 2005, 02:12 UTC
Message-ID
<Pine.LNX.4.58.0504231906110.2344@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.21.0504232003490.30848-100000@iabervon.org>
On Sat, 23 Apr 2005, Daniel Barkalow wrote:
>
> This adds a function for inserting an item in a commit list, a function
> for sorting a commit list by date, and a function for progressively
> scanning a commit history from most recent to least recent.
Ok. This is more in like with what I was hoping for, looks good.

All patches applied and pushed out, and I wrote a trivial "rev-list" thing that is kind of a cut-down rev-tree which just lists the commits in the order the "fake time order".

The "fake time order" just uses this progressive commit history scan, which is different from the old "sort by date" in that it still takes parenthood into account, and always shows the child first.

It turns out that since git is so damn fast, when I commit a mbox of patches, they often all get the same date, since we "only" do dates with a one-second granularity. So sorting by date ends up doing strange things, when some of the entries have no sort order.

Daniel's date-based incremental scanning solves this problem, and also means that we get output immediately without having to parse the whole tree down to the root.

So with this, git-pasky should probably do the following..
			Linus

- Make gitlog.sh use the new simple time-based commit traversal helpers.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
gitlog.sh: a496a864f9586e47a4d7bd3ae0af0b3e07b7deb8
--- a/gitlog.sh
+++ b/gitlog.sh
@@ -11,7 +11,7 @@
 
 base=$(gitXnormid.sh -c $1) || exit 1
 
-rev-tree $base | sort -rn | while read time commit parents; do
+rev-list $base | while read commit; do
 	echo commit ${commit%:*};
 	cat-file commit $commit | \
 		while read key rest; do
Previous: Daniel BarkalowNext: Linus Torvalds
Message 3 of 12 in “Better merge-base, alternative transport programs”
  1. 0/5 Better merge-base, alternative transport programsDaniel Barkalow, Apr 24, 2005
  2. 1/5 Add some functions for commit listsDaniel Barkalow, Apr 24, 2005
  3. Linus TorvaldsApr 24, 2005
  4. Linus TorvaldsApr 24, 2005
  5. Daniel BarkalowApr 24, 2005
  6. Allow multiple date-ordered listsDaniel Barkalow, Apr 24, 2005
  7. Add -u option to diff-cache to show UNCHANGED filesAndreas Gal, Apr 24, 2005
  8. Petr BaudisApr 24, 2005
  9. 2/5 Parse tree objects completelyDaniel Barkalow, Apr 24, 2005
  10. 3/5 Additional functions for the objects databaseDaniel Barkalow, Apr 24, 2005
  11. 4/5 Replace merge-base implementationDaniel Barkalow, Apr 24, 2005
  12. 5/5 Various transport programsDaniel Barkalow, Apr 24, 2005

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.