Skip to content

Commit 2c61f4f

Browse files
avargitster
authored andcommitted
core doc: modernize core.bigFileThreshold documentation
The core.bigFileThreshold documentation has been largely unchanged since 5eef828 (fast-import: Stream very large blobs directly to pack, 2010-02-01). But since then this setting has been expanded to affect a lot more than that description indicated. Most notably in how "git diff" treats them, see 6bf3b81 (diff --stat: mark any file larger than core.bigfilethreshold binary, 2014-08-16). In addition to that, numerous commands and APIs make use of a streaming mode for files above this threshold. So let's attempt to summarize 12 years of changes in behavior, which can be seen with: git log --oneline -Gbig_file_thre 5eef828.. -- '*.c' To do that turn this into a bullet-point list. The summary Han Xin produced in [1] helped a lot, but is a bit too detailed for documentation aimed at users. Let's instead summarize how user-observable behavior differs, and generally describe how we tend to stream these files in various commands. 1. https://lore.kernel.org/git/[email protected]/ Helped-by: Han Xin <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 140fa89 commit 2c61f4f

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

Documentation/config/core.txt

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -444,17 +444,32 @@ You probably do not need to adjust this value.
444444
Common unit suffixes of 'k', 'm', or 'g' are supported.
445445

446446
core.bigFileThreshold::
447-
Files larger than this size are stored deflated, without
448-
attempting delta compression. Storing large files without
449-
delta compression avoids excessive memory usage, at the
450-
slight expense of increased disk usage. Additionally files
451-
larger than this size are always treated as binary.
447+
The size of files considered "big", which as discussed below
448+
changes the behavior of numerous git commands, as well as how
449+
such files are stored within the repository. The default is
450+
512 MiB. Common unit suffixes of 'k', 'm', or 'g' are
451+
supported.
452452
+
453-
Default is 512 MiB on all platforms. This should be reasonable
454-
for most projects as source code and other text files can still
455-
be delta compressed, but larger binary media files won't be.
453+
Files above the configured limit will be:
456454
+
457-
Common unit suffixes of 'k', 'm', or 'g' are supported.
455+
* Stored deflated, without attempting delta compression.
456+
+
457+
The default limit is primarily set with this use-case in mind. With it
458+
most projects will have their source code and other text files delta
459+
compressed, but not larger binary media files.
460+
+
461+
Storing large files without delta compression avoids excessive memory
462+
usage, at the slight expense of increased disk usage.
463+
+
464+
* Will be treated as if though they were labeled "binary" (see
465+
linkgit:gitattributes[5]). This means that e.g. linkgit:git-log[1]
466+
and linkgit:git-diff[1] will not diffs for files above this limit.
467+
+
468+
* Will be generally be streamed when written, which avoids excessive
469+
memory usage, at the cost of some fixed overhead. Commands that make
470+
use of this include linkgit:git-archive[1],
471+
linkgit:git-fast-import[1], linkgit:git-index-pack[1] and
472+
linkgit:git-fsck[1].
458473

459474
core.excludesFile::
460475
Specifies the pathname to the file that contains patterns to

0 commit comments

Comments
 (0)