diff --git a/rev-list.c b/rev-list.c
index 1a03bf7b3754e1644f9a2cee80d9d09b563ee1ec..2d97cdb64bdad56046c1dfd2fd784af54d420ca5 100644 (file)
--- a/rev-list.c
+++ b/rev-list.c
static int verbose_header = 0;
static int show_parents = 0;
static int hdr_termination = 0;
static int verbose_header = 0;
static int show_parents = 0;
static int hdr_termination = 0;
-static const char *prefix = "";
+static const char *commit_prefix = "";
static unsigned long max_age = -1;
static unsigned long min_age = -1;
static int max_count = -1;
static unsigned long max_age = -1;
static unsigned long min_age = -1;
static int max_count = -1;
{
commit->object.flags |= SHOWN;
if (show_breaks) {
{
commit->object.flags |= SHOWN;
if (show_breaks) {
- prefix = "| ";
+ commit_prefix = "| ";
if (commit->object.flags & DISCONTINUITY) {
if (commit->object.flags & DISCONTINUITY) {
- prefix = "^ ";
+ commit_prefix = "^ ";
} else if (commit->object.flags & BOUNDARY) {
} else if (commit->object.flags & BOUNDARY) {
- prefix = "= ";
+ commit_prefix = "= ";
}
}
}
}
- printf("%s%s", prefix, sha1_to_hex(commit->object.sha1));
+ printf("%s%s", commit_prefix, sha1_to_hex(commit->object.sha1));
if (show_parents) {
struct commit_list *parents = commit->parents;
while (parents) {
if (show_parents) {
struct commit_list *parents = commit->parents;
while (parents) {
parents = parents->next;
}
}
parents = parents->next;
}
}
- putchar('\n');
+ if (commit_format == CMIT_FMT_ONELINE)
+ putchar(' ');
+ else
+ putchar('\n');
+
if (verbose_header) {
static char pretty_header[16384];
pretty_print_commit(commit_format, commit->buffer, ~0, pretty_header, sizeof(pretty_header));
if (verbose_header) {
static char pretty_header[16384];
pretty_print_commit(commit_format, commit->buffer, ~0, pretty_header, sizeof(pretty_header));
@@ -414,6 +418,8 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags)
if (tag_objects && !(object->flags & UNINTERESTING))
add_pending_object(object, tag->tag);
object = parse_object(tag->tagged->sha1);
if (tag_objects && !(object->flags & UNINTERESTING))
add_pending_object(object, tag->tag);
object = parse_object(tag->tagged->sha1);
+ if (!object)
+ die("bad object %s", sha1_to_hex(tag->tagged->sha1));
}
/*
}
/*
struct commit_list *list = NULL;
int i, limited = 0;
struct commit_list *list = NULL;
int i, limited = 0;
+ setup_git_directory();
for (i = 1 ; i < argc; i++) {
int flags;
char *arg = argv[i];
for (i = 1 ; i < argc; i++) {
int flags;
char *arg = argv[i];
commit_format = get_commit_format(arg+8);
verbose_header = 1;
hdr_termination = '\n';
commit_format = get_commit_format(arg+8);
verbose_header = 1;
hdr_termination = '\n';
- prefix = "commit ";
+ if (commit_format == CMIT_FMT_ONELINE)
+ commit_prefix = "";
+ else
+ commit_prefix = "commit ";
continue;
}
if (!strncmp(arg, "--no-merges", 11)) {
continue;
}
if (!strncmp(arg, "--no-merges", 11)) {