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>
This commit is contained in:
parent
79bc4c7155
commit
4d6acb7041
@ -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;
|
||||
|
1
cache.h
1
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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
21
sha1_file.c
21
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;
|
||||
|
Loading…
Reference in New Issue
Block a user