Skip to content

Commit c0a5e2d

Browse files
Nicolas Pitregitster
authored andcommitted
pack.indexversion config option now defaults to 2
As announced for 1.6.0. Git older than version 1.5.2 (or any other git version with this option set to 1) may revert to version 1 of the pack index by manually deleting all .idx files and recreating them using 'git index-pack'. Communication over the git native protocol is unaffected since the pack index is never transferred. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 22c79ea commit c0a5e2d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Documentation/asciidoc.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# the command.
99

1010
[attributes]
11+
asterisk=&#42;
1112
plus=&#43;
1213
caret=&#94;
1314
startsb=&#91;

Documentation/config.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,17 @@ pack.indexVersion::
937937
legacy pack index used by Git versions prior to 1.5.2, and 2 for
938938
the new pack index with capabilities for packs larger than 4 GB
939939
as well as proper protection against the repacking of corrupted
940-
packs. Version 2 is selected and this config option ignored
941-
whenever the corresponding pack is larger than 2 GB. Otherwise
942-
the default is 1.
940+
packs. Version 2 is the default. Note that version 2 is enforced
941+
and this config option ignored whenever the corresponding pack is
942+
larger than 2 GB.
943+
+
944+
If you have an old git that does not understand the version 2 `{asterisk}.idx` file,
945+
cloning or fetching over a non native protocol (e.g. "http" and "rsync")
946+
that will copy both `{asterisk}.pack` file and corresponding `{asterisk}.idx` file from the
947+
other side may give you a repository that cannot be accessed with your
948+
older version of git. If the `{asterisk}.pack` file is smaller than 2 GB, however,
949+
you can use linkgit:git-index-pack[1] on the *.pack file to regenerate
950+
the `{asterisk}.idx` file.
943951

944952
pack.packSizeLimit::
945953
The default maximum size of a pack. This setting only affects

pack-write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "pack.h"
33
#include "csum-file.h"
44

5-
uint32_t pack_idx_default_version = 1;
5+
uint32_t pack_idx_default_version = 2;
66
uint32_t pack_idx_off32_limit = 0x7fffffff;
77

88
static int sha1_compare(const void *_a, const void *_b)

0 commit comments

Comments
 (0)