summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/revision.c b/revision.c
index 286e416..f5771c7 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=<packfile> 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;