diff options
author | Brandon Casey <casey@nrlssc.navy.mil> | 2009-03-19 22:47:54 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-20 13:32:33 -0700 |
commit | 4d6acb70411cd4fe69610cf1b22f186fa01614f7 (patch) | |
tree | 26b206a75519f28d59e1e34e718d74288637c412 | |
parent | pack-objects: only repack or loosen objects residing in "local" packs (diff) | |
download | tgif-4d6acb70411cd4fe69610cf1b22f186fa01614f7.tar.xz |
Remove --kept-pack-only option and associated infrastructure
This option to pack-objects/rev-list was created to improve the -A and -a
options of repack. It was found to be lacking in that it did not provide
the ability to differentiate between local and non-local kept packs, and
found to be unnecessary since objects residing in local kept packs can be
filtered out by the --honor-pack-keep option.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin-pack-objects.c | 1 | ||||
-rw-r--r-- | cache.h | 1 | ||||
-rw-r--r-- | revision.c | 9 | ||||
-rw-r--r-- | revision.h | 1 | ||||
-rw-r--r-- | sha1_file.c | 21 |
5 files changed, 2 insertions, 31 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index aae4d243b3..6222f19c78 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -2149,7 +2149,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) continue; } if (!strcmp("--unpacked", arg) || - !strcmp("--kept-pack-only", arg) || !strcmp("--reflog", arg) || !strcmp("--all", arg)) { use_internal_rev_list = 1; @@ -566,7 +566,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l extern int move_temp_to_file(const char *tmpfile, const char *filename); extern int has_sha1_pack(const unsigned char *sha1); -extern int has_sha1_kept_pack(const unsigned char *sha1); extern int has_sha1_file(const unsigned char *sha1); extern int has_loose_object_nonlocal(const unsigned char *sha1); diff --git a/revision.c b/revision.c index 6d8ac46081..50a5b5f394 100644 --- a/revision.c +++ b/revision.c @@ -1062,10 +1062,6 @@ 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; - revs->kept_pack_only = 0; - } else if (!strcmp(arg, "--kept-pack-only")) { - revs->unpacked = 1; - revs->kept_pack_only = 1; } else if (!prefixcmp(arg, "--unpacked=")) { die("--unpacked=<packfile> no longer supported."); } else if (!strcmp(arg, "-r")) { @@ -1475,10 +1471,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit) { if (commit->object.flags & SHOWN) return commit_ignore; - if (revs->unpacked && - (revs->kept_pack_only - ? has_sha1_kept_pack(commit->object.sha1) - : has_sha1_pack(commit->object.sha1))) + if (revs->unpacked && has_sha1_pack(commit->object.sha1)) return commit_ignore; if (revs->show_all) return commit_show; diff --git a/revision.h b/revision.h index b9fa9c2a67..1d322759aa 100644 --- a/revision.h +++ b/revision.h @@ -48,7 +48,6 @@ struct rev_info { edge_hint:1, limited:1, unpacked:1, - kept_pack_only:1, boundary:2, left_right:1, rewrite_parents:1, diff --git a/sha1_file.c b/sha1_file.c index 7ead56cc3e..500fd93127 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1856,8 +1856,7 @@ off_t find_pack_entry_one(const unsigned char *sha1, return 0; } -static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e, - int kept_pack_only) +static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e) { static struct packed_git *last_found = (void *)1; struct packed_git *p; @@ -1869,8 +1868,6 @@ static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e, p = (last_found == (void *)1) ? packed_git : last_found; do { - if (kept_pack_only && !p->pack_keep) - goto next; if (p->num_bad_objects) { unsigned i; for (i = 0; i < p->num_bad_objects; i++) @@ -1910,16 +1907,6 @@ static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e, return 0; } -static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e) -{ - return find_pack_ent(sha1, e, 0); -} - -static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e) -{ - return find_pack_ent(sha1, e, 1); -} - struct packed_git *find_sha1_pack(const unsigned char *sha1, struct packed_git *packs) { @@ -2387,12 +2374,6 @@ int has_sha1_pack(const unsigned char *sha1) return find_pack_entry(sha1, &e); } -int has_sha1_kept_pack(const unsigned char *sha1) -{ - struct pack_entry e; - return find_kept_pack_entry(sha1, &e); -} - int has_sha1_file(const unsigned char *sha1) { struct pack_entry e; |