1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 16:46:35 +02:00
git/commit.h
Daniel Barkalow dd97f850c3 [PATCH] Add some functions for commit lists
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.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-23 18:47:23 -07:00

37 lines
743 B
C

#ifndef COMMIT_H
#define COMMIT_H
#include "object.h"
#include "tree.h"
struct commit_list {
struct commit *item;
struct commit_list *next;
};
struct commit {
struct object object;
unsigned long date;
struct commit_list *parents;
struct tree *tree;
};
extern const char *commit_type;
struct commit *lookup_commit(unsigned char *sha1);
int parse_commit(struct commit *item);
void commit_list_insert(struct commit *item, struct commit_list **list_p);
void free_commit_list(struct commit_list *list);
void sort_by_date(struct commit_list **list);
/** Removes the first commit from a list sorted by date, and adds all
* of its parents.
**/
struct commit *pop_most_recent_commit(struct commit_list **list);
#endif /* COMMIT_H */