X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=revision.c;h=f5771c7898a939e34effb8c757c5a237830075b9;hb=7f733de04e69c8ba40158d1da46c4aa121f714b6;hp=286e416b757fa8df731330992fca96773082f75d;hpb=bf0fe35c938ac9f03d1369600b0c76e428a57507;p=git.git diff --git a/revision.c b/revision.c index 286e416b7..f5771c789 100644 --- a/revision.c +++ b/revision.c @@ -994,16 +994,6 @@ static void add_message_grep(struct rev_info *revs, const char *pattern) add_grep(revs, pattern, GREP_PATTERN_BODY); } -static void add_ignore_packed(struct rev_info *revs, const char *name) -{ - int num = ++revs->num_ignore_packed; - - revs->ignore_packed = xrealloc(revs->ignore_packed, - sizeof(const char *) * (num + 1)); - revs->ignore_packed[num-1] = name; - revs->ignore_packed[num] = NULL; -} - static int handle_revision_opt(struct rev_info *revs, int argc, const char **argv, int *unkc, const char **unkv) { @@ -1116,12 +1106,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->edge_hint = 1; } else if (!strcmp(arg, "--unpacked")) { revs->unpacked = 1; - free(revs->ignore_packed); - revs->ignore_packed = NULL; - revs->num_ignore_packed = 0; - } else if (!prefixcmp(arg, "--unpacked=")) { + revs->kept_pack_only = 0; + } else if (!strcmp(arg, "--kept-pack-only")) { revs->unpacked = 1; - add_ignore_packed(revs, arg+11); + revs->kept_pack_only = 1; + } else if (!prefixcmp(arg, "--unpacked=")) { + die("--unpacked= no longer supported."); } else if (!strcmp(arg, "-r")) { revs->diff = 1; DIFF_OPT_SET(&revs->diffopt, RECURSIVE); @@ -1144,9 +1134,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg } else if (!strcmp(arg, "--pretty")) { revs->verbose_header = 1; get_commit_format(arg+8, revs); - } else if (!prefixcmp(arg, "--pretty=")) { + } else if (!prefixcmp(arg, "--pretty=") || !prefixcmp(arg, "--format=")) { revs->verbose_header = 1; get_commit_format(arg+9, revs); + } else if (!strcmp(arg, "--oneline")) { + revs->verbose_header = 1; + get_commit_format("oneline", revs); + revs->abbrev_commit = 1; } else if (!strcmp(arg, "--graph")) { revs->topo_order = 1; revs->rewrite_parents = 1; @@ -1685,7 +1679,10 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit) { if (commit->object.flags & SHOWN) return commit_ignore; - if (revs->unpacked && has_sha1_pack(commit->object.sha1, revs->ignore_packed)) + if (revs->unpacked && + (revs->kept_pack_only + ? has_sha1_kept_pack(commit->object.sha1) + : has_sha1_pack(commit->object.sha1))) return commit_ignore; if (revs->show_all) return commit_show;