]> Pileus Git - ~andy/git/commitdiff
Remove --kept-pack-only option and associated infrastructure
authorBrandon Casey <casey@nrlssc.navy.mil>
Fri, 20 Mar 2009 03:47:54 +0000 (22:47 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Mar 2009 20:32:33 +0000 (13:32 -0700)
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>
builtin-pack-objects.c
cache.h
revision.c
revision.h
sha1_file.c

index aae4d243b3c69a2206fb07006cc3691b2020052f..6222f19c7887658d872a4b096ec8dc4988669107 100644 (file)
@@ -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;
diff --git a/cache.h b/cache.h
index 0a3d523d26fb802a512a32d5f6067c2140879693..23c16d0d99777cc9a6f23c6b23fb16d837b1742c 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -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);
 
index 6d8ac460817d3eef5019f9f27fc8b9ebc04322a2..50a5b5f3943a89dab65dbfaa1657b9792aca51d5 100644 (file)
@@ -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;
index b9fa9c2a67d56355fcd8cc9d471d70767473760c..1d322759aab49f608ca9f225689ec2d945813d2a 100644 (file)
@@ -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,
index 7ead56cc3ef8e96e2ddda1dc77cc83cb6946e7fc..500fd93127246fad72edca165fd4673070813f82 100644 (file)
@@ -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;