-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "rev-list" program that uses the new time-based commit listing.
This is probably what you'd want to see for "git log".
- Loading branch information
Linus Torvalds
committed
Apr 24, 2005
1 parent
6eb7ed5
commit 6474510
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "cache.h" | ||
#include "commit.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
unsigned char sha1[20]; | ||
struct commit_list *list = NULL; | ||
struct commit *commit; | ||
|
||
if (argc != 2 || get_sha1_hex(argv[1], sha1)) | ||
usage("rev-list <commit-id>"); | ||
|
||
commit = lookup_commit(sha1); | ||
if (!commit || parse_commit(commit) < 0) | ||
die("bad commit object"); | ||
|
||
commit_list_insert(commit, &list); | ||
do { | ||
struct commit *commit = pop_most_recent_commit(&list); | ||
printf("%s\n", sha1_to_hex(commit->object.sha1)); | ||
} while (list); | ||
return 0; | ||
} |