summaryrefslogtreecommitdiff
path: root/sys/src/cmd/git
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2022-03-17 01:41:44 +0000
committerMichael Forney <mforney@mforney.org>2022-03-17 01:41:44 +0000
commitd55a64c90512aae66b5cabac57edc3e957bd3f0c (patch)
tree8287e6a2af6b0f0e41f94d2111aa44ab73e62aa1 /sys/src/cmd/git
parent8bd5be7c707b979caa277637cadf356b78c2edb5 (diff)
git: use commit date as traversal hint instead of author date
Although git9 always uses the same commit date and author date, other implementation do make a distinction. Since commit date is more representative of the commit graph order, use this as a traversal hint instead of author date.
Diffstat (limited to 'sys/src/cmd/git')
-rw-r--r--sys/src/cmd/git/git.h2
-rw-r--r--sys/src/cmd/git/util.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/cmd/git/git.h b/sys/src/cmd/git/git.h
index cc39542dc..4e74333c5 100644
--- a/sys/src/cmd/git/git.h
+++ b/sys/src/cmd/git/git.h
@@ -158,7 +158,7 @@ struct Objset {
struct Qelt {
Object *o;
- vlong mtime;
+ vlong ctime;
int color;
};
diff --git a/sys/src/cmd/git/util.c b/sys/src/cmd/git/util.c
index 529dda41d..1d2398a7e 100644
--- a/sys/src/cmd/git/util.c
+++ b/sys/src/cmd/git/util.c
@@ -349,9 +349,9 @@ qput(Objq *q, Object *o, int color)
}
q->heap[q->nheap].o = o;
q->heap[q->nheap].color = color;
- q->heap[q->nheap].mtime = o->commit->mtime;
+ q->heap[q->nheap].ctime = o->commit->ctime;
for(i = q->nheap; i > 0; i = (i-1)/2){
- if(q->heap[i].mtime < q->heap[(i-1)/2].mtime)
+ if(q->heap[i].ctime < q->heap[(i-1)/2].ctime)
break;
t = q->heap[i];
q->heap[i] = q->heap[(i-1)/2];
@@ -378,9 +378,9 @@ qpop(Objq *q, Qelt *e)
m = i;
l = 2*i+1;
r = 2*i+2;
- if(l < q->nheap && q->heap[m].mtime < q->heap[l].mtime)
+ if(l < q->nheap && q->heap[m].ctime < q->heap[l].ctime)
m = l;
- if(r < q->nheap && q->heap[m].mtime < q->heap[r].mtime)
+ if(r < q->nheap && q->heap[m].ctime < q->heap[r].ctime)
m = r;
if(m == i)
break;