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