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>
Brandon Casey committed
Mar 19, 2009 at 22:47 UTC
4d6acb70411cd4fe69610cf1b22f186fa01614f7
5 files changed
+2
-31
builtin-pack-objects.c
-1
@@ -2149,7 +2149,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
2149
continue;
2150
}
2151
if (!strcmp("--unpacked", arg) ||
2152
- !strcmp("--kept-pack-only", arg) ||
2152
!strcmp("--reflog", arg) ||
2153
!strcmp("--all", arg)) {
2154
use_internal_rev_list = 1;
cache.h
-1
@@ -566,7 +566,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
566
extern int move_temp_to_file(const char *tmpfile, const char *filename);
567
568
extern int has_sha1_pack(const unsigned char *sha1);
569
-extern int has_sha1_kept_pack(const unsigned char *sha1);
569
extern int has_sha1_file(const unsigned char *sha1);
570
extern int has_loose_object_nonlocal(const unsigned char *sha1);
571
revision.c
+1
-8
@@ -1062,10 +1062,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
1062
revs->edge_hint = 1;
1063
} else if (!strcmp(arg, "--unpacked")) {
1064
revs->unpacked = 1;
1065
- revs->kept_pack_only = 0;
1066
- } else if (!strcmp(arg, "--kept-pack-only")) {
1067
- revs->unpacked = 1;
1068
- revs->kept_pack_only = 1;
1065
} else if (!prefixcmp(arg, "--unpacked=")) {
1066
die("--unpacked=<packfile> no longer supported.");
1067
} else if (!strcmp(arg, "-r")) {
@@ -1475,10 +1471,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
1471
{
1472
if (commit->object.flags & SHOWN)
1473
return commit_ignore;
1478
- if (revs->unpacked &&
1479
- (revs->kept_pack_only
1480
- ? has_sha1_kept_pack(commit->object.sha1)
1481
- : has_sha1_pack(commit->object.sha1)))
1474
+ if (revs->unpacked && has_sha1_pack(commit->object.sha1))
1475
return commit_ignore;
1476
if (revs->show_all)
1477
return commit_show;
revision.h
-1
@@ -48,7 +48,6 @@ struct rev_info {
48
edge_hint:1,
49
limited:1,
50
unpacked:1,
51
- kept_pack_only:1,
51
boundary:2,
52
left_right:1,
53
rewrite_parents:1,
sha1_file.c
+1
-20
@@ -1856,8 +1856,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
1856
return 0;
1857
}
1858
1859
-static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
1860
- int kept_pack_only)
1859
+static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
1860
{
1861
static struct packed_git *last_found = (void *)1;
1862
struct packed_git *p;
@@ -1869,8 +1868,6 @@ static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
1868
p = (last_found == (void *)1) ? packed_git : last_found;
1869
1870
do {
1872
- if (kept_pack_only && !p->pack_keep)
1873
- goto next;
1871
if (p->num_bad_objects) {
1872
unsigned i;
1873
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,
1907
return 0;
1908
}
1909
1913
-static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
1914
-{
1915
- return find_pack_ent(sha1, e, 0);
1916
-}
1917
-
1918
-static int find_kept_pack_entry(const unsigned char *sha1, struct pack_entry *e)
1919
-{
1920
- return find_pack_ent(sha1, e, 1);
1921
-}
1922
-
1910
struct packed_git *find_sha1_pack(const unsigned char *sha1,
1911
struct packed_git *packs)
1912
{
@@ -2387,12 +2374,6 @@ int has_sha1_pack(const unsigned char *sha1)
2374
return find_pack_entry(sha1, &e);
2375
}
2376
2390
-int has_sha1_kept_pack(const unsigned char *sha1)
2391
-{
2392
- struct pack_entry e;
2393
- return find_kept_pack_entry(sha1, &e);
2394
-}
2395
-
2377
int has_sha1_file(const unsigned char *sha1)
2378
{
2379
struct pack_entry e;