Skip to content

Commit

Permalink
pack.indexversion config option now defaults to 2
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Jun 26, 2008
1 parent 22c79ea commit c0a5e2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions Documentation/asciidoc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# the command.

[attributes]
asterisk=&#42;
plus=&#43;
caret=&#94;
startsb=&#91;
Expand Down
14 changes: 11 additions & 3 deletions Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,17 @@ pack.indexVersion::
legacy pack index used by Git versions prior to 1.5.2, and 2 for
the new pack index with capabilities for packs larger than 4 GB
as well as proper protection against the repacking of corrupted
packs. Version 2 is selected and this config option ignored
whenever the corresponding pack is larger than 2 GB. Otherwise
the default is 1.
packs. Version 2 is the default. Note that version 2 is enforced
and this config option ignored whenever the corresponding pack is
larger than 2 GB.
+
If you have an old git that does not understand the version 2 `{asterisk}.idx` file,
cloning or fetching over a non native protocol (e.g. "http" and "rsync")
that will copy both `{asterisk}.pack` file and corresponding `{asterisk}.idx` file from the
other side may give you a repository that cannot be accessed with your
older version of git. If the `{asterisk}.pack` file is smaller than 2 GB, however,
you can use linkgit:git-index-pack[1] on the *.pack file to regenerate
the `{asterisk}.idx` file.

pack.packSizeLimit::
The default maximum size of a pack. This setting only affects
Expand Down
2 changes: 1 addition & 1 deletion pack-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "pack.h"
#include "csum-file.h"

uint32_t pack_idx_default_version = 1;
uint32_t pack_idx_default_version = 2;
uint32_t pack_idx_off32_limit = 0x7fffffff;

static int sha1_compare(const void *_a, const void *_b)
Expand Down

0 comments on commit c0a5e2d

Please sign in to comment.