Skip to content

Commit 4d6acb7

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 79bc4c7 commit 4d6acb7

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

builtin-pack-objects.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,6 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
21492149
continue;
21502150
}
21512151
if (!strcmp("--unpacked", arg) ||
2152-
!strcmp("--kept-pack-only", arg) ||
21532152
!strcmp("--reflog", arg) ||
21542153
!strcmp("--all", arg)) {
21552154
use_internal_rev_list = 1;

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
566566
extern int move_temp_to_file(const char *tmpfile, const char *filename);
567567

568568
extern int has_sha1_pack(const unsigned char *sha1);
569-
extern int has_sha1_kept_pack(const unsigned char *sha1);
570569
extern int has_sha1_file(const unsigned char *sha1);
571570
extern int has_loose_object_nonlocal(const unsigned char *sha1);
572571

revision.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,10 +1062,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
10621062
revs->edge_hint = 1;
10631063
} else if (!strcmp(arg, "--unpacked")) {
10641064
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;
10691065
} else if (!prefixcmp(arg, "--unpacked=")) {
10701066
die("--unpacked=<packfile> no longer supported.");
10711067
} else if (!strcmp(arg, "-r")) {
@@ -1475,10 +1471,7 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
14751471
{
14761472
if (commit->object.flags & SHOWN)
14771473
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))
14821475
return commit_ignore;
14831476
if (revs->show_all)
14841477
return commit_show;

revision.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct rev_info {
4848
edge_hint:1,
4949
limited:1,
5050
unpacked:1,
51-
kept_pack_only:1,
5251
boundary:2,
5352
left_right:1,
5453
rewrite_parents:1,

sha1_file.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,8 +1856,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
18561856
return 0;
18571857
}
18581858

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)
18611860
{
18621861
static struct packed_git *last_found = (void *)1;
18631862
struct packed_git *p;
@@ -1869,8 +1868,6 @@ static int find_pack_ent(const unsigned char *sha1, struct pack_entry *e,
18691868
p = (last_found == (void *)1) ? packed_git : last_found;
18701869

18711870
do {
1872-
if (kept_pack_only && !p->pack_keep)
1873-
goto next;
18741871
if (p->num_bad_objects) {
18751872
unsigned i;
18761873
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,
19101907
return 0;
19111908
}
19121909

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-
19231910
struct packed_git *find_sha1_pack(const unsigned char *sha1,
19241911
struct packed_git *packs)
19251912
{
@@ -2387,12 +2374,6 @@ int has_sha1_pack(const unsigned char *sha1)
23872374
return find_pack_entry(sha1, &e);
23882375
}
23892376

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-
23962377
int has_sha1_file(const unsigned char *sha1)
23972378
{
23982379
struct pack_entry e;

0 commit comments

Comments
 (0)