@matheusbsbs / matheus-bagliano / commits / e96fb9b8f9
Fork 0

pack-objects: new option --honor-pack-keep

This adds a new option to pack-objects which will cause it to ignore an object which appears in a local pack which has a .keep file, even if it was specified for packing. This option will be used by the porcelain repack. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Nov 12, 2008 at 11:59 UTC e96fb9b8f90f907d720ea6b71c92e30c2b071f4a
2 files changed +12
Documentation/git-pack-objects.txt
+5
@@ -109,6 +109,11 @@ base-name::
109 The default is unlimited, unless the config variable
110 `pack.packSizeLimit` is set.
111
112 +--honor-pack-keep::
113 + This flag causes an object already in a local pack that
114 + has a .keep file to be ignored, even if it appears in the
115 + standard input.
116 +
117 --incremental::
118 This flag causes an object already in a pack ignored
119 even if it appears in the standard input.
builtin-pack-objects.c
+7
@@ -71,6 +71,7 @@ static int reuse_delta = 1, reuse_object = 1;
71 static int keep_unreachable, unpack_unreachable, include_tag;
72 static int local;
73 static int incremental;
74 +static int ignore_packed_keep;
75 static int allow_ofs_delta;
76 static const char *base_name;
77 static int progress = 1;
@@ -703,6 +704,8 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
704 return 0;
705 if (local && !p->pack_local)
706 return 0;
707 + if (ignore_packed_keep && p->pack_local && p->pack_keep)
708 + return 0;
709 }
710 }
711
@@ -2042,6 +2045,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
2045 incremental = 1;
2046 continue;
2047 }
2048 + if (!strcmp("--honor-pack-keep", arg)) {
2049 + ignore_packed_keep = 1;
2050 + continue;
2051 + }
2052 if (!prefixcmp(arg, "--compression=")) {
2053 char *end;
2054 int level = strtoul(arg+14, &end, 0);