projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use Ryan's git-annotate instead of jsannotate
[git.git]
/
commit.c
diff --git
a/commit.c
b/commit.c
index
97205bf
..
c550a00
100644
(file)
--- a/
commit.c
+++ b/
commit.c
@@
-438,13
+438,13
@@
static int add_merge_info(enum cmit_fmt fmt, char *buf, const struct commit *com
while (parent) {
struct commit *p = parent->item;
while (parent) {
struct commit *p = parent->item;
+ const char *hex = abbrev
+ ? find_unique_abbrev(p->object.sha1, abbrev)
+ : sha1_to_hex(p->object.sha1);
+ char *dots = (abbrev && strlen(hex) != 40) ? "..." : "";
parent = parent->next;
parent = parent->next;
- offset += sprintf(buf + offset,
- abbrev ? " %s..." : " %s",
- abbrev
- ? find_unique_abbrev(p->object.sha1, abbrev)
- : sha1_to_hex(p->object.sha1));
+ offset += sprintf(buf + offset, " %s%s", hex, dots);
}
buf[offset++] = '\n';
return offset;
}
buf[offset++] = '\n';
return offset;
@@
-571,7
+571,7
@@
int count_parents(struct commit * commit)
/*
* Performs an in-place topological sort on the list supplied.
*/
/*
* Performs an in-place topological sort on the list supplied.
*/
-void sort_in_topological_order(struct commit_list ** list)
+void sort_in_topological_order(struct commit_list ** list
, int lifo
)
{
struct commit_list * next = *list;
struct commit_list * work = NULL, **insert;
{
struct commit_list * next = *list;
struct commit_list * work = NULL, **insert;
@@
-630,7
+630,10
@@
void sort_in_topological_order(struct commit_list ** list)
}
next=next->next;
}
}
next=next->next;
}
+
/* process the list in topological order */
/* process the list in topological order */
+ if (!lifo)
+ sort_by_date(&work);
while (work) {
struct commit * work_item = pop_commit(&work);
struct sort_node * work_node = (struct sort_node *)work_item->object.util;
while (work) {
struct commit * work_item = pop_commit(&work);
struct sort_node * work_node = (struct sort_node *)work_item->object.util;
@@
-647,8
+650,12
@@
void sort_in_topological_order(struct commit_list ** list)
* guaranteeing topological order.
*/
pn->indegree--;
* guaranteeing topological order.
*/
pn->indegree--;
- if (!pn->indegree)
- commit_list_insert(parent, &work);
+ if (!pn->indegree) {
+ if (!lifo)
+ insert_by_date(parent, &work);
+ else
+ commit_list_insert(parent, &work);
+ }
}
parents=parents->next;
}
}
parents=parents->next;
}