summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-06-04index-pack: fix truncation of off_t in comparisonLibravatar Jeff King1-2/+6
Commit c6458e6 (index-pack: kill union delta_base to save memory, 2015-04-18) refactored the comparison functions used in sorting and binary searching our delta list. The resulting code does something like: int cmp_offsets(off_t a, off_t b) { return a - b; } This works most of the time, but produces nonsensical results when the difference between the two offsets is larger than what can be stored in an "int". This can lead to unresolved deltas if the packsize is larger than 2G (even on 64-bit systems, an int is still typically 32 bits): $ git clone git://github.com/mozilla/gecko-dev Cloning into 'gecko-dev'... remote: Counting objects: 4800161, done. remote: Compressing objects: 100% (178/178), done. remote: Total 4800161 (delta 88), reused 0 (delta 0), pack-reused 4799978 Receiving objects: 100% (4800161/4800161), 2.21 GiB | 3.26 MiB/s, done. Resolving deltas: 99% (3808820/3811944), completed with 0 local objects. fatal: pack has 3124 unresolved deltas fatal: index-pack failed We can fix it by doing direct comparisons between the offsets and returning constants; the callers only care about the sign of the comparison, not the magnitude. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-18index-pack: kill union delta_base to save memoryLibravatar Nguyễn Thái Ngọc Duy1-100/+160
Once we know the number of objects in the input pack, we allocate an array of nr_objects of struct delta_entry. On x86-64, this struct is 32 bytes long. The union delta_base, which is part of struct delta_entry, provides enough space to store either ofs-delta (8 bytes) or ref-delta (20 bytes). Because ofs-delta encoding is more efficient space-wise and more performant at runtime than ref-delta encoding, Git packers try to use ofs-delta whenever possible, and it is expected that objects encoded as ref-delta are minority. In the best clone case where no ref-delta object is present, we waste (20-8) * nr_objects bytes because of this union. That's about 38MB out of 100MB for deltas[] with 3.4M objects, or 38%. deltas[] would be around 62MB without the waste. This patch attempts to eliminate that. deltas[] array is split into two: one for ofs-delta and one for ref-delta. Many functions are also duplicated because of this split. With this patch, ofs_deltas[] array takes 51MB. ref_deltas[] should remain unallocated in clone case (0 bytes). This array grows as we see ref-delta. We save about half in this case, or 25% of total bookkeeping. The saving is more than the calculation above because some padding in the old delta_entry struct is removed. ofs_delta_entry is 16 bytes, including the 4 bytes padding. That's 13MB for padding, but packing the struct could break platforms that do not support unaligned access. If someone on 32-bit is really low on memory and only deals with packs smaller than 2G, using 32-bit off_t would eliminate the padding and save 27MB on top. A note about ofs_deltas allocation. We could use ref_deltas memory allocation strategy for ofs_deltas. But that probably just adds more overhead on top. ofs-deltas are generally the majority (1/2 to 2/3) in any pack. Incremental realloc may lead to too many memcpy. And if we preallocate, say 1/2 or 2/3 of nr_objects initially, the growth rate of ALLOC_GROW() could make this array larger than nr_objects, wasting more memory. Brought-up-by: Matthew Sporleder <msporleder@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-27index-pack: reduce object_entry size to save memoryLibravatar Nguyễn Thái Ngọc Duy1-11/+19
For each object in the input pack, we need one struct object_entry. On x86-64, this struct is 64 bytes long. Although: - The 8 bytes for delta_depth and base_object_no are only useful when show_stat is set. And it's never set unless someone is debugging. - The three fields hdr_size, type and real_type take 4 bytes each even though they never use more than 4 bits. By moving delta_depth and base_object_no out of struct object_entry and make the other 3 fields one byte long instead of 4, we shrink 25% of this struct. On a 3.4M object repo (*) that's about 53MB. The saving is less impressive compared to index-pack memory use for basic bookkeeping (**), about 16%. (*) linux-2.6.git already has 4M objects as of v3.19-rc7 so this is not an unrealistic number of objects that we have to deal with. (**) 3.4M * (sizeof(object_entry) + sizeof(delta_entry)) = 311MB Brought-up-by: Matthew Sporleder <msporleder@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-05Git 2.3Libravatar Junio C Hamano3-1/+12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-02Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano1-5/+5
* git://github.com/git-l10n/git-po: l10n: ca.po: Fix trailing whitespace
2015-01-30l10n: ca.po: Fix trailing whitespaceLibravatar Alex Henrie1-5/+5
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-01-27Git 2.3.0-rc2Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-27Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano2-929/+941
* git://github.com/git-l10n/git-po: l10n: de.po: correct singular form l10n: de.po: translate "leave behind" correctly l10n: de.po: fix typo l10n: ca.po: update translation
2015-01-27Merge branch 'master' of git://github.com/alexhenrie/git-poLibravatar Jiang Xin1-925/+937
* 'master' of git://github.com/alexhenrie/git-po: l10n: ca.po: update translation
2015-01-26l10n: de.po: correct singular formLibravatar Michael J Gruber1-1/+1
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: de.po: translate "leave behind" correctlyLibravatar Michael J Gruber1-2/+2
This message is about leaving orphaned commits behind, not about behind an upstream branch. Try to make this clear. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: de.po: fix typoLibravatar Benedikt Heine1-2/+2
Signed-off-by: Benedikt Heine <bebe@bebehei.de> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: ca.po: update translationLibravatar Alex Henrie1-925/+937
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-01-22Merge branch 'js/t1050'Libravatar Junio C Hamano1-6/+6
* js/t1050: t1050-large: generate large files without dd
2015-01-22Merge branch 'ak/cat-file-clean-up'Libravatar Junio C Hamano1-2/+0
* ak/cat-file-clean-up: cat-file: use "type" and "size" from outer scope
2015-01-22Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano7-6423/+6506
* git://github.com/git-l10n/git-po: l10n: correct indentation of show-branch usage l10n: de.po: translate 3 messages l10n: zh_CN: various fixes on command arguments l10n: vi.po(2298t): Updated 3 new strings l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 2 l10n: git.pot: v2.3.0 round 2 (3 updated) l10n: de.po: translate 13 new messages l10n: de.po: fix typo l10n: de.po: translate "track" as "versionieren" l10n: zh_CN: translations for git v2.3.0-rc0 l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 1 l10n: vi.po(2298t): Updated and change Plural-Forms l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed) l10n: ca.po: various fixes
2015-01-22Merge branch 'sh/asciidoc-git-version-fix'Libravatar Junio C Hamano1-1/+1
* sh/asciidoc-git-version-fix: Documentation: fix version numbering
2015-01-22Documentation: fix version numberingLibravatar Sven van Haastregt1-1/+1
Version numbers in asciidoc-generated content (such as man pages) went missing as of da8a366 (Documentation: refactor common operations into variables). Fix by putting the underscore back in the variable name. Signed-off-by: Sven van Haastregt <svenvh@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-22Merge branch 'jh/empty-notes'Libravatar Junio C Hamano1-1/+1
* jh/empty-notes: Fix unclosed here document in t3301.sh
2015-01-22Fix unclosed here document in t3301.shLibravatar Kacper Kornet1-1/+1
Commit 908a3203632a02568df230c0fccf9a2cd8da24e6 introduced indentation to here documents in t3301.sh. However in one place <<-EOF was missing -, which broke this test when run with mksh-50d. This commit fixes it. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-21l10n: correct indentation of show-branch usageLibravatar Jiang Xin6-64/+62
An indentation error was found right after we started l10n round 2, and commit d6589d1 (show-branch: fix indentation of usage string) and this update would fix it. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-01-21Merge branch 'master' of git://github.com/git-l10n/git-poLibravatar Jiang Xin7-6430/+6515
* 'master' of git://github.com/git-l10n/git-po: l10n: de.po: translate 3 messages l10n: zh_CN: various fixes on command arguments l10n: vi.po(2298t): Updated 3 new strings l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 2 l10n: git.pot: v2.3.0 round 2 (3 updated) l10n: de.po: translate 13 new messages l10n: de.po: fix typo l10n: de.po: translate "track" as "versionieren" l10n: zh_CN: translations for git v2.3.0-rc0 l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 1 l10n: vi.po(2298t): Updated and change Plural-Forms l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed) l10n: ca.po: various fixes
2015-01-20Git 2.3.0-rc1Libravatar Junio C Hamano2-1/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-20Merge branch 'jk/http-push-symref-fix'Libravatar Junio C Hamano1-0/+3
* jk/http-push-symref-fix: http-push: trim trailing newline from remote symref
2015-01-20Merge branch 'ak/show-branch-usage-string'Libravatar Junio C Hamano1-3/+3
* ak/show-branch-usage-string: show-branch: fix indentation of usage string
2015-01-20show-branch: fix indentation of usage stringLibravatar Ralf Thielow1-3/+3
Noticed-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-20Merge branch 'jk/colors'Libravatar Junio C Hamano2-0/+5
* jk/colors: parse_color: fix return value for numeric color values 0-8
2015-01-20parse_color: fix return value for numeric color values 0-8Libravatar Jeff King2-0/+5
When commit 695d95d refactored the color parsing, it missed a "return 0" when parsing literal numbers 0-8 (which represent basic ANSI colors), leading us to report these colors as an error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-20l10n: de.po: translate 3 messagesLibravatar Ralf Thielow1-141/+142
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-19l10n: zh_CN: various fixes on command argumentsLibravatar Jiang Xin1-176/+175
Updated translations for Git 2.3.0 l10n round 2, and fixed various translations for command arguments. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-01-19Merge branch 'v2.3.0' of git://github.com/jnavila/gitLibravatar Jiang Xin1-133/+137
* 'v2.3.0' of git://github.com/jnavila/git: l10n: fr.po v2.3.0 round 2
2015-01-19Merge branch 'master' of git://github.com/nafmo/git-l10n-svLibravatar Jiang Xin1-131/+131
* 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (2298t0f0u)
2015-01-19l10n: vi.po(2298t): Updated 3 new stringsLibravatar Tran Ngoc Quan1-137/+137
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2015-01-18l10n: sv.po: Update Swedish translation (2298t0f0u)Libravatar Peter Krefting1-131/+131
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-01-18l10n: fr.po v2.3.0 round 2Libravatar Jean-Noel Avila1-133/+137
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2015-01-18l10n: git.pot: v2.3.0 round 2 (3 updated)Libravatar Jiang Xin1-124/+124
Generate po/git.pot from v2.3.0-rc0-44-ga94655d for git v2.3.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-01-18Merge branch 'master' of git://github.com/git-l10n/git-poLibravatar Jiang Xin7-6003/+6084
* 'master' of git://github.com/git-l10n/git-po: l10n: de.po: translate 13 new messages l10n: de.po: fix typo l10n: de.po: translate "track" as "versionieren" l10n: zh_CN: translations for git v2.3.0-rc0 l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 1 l10n: vi.po(2298t): Updated and change Plural-Forms l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed) l10n: ca.po: various fixes
2015-01-17l10n: de.po: translate 13 new messagesLibravatar Ralf Thielow1-836/+857
Translate 13 new messages came from git.pot update in beb691f (l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-17l10n: de.po: fix typoLibravatar Ralf Thielow1-1/+1
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-17l10n: de.po: translate "track" as "versionieren"Libravatar Ralf Thielow1-20/+20
Suggested-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-17l10n: zh_CN: translations for git v2.3.0-rc0Libravatar Jiang Xin1-830/+853
Translate 13 new messages (2298t0f0u) for git v2.3.0-rc0. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-01-15git-svn: make it play nicely with submodulesLibravatar Ramkumar Ramachandra1-0/+6
It's a simple matter of opening the directory specified in the gitfile. [ew: tweaked check to avoid open() on directories] Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2015-01-15Git::SVN: handle missing ref_id case correctlyLibravatar Ramkumar Ramachandra1-1/+1
ref_id should not match "refs/remotes/". [ew: dropped initial hunk for GIT_SVN_ID at Ramkumar's request] Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2015-01-14l10n: sv.po: Update Swedish translation (2298t0f0u)Libravatar Peter Krefting1-842/+865
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-01-14t1050-large: generate large files without ddLibravatar Johannes Sixt1-6/+6
For some unknown reason, the dd on my Windows box segfaults randomly, but since recently, it does so much more often than it used to, which makes running the test suite burdensome. Use printf to write large files instead of dd. To emphasize that three of the large blobs are exact copies, use cp to allocate them. The new code makes the files a bit smaller, and they are not sparse anymore, but the tests do not depend on these properties. We do not want to use test-genrandom here (which is used to generate large files elsewhere in t1050), so that the files can be compressed well (which keeps the run-time short). The files are now large text files, not binary files. But since they are larger than core.bigfilethreshold they are diagnosed as binary by Git. For this reason, the 'git diff' tests that check the output for "Binary files differ" still pass. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-14Fifth batch for 2.3 cycleLibravatar Junio C Hamano1-2/+27
Hopefully this will be the final feature update for 2.3-rc1 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-14Merge branch 'po/doc-core-ignorestat'Libravatar Junio C Hamano1-8/+13
* po/doc-core-ignorestat: doc: core.ignoreStat update, and clarify the --assume-unchanged effect doc: core.ignoreStat clarify the --assume-unchanged effect
2015-01-14Merge branch 'rc/for-each-ref-tracking'Libravatar Junio C Hamano2-2/+22
* rc/for-each-ref-tracking: for-each-ref: always check stat_tracking_info()'s return value
2015-01-14Merge branch 'rh/autoconf-rhel3'Libravatar Junio C Hamano5-1/+56
Build update for older RHEL. * rh/autoconf-rhel3: configure.ac: check for HMAC_CTX_cleanup configure.ac: check for clock_gettime and CLOCK_MONOTONIC configure.ac: check 'tv_nsec' field in 'struct stat'
2015-01-14Merge branch 'ak/fewer-includes'Libravatar Junio C Hamano2-7/+0
* ak/fewer-includes: cat-file: remove unused includes git.c: remove unnecessary #includes