Add support for "commit name decorations" to log family of commands

This adds "--decorate" as a log option, which prints out the ref names
of any commits that are shown.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Linus Torvalds
2007-04-16 16:05:10 -07:00
committed by Junio C Hamano
parent a59b276e18
commit ca135e7acc
3 changed files with 61 additions and 2 deletions

View File

@ -3,6 +3,7 @@
#include "object.h"
#include "tree.h"
#include "decorate.h"
struct commit_list {
struct commit *item;
@ -21,6 +22,13 @@ struct commit {
extern int save_commit_buffer;
extern const char *commit_type;
/* While we can decorate any object with a name, it's only used for commits.. */
extern struct decoration name_decoration;
struct name_decoration {
struct name_decoration *next;
char name[1];
};
struct commit *lookup_commit(const unsigned char *sha1);
struct commit *lookup_commit_reference(const unsigned char *sha1);
struct commit *lookup_commit_reference_gently(const unsigned char *sha1,