summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-23entry: add checkout_entry_ca() taking preloaded conv_attrsLibravatar Matheus Tavares2-7/+20
The parallel checkout machinery will call checkout_entry() for entries that could not be written in parallel due to path collisions. At this point, we will already be holding the conversion attributes for each entry, and it would be wasteful to let checkout_entry() load these again. Instead, let's add the checkout_entry_ca() variant, which optionally takes a preloaded conv_attrs struct. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-23entry: move conv_attrs lookup up to checkout_entry()Libravatar Matheus Tavares1-11/+27
In a following patch, checkout_entry() will use conv_attrs to decide whether an entry should be enqueued for parallel checkout or not. But the attributes lookup only happens lower in this call stack. To avoid the unnecessary work of loading the attributes twice, let's move it up to checkout_entry(), and pass the loaded struct down to write_entry(). Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-23entry: extract update_ce_after_write() from write_entry()Libravatar Matheus Tavares2-9/+18
The code that updates the in-memory index information after an entry is written currently resides in write_entry(). Extract it to a public function so that it can be called by the parallel checkout functions, outside entry.c, in a later patch. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-23entry: make fstat_output() and read_blob_entry() publicLibravatar Matheus Tavares2-4/+7
These two functions will be used by the parallel checkout code, so let's make them public. Note: fstat_output() is renamed to fstat_checkout_output(), now that it has become public, seeking to avoid future name collisions. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-23entry: extract a header file for entry.c functionsLibravatar Matheus Tavares9-32/+49
The declarations of entry.c's public functions and structures currently reside in cache.h. Although not many, they contribute to the size of cache.h and, when changed, cause the unnecessary recompilation of modules that don't really use these functions. So let's move them to a new entry.h header. While at it let's also move a comment related to checkout_entry() from entry.c to entry.h as it's more useful to describe the function there. Original-patch-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-18convert: add classification for conv_attrs structLibravatar Jeff Hostetler2-7/+52
Create `enum conv_attrs_classification` to express the different ways that attributes are handled for a blob during checkout. This will be used in a later commit when deciding whether to add a file to the parallel or delayed queue during checkout. For now, we can also use it in get_stream_filter_ca() to simplify the function (as the classifying logic is the same). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-18convert: add get_stream_filter_ca() variantLibravatar Jeff Hostetler2-11/+19
Like the previous patch, we will also need to call get_stream_filter() with a precomputed `struct conv_attrs`, when we add support for parallel checkout workers. So add the _ca() variant which takes the conversion attributes struct as a parameter. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-18convert: add [async_]convert_to_working_tree_ca() variantsLibravatar Jeff Hostetler2-37/+60
Separate the attribute gathering from the actual conversion by adding _ca() variants of the conversion functions. These variants receive a precomputed 'struct conv_attrs', not relying, thus, on an index state. They will be used in a future patch adding parallel checkout support, for two reasons: - We will already load the conversion attributes in checkout_entry(), before conversion, to decide whether a path is eligible for parallel checkout. Therefore, it would be wasteful to load them again later, for the actual conversion. - The parallel workers will be responsible for reading, converting and writing blobs to the working tree. They won't have access to the main process' index state, so they cannot load the attributes. Instead, they will receive the preloaded ones and call the _ca() variant of the conversion functions. Furthermore, the attributes machinery is optimized to handle paths in sequential order, so it's better to leave it for the main process, anyway. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-18convert: make convert_attrs() and convert structs publicLibravatar Jeff Hostetler2-27/+32
Move convert_attrs() declaration from convert.c to convert.h, together with the conv_attrs struct and the crlf_action enum. This function and the data structures will be used outside convert.c in the upcoming parallel checkout implementation. Note that crlf_action is renamed to convert_crlf_action, which is more appropriate for the global namespace. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-15Git 2.31Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-14Merge branch 'jn/mergetool-hideresolved-is-optional'Libravatar Junio C Hamano3-8/+7
Disable the recent mergetool's hideresolved feature by default for backward compatibility and safety. * jn/mergetool-hideresolved-is-optional: doc: describe mergetool configuration in git-mergetool(1) mergetool: do not enable hideResolved by default
2021-03-14Merge branch 'tb/pack-revindex-on-disk'Libravatar Junio C Hamano1-1/+2
Fix for a topic in 'master'. * tb/pack-revindex-on-disk: pack-revindex.c: don't close unopened file descriptors
2021-03-14Merge tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano16-43702/+75702
l10n for Git 2.31.0 round 2 * tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.31.0 l10n round 1 and 2 l10n: de.po: Update German translation for Git v2.31.0 l10n: pt_PT: add Portuguese translations part 1 l10n: vi.po(5104t): for git v2.31.0 l10n round 2 l10n: es: 2.31.0 round 2 l10n: Add translation team info l10n: start Indonesian translation l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated) l10n: bg.po: Updated Bulgarian translation (5104t) l10n: fr: v2.31 rnd 2 l10n: tr: v2.31.0-rc1 l10n: sv.po: Update Swedish translation (5104t0f0u) l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed) l10n: tr: v2.31.0-rc0 l10n: sv.po: Update Swedish translation (5103t0f0u) l10n: pl.po: Update translation l10n: fr: v2.31.0 rnd 1 l10n: git.pot: v2.31.0 round 1 (155 new, 89 removed) l10n: Update Catalan translation l10n: ru.po: update Russian translation
2021-03-15l10n: zh_CN: for git v2.31.0 l10n round 1 and 2Libravatar Jiang Xin1-2985/+3337
Translate 161 new messages (5104t0f0u) for git 2.31.0. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2021-03-15Merge branch 'master' of github.com:vnwildman/gitLibravatar Jiang Xin1-3051/+3508
* 'master' of github.com:vnwildman/git: l10n: vi.po(5104t): for git v2.31.0 l10n round 2
2021-03-14Merge branch 'l10n/zh_TW/210301' of github.com:l10n-tw/git-poLibravatar Jiang Xin1-3072/+3535
* 'l10n/zh_TW/210301' of github.com:l10n-tw/git-po: l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)
2021-03-14Merge branch 'po-id' of github.com:bagasme/git-poLibravatar Jiang Xin2-0/+24362
* 'po-id' of github.com:bagasme/git-po: l10n: Add translation team info l10n: start Indonesian translation
2021-03-14Merge branch 'master' of github.com:Softcatala/git-poLibravatar Jiang Xin1-13/+12
* 'master' of github.com:Softcatala/git-po: l10n: Update Catalan translation
2021-03-14Merge branch 'russian-l10n' of github.com:DJm00n/git-po-ruLibravatar Jiang Xin1-5661/+7873
* 'russian-l10n' of github.com:DJm00n/git-po-ru: l10n: ru.po: update Russian translation
2021-03-14Merge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-poLibravatar Jiang Xin1-2902/+3226
* 'pt-PT' of github.com:git-l10n-pt-PT/git-po: l10n: pt_PT: add Portuguese translations part 1
2021-03-13doc: describe mergetool configuration in git-mergetool(1)Libravatar Jonathan Nieder1-0/+4
In particular, this describes mergetool.hideResolved, which can help users discover this setting (either because it may be useful to them or in order to understand mergetool's behavior if they have forgotten setting it in the past). Tested by running make -C Documentation git-mergetool.1 man Documentation/git-mergetool.1 and reading through the page. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-13mergetool: do not enable hideResolved by defaultLibravatar Jonathan Nieder2-8/+3
When 98ea309b3f (mergetool: add hideResolved configuration, 2021-02-09) introduced the mergetool.hideResolved setting to reduce the clutter in viewing non-conflicted sections of files in a mergetool, it enabled it by default, explaining: No adverse effects were noted in a small survey of popular mergetools[1] so this behavior defaults to `true`. In practice, alas, adverse effects do appear. A few issues: 1. No indication is shown in the UI that the base, local, and remote versions shown have been modified by additional resolution. This is inherent in the design: the idea of mergetool.hideResolved is to convince a mergetool that expects pristine local, base, and remote files to show partially resolved verisons of those files instead; there is no additional source of information accessible to the mergetool to see where the resolution has happened. (By contrast, a mergetool generating the partial resolution from conflict markers for itself would be able to hilight the resolved sections with a different color.) A user accustomed to seeing the files without partial resolution gets no indication that this behavior has changed when they upgrade Git. 2. If the computed merge did not line up the files correctly (for example due to repeated sections in the file), the partially resolved files can be misleading and do not have enough information to reconstruct what happened and compute the correct merge result. 3. Resolving a conflict can involve information beyond the textual conflict. For example, if the local and remote versions added overlapping functionality in different ways, seeing the full unresolved versions of each alongside the base gives information about each side's intent that makes it possible to come up with a resolution that combines those two intents. By contrast, when starting with partially resolved versions of those files, one can produce a subtly wrong resolution that includes redundant extra code added by one side that is not needed in the approach taken on the other. All that said, a user wanting to focus on textual conflicts with reduced clutter can still benefit from mergetool.hideResolved=true as a way to deemphasize sections of the code that resolve cleanly without requiring any changes to the invoked mergetool. The caveats described above are reduced when the user has explicitly turned this on, because then the user is aware of them. Flip the default to 'false'. Reported-by: Dana Dahlstrom <dahlstrom@google.com> Helped-by: Seth House <seth@eseth.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-08Git 2.31-rc2Libravatar Junio C Hamano2-1/+3
2021-03-08Sync with Git 2.30.2 for CVE-2021-21300Libravatar Junio C Hamano23-4/+292
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-08Merge branch 'jt/transfer-fsck-across-packs-fix'Libravatar Junio C Hamano2-2/+23
The code to fsck objects received across multiple packs during a single git fetch session has been broken when the packfile URI feature was in use. A workaround has been added by disabling the codepath to avoid keeping a packfile that is too small. * jt/transfer-fsck-across-packs-fix: fetch-pack: do not mix --pack_header and packfile uri
2021-03-08l10n: de.po: Update German translation for Git v2.31.0Libravatar Matthias Rüster1-3208/+3565
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com> Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com> Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2021-03-08l10n: pt_PT: add Portuguese translations part 1Libravatar Daniel Santos1-2902/+3226
* Newlines corrected. * Add concept translation table. * Translated some. * Corrected some. * Corrected some 'Negation of Emptiness'. Signed-off-by: Daniel Santos <hello@brighterdan.com>
2021-03-08l10n: vi.po(5104t): for git v2.31.0 l10n round 2Libravatar Tran Ngoc Quan1-3051/+3508
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2021-03-07l10n: es: 2.31.0 round 2Libravatar Christopher Diaz Riveros1-4822/+5924
Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
2021-03-07l10n: Add translation team infoLibravatar Bagas Sanjaya1-0/+4
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2021-03-07l10n: start Indonesian translationLibravatar Bagas Sanjaya1-0/+24358
* Initialize PO file * Translate init-db.c * Translate wt-status.c * Translate builtin/clone.c * Translate builtin/checkout.c * Translate builtin/fetch.c * Complete core translations: * builtin/remote.c * builtin/index-pack.c * push.c * reset.c * Sync with l10n upstream Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2021-03-05fetch-pack: do not mix --pack_header and packfile uriLibravatar Jonathan Tan2-2/+23
When fetching (as opposed to cloning) from a repository with packfile URIs enabled, an error like this may occur: fatal: pack has bad object at offset 12: unknown object type 5 fatal: finish_http_pack_request gave result -1 fatal: fetch-pack: expected keep then TAB at start of http-fetch output This bug was introduced in b664e9ffa1 ("fetch-pack: with packfile URIs, use index-pack arg", 2021-02-22), when the index-pack args used when processing the inline packfile of a fetch response and when processing packfile URIs were unified. This bug happens because fetch, by default, partially reads (and consumes) the header of the inline packfile to determine if it should store the downloaded objects as a packfile or loose objects, and thus passes --pack_header=<...> to index-pack to inform it that some bytes are missing. However, when it subsequently fetches the additional packfiles linked by URIs, it reuses the same index-pack arguments, thus wrongly passing --index-pack-arg=--pack_header=<...> when no bytes are missing. This does not happen when cloning because "git clone" always passes do_keep, which instructs the fetch mechanism to always retain the packfile, eliminating the need to read the header. There are a few ways to fix this, including filtering out pack_header arguments when downloading the additional packfiles, but I decided to stick to always using index-pack throughout when packfile URIs are present - thus, Git no longer needs to read the bytes, and no longer needs --pack_header here. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-06l10n: zh_TW.po: v2.31.0 round 2 (15 untranslated)Libravatar Yi-Jyun Pan1-3072/+3535
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2021-03-05l10n: bg.po: Updated Bulgarian translation (5104t)Libravatar Alexander Shopov1-3060/+3440
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2021-03-05Merge branch 'fr_next' of github.com:jnavila/gitLibravatar Jiang Xin1-332/+411
* 'fr_next' of github.com:jnavila/git: l10n: fr: v2.31 rnd 2
2021-03-05Merge branch 'master' of github.com:nafmo/git-l10n-svLibravatar Jiang Xin1-297/+324
* 'master' of github.com:nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (5104t0f0u)
2021-03-04Merged the open-eintr workaround for macOSLibravatar Junio C Hamano1-0/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-04Documentation/RelNotes: improve release note for rename detection workLibravatar Elijah Newren1-1/+1
There were some early changes in the 2.31 cycle to optimize some setup in diffcore-rename.c[1], some later changes to measure performance[2], and finally some significant changes to improve rename detection performance. The final one was merged with the note Performance optimization work on the rename detection continues. That works for the commit log, but feels misleading as a release note since all the changes were within one cycle. Simplify this to just Performance improvements for rename detection. The former wording could be seen as hinting that more performance improvements will come in 2.32, which is true, but we can just cover those in the 2.32 release notes when the time comes. [1] a5ac31b5b1 (Merge branch 'en/diffcore-rename', 2021-01-25) [2] d3a035b055 (Merge branch 'en/merge-ort-perf', 2021-02-11) [3] 12bd17521c (Merge branch 'en/diffcore-rename', 2021-03-01) Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-04Merge branch 'jk/open-returns-eintr'Libravatar Junio C Hamano5-0/+42
Work around platforms whose open() is reported to return EINTR (it shouldn't, as we do our signals with SA_RESTART). * jk/open-returns-eintr: config.mak.uname: enable OPEN_RETURNS_EINTR for macOS Big Sur Makefile: add OPEN_RETURNS_EINTR knob
2021-03-04l10n: fr: v2.31 rnd 2Libravatar Jean-Noël Avila1-332/+411
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2021-03-04Merge https://github.com/prati0100/git-guiLibravatar Junio C Hamano2-21/+2
* https://github.com/prati0100/git-gui: Revert "git-gui: remove lines starting with the comment character"
2021-03-04l10n: tr: v2.31.0-rc1Libravatar Emir Sarı1-309/+317
Signed-off-by: Emir Sarı <bitigchi@me.com>
2021-03-04l10n: sv.po: Update Swedish translation (5104t0f0u)Libravatar Peter Krefting1-297/+324
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2021-03-04l10n: git.pot: v2.31.0 round 2 (9 new, 8 removed)Libravatar Jiang Xin1-292/+298
Generate po/git.pot from v2.31.0-rc1 for git v2.31.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2021-03-04Merge branch 'master' of github.com:git/gitLibravatar Jiang Xin48-924/+1948
* 'master' of github.com:git/git: (63 commits) Git 2.31-rc1 Hopefully the last batch before -rc1 Revert "commit-graph: when incompatible with graphs, indicate why" read-cache: make the index write buffer size 128K dir: fix malloc of root untracked_cache_dir commit-graph.c: display correct number of chunks when writing doc/reftable: document how to handle windows fetch-pack: print and use dangling .gitmodules fetch-pack: with packfile URIs, use index-pack arg http-fetch: allow custom index-pack args http: allow custom index-pack args chunk-format: add technical docs chunk-format: restore duplicate chunk checks midx: use 64-bit multiplication for chunk sizes midx: use chunk-format read API commit-graph: use chunk-format read API chunk-format: create read chunk API midx: use chunk-format API in write_midx_internal() midx: drop chunk progress during write midx: return success/failure in chunk write methods ...
2021-03-04Merge branch 'py/revert-commit-comments'Libravatar Pratyush Yadav2-21/+2
This commit causes breakage on macOS, or in fact any platform using older versions of Tcl. Revert it. * py/revert-commit-comments: Revert "git-gui: remove lines starting with the comment character"
2021-03-04Revert "git-gui: remove lines starting with the comment character"Libravatar Pratyush Yadav2-21/+2
This reverts commit b9a43869c9f96d3577d6f568c1bda1940c8f0e31. This commit causes breakage on macOS (10.13). It causes errors on startup and completely breaks the commit functionality. There are two main problems. First, it uses `string cat` which is not supported on older Tcl versions. Second, it does a half close of the bidirectional pipe to git-stripspace which is also not supported on older Tcl versions. Reported-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
2021-03-02Git 2.31-rc1Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-02l10n: tr: v2.31.0-rc0Libravatar Emir Sarı1-2889/+3252
Signed-off-by: Emir Sarı <bitigchi@me.com>
2021-03-01Hopefully the last batch before -rc1Libravatar Junio C Hamano1-0/+31
Signed-off-by: Junio C Hamano <gitster@pobox.com>