Skip to content

Commit

Permalink
Remove --kept-pack-only option and associated infrastructure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Mar 20, 2009
1 parent 79bc4c7 commit 4d6acb7
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 31 deletions.
1 change: 0 additions & 1 deletion builtin-pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 1 addition & 8 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
21 changes: 1 addition & 20 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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++)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4d6acb7

Please sign in to comment.