aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-07-02Yet another batch of post 2.45.2 updates from the 'master' frontJunio C Hamano1-0/+27
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02Merge branch 'rs/remove-unused-find-header-mem' into maint-2.45Junio C Hamano2-19/+2
Code clean-up. * rs/remove-unused-find-header-mem: commit: remove find_header_mem()
2024-07-02Merge branch 'jc/worktree-git-path' into maint-2.45Junio C Hamano3-8/+10
Code cleanup. * jc/worktree-git-path: worktree_git_path(): move the declaration to path.h
2024-07-02Merge branch 'jk/fetch-pack-fsck-wo-lock-pack' into maint-2.45Junio C Hamano2-1/+13
"git fetch-pack -k -k" without passing "--lock-pack" (which we never do ourselves) did not work at all, which has been corrected. * jk/fetch-pack-fsck-wo-lock-pack: fetch-pack: fix segfault when fscking without --lock-pack
2024-07-02Merge branch 'jk/t5500-typofix' into maint-2.45Junio C Hamano1-1/+1
A helper function shared between two tests had a copy-paste bug, which has been corrected. * jk/t5500-typofix: t5500: fix mistaken $SERVER reference in helper function
2024-07-02Merge branch 'js/mingw-remove-unused-extern-decl' into maint-2.45Junio C Hamano1-1/+0
An unused extern declaration for mingw has been removed to prevent it from causing build failure. * js/mingw-remove-unused-extern-decl: mingw: drop bogus (and unneeded) declaration of `_pgmptr`
2024-07-02Merge branch 'jc/no-default-attr-tree-in-bare' into maint-2.45Junio C Hamano1-3/+2
Earlier we stopped using the tree of HEAD as the default source of attributes in a bare repository, but failed to document it. This has been corrected. * jc/no-default-attr-tree-in-bare: attr.tree: HEAD:.gitattributes is no longer the default in a bare repo
2024-07-02Merge branch 'tb/precompose-getcwd' into maint-2.45Junio C Hamano2-2/+39
We forgot to normalize the result of getcwd() to NFC on macOS where all other paths are normalized, which has been corrected. This still does not address the case where core.precomposeUnicode configuration is not defined globally. * tb/precompose-getcwd: macOS: ls-files path fails if path of workdir is NFD
2024-07-02Merge branch 'pw/rebase-i-error-message' into maint-2.45Junio C Hamano9-30/+153
When the user adds to "git rebase -i" instruction to "pick" a merge commit, the error experience is not pleasant. Such an error is now caught earlier in the process that parses the todo list. * pw/rebase-i-error-message: rebase -i: improve error message when picking merge rebase -i: pass struct replay_opts to parse_insn_line()
2024-07-02Merge branch 'ds/format-patch-rfc-and-k' into maint-2.45Junio C Hamano2-1/+24
The "-k" and "--rfc" options of "format-patch" will now error out when used together, as one tells us not to add anything to the title of the commit, and the other one tells us to add "RFC" in addition to "PATCH". * ds/format-patch-rfc-and-k: format-patch: ensure that --rfc and -k are mutually exclusive
2024-07-02t-reftable-record: add tests for reftable_log_record_compare_key()Chandra Pratap1-0/+30
reftable_log_record_compare_key() is a function defined by reftable/record.{c, h} and is used to compare the keys of two log records when sorting multiple log records using 'qsort'. In the current testing setup, this function is left unexercised. Add a testing function for the same. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add tests for reftable_ref_record_compare_name()Chandra Pratap1-0/+20
reftable_ref_record_compare_name() is a function defined by reftable/record.{c, h} and is used to compare the refname of two ref records when sorting multiple ref records using 'qsort'. In the current testing setup, this function is left unexercised. Add a testing function for the same. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add index tests for reftable_record_is_deletion()Chandra Pratap1-0/+1
reftable_record_is_deletion() is a function defined in reftable/record.{c, h} that determines whether a record is of type deletion or not. In the current testing setup, this function is left untested for index records. Add tests for this function in the case of index records. Note that since index records cannot be of type deletion, this function must always return '0' when called on an index record. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add obj tests for reftable_record_is_deletion()Chandra Pratap1-0/+1
reftable_record_is_deletion() is a function defined in reftable/record.{c, h} that determines whether a record is of type deletion or not. In the current testing setup, this function is left untested for two of the four record types (obj, index). Add tests for this function in the case of obj records. Note that since obj records cannot be of type deletion, this function must always return '0' when called on an obj record. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add log tests for reftable_record_is_deletion()Chandra Pratap1-0/+4
reftable_record_is_deletion() is a function defined in reftable/record.{c, h} that determines whether a record is of type deletion or not. In the current testing setup, this function is left untested for three of the four record types (log, obj, index). Add tests for this function in the case of log records. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add ref tests for reftable_record_is_deletion()Chandra Pratap1-0/+2
reftable_record_is_deletion() is a function defined in reftable/record.{c, h} that determines whether a record is of type deletion or not. In the current testing setup, this function is left untested for all the four record types (ref, log, obj, index). Add tests for this function in the case of ref records. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add comparison tests for obj recordsChandra Pratap1-0/+39
In the current testing setup for obj records, the comparison functions for obj records, reftable_obj_record_cmp_void() and reftable_obj_record_equal_void() are left untested. Add tests for the same by using the wrapper functions reftable_record_cmp() and reftable_record_equal() for reftable_index_record_cmp_void() and reftable_index_record_equal_void() respectively. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add comparison tests for index recordsChandra Pratap1-0/+38
In the current testing setup for index records, the comparison functions for index records, reftable_index_record_cmp() and reftable_index_record_equal() are left untested. Add tests for the same by using the wrapper functions reftable_record_cmp() and reftable_record_equal() for reftable_index_record_cmp() and reftable_index_record_equal() respectively. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add comparison tests for ref recordsChandra Pratap1-0/+33
In the current testing setup for ref records, the comparison functions for ref records, reftable_ref_record_cmp_void() and reftable_ref_record_equal() are left untested. Add tests for the same by using the wrapper functions reftable_record_cmp() and reftable_record_equal() for reftable_ref_record_cmp_void() and reftable_ref_record_equal() respectively. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t-reftable-record: add reftable_record_cmp() tests for log recordsChandra Pratap1-13/+25
In the current testing setup for log records, only reftable_log_record_equal() among log record's comparison functions is tested. Modify the existing tests to exercise reftable_log_record_cmp_void() (using the wrapper function reftable_record_cmp()) alongside reftable_log_record_equal(). Note that to achieve this, we'll need to replace instances of reftable_log_record_equal() with the wrapper function reftable_record_equal(). Rename the now modified test to reflect its nature of exercising all comparison operations, not just equality. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-02t: move reftable/record_test.c to the unit testing frameworkChandra Pratap3-73/+61
reftable/record_test.c exercises the functions defined in reftable/record.{c, h}. Migrate reftable/record_test.c to the unit testing framework. Migration involves refactoring the tests to use the unit testing framework instead of reftable's test framework, and renaming the tests to fit unit-tests' naming scheme. While at it, change the type of index variable 'i' to 'size_t' from 'int'. This is because 'i' is used in comparison against 'ARRAY_SIZE(x)' which is of type 'size_t'. Also, use set_hash() which is defined locally in the test file instead of set_test_hash() which is defined by reftable/test_framework.{c, h}. This is fine to do as both these functions are similarly implemented, and reftable/test_framework.{c, h} is not #included in the ported test. Get rid of reftable_record_print() from the tests as well, because it clutters the test framework's output and we have no way of verifying the output. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Acked-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01t0612: mark as leak-freeRubén Justo1-0/+1
A quick test tells us that t0612 does not trigger any leak: $ make SANITIZE=leak test GIT_TEST_PASSING_SANITIZE_LEAK=check GIT_TEST_SANITIZE_LEAK_LOG=true GIT_TEST_OPTS=-i T=t0612-reftable-jgit-compatibility.sh [...] *** t0612-reftable-jgit-compatibility.sh *** in GIT_TEST_PASSING_SANITIZE_LEAK=check mode, setting --invert-exit-code for TEST_PASSES_SANITIZE_LEAK != true ok 1 - CGit repository can be read by JGit ok 2 - JGit repository can be read by CGit ok 3 - mixed writes from JGit and CGit ok 4 - JGit can read multi-level index # passed all 4 test(s) 1..4 # faking up non-zero exit with --invert-exit-code make[2]: *** [Makefile:75: t0612-reftable-jgit-compatibility.sh] Error 1 Let's mark it as leak-free to silence the machinery activated by `GIT_TEST_PASSING_SANITIZE_LEAK=check`. Reported-by: Jeff King <peff@peff.net> Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01test-lib: fix GIT_TEST_SANITIZE_LEAK_LOGRubén Justo1-1/+4
When a test that leaks runs with GIT_TEST_SANITIZE_LEAK_LOG=true, the test returns zero, which is not what we want. In the if-else's chain we have in "check_test_results_san_file_", we consider three variables: $passes_sanitize_leak, $sanitize_leak_check and, implicitly, GIT_TEST_SANITIZE_LEAK_LOG (always set to "true" at that point). For the first two variables we have different considerations depending on the value of $test_failure, which makes sense. However, for the third, GIT_TEST_SANITIZE_LEAK_LOG, we don't; regardless of $test_failure, we use "invert_exit_code=t" to produce a non-zero return value. That assumes "$test_failure" is always zero at that point. But it may not be: $ git checkout v2.40.1 $ make test SANITIZE=leak T=t3200-branch.sh # this fails $ make test SANITIZE=leak GIT_TEST_SANITIZE_LEAK_LOG=true T=t3200-branch.sh # this succeeds [...] With GIT_TEST_SANITIZE_LEAK_LOG=true, our logs revealed a memory leak, exiting with a non-zero status! # faked up failures as TODO & now exiting with 0 due to --invert-exit-code We need to use "invert_exit_code=t" only when "$test_failure" is zero. Let's add the missing conditions in the if-else's chain to make it work as expected. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Rubén Justo <rjusto@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01t0613: mark as leak-freeRubén Justo1-0/+1
We can mark t0613 as leak-free: $ make test SANITIZE=leak GIT_TEST_PASSING_SANITIZE_LEAK=check GIT_TEST_SANITIZE_LEAK_LOG=true T=t0613-reftable-write-options.sh [...] *** t0613-reftable-write-options.sh *** in GIT_TEST_PASSING_SANITIZE_LEAK=check mode, setting --invert-exit-code for TEST_PASSES_SANITIZE_LEAK != true ok 1 - default write options ok 2 - disabled reflog writes no log blocks ok 3 - many refs results in multiple blocks ok 4 - tiny block size leads to error ok 5 - small block size leads to multiple ref blocks ok 6 - small block size fails with large reflog message ok 7 - block size exceeding maximum supported size ok 8 - restart interval at every single record ok 9 - restart interval exceeding maximum supported interval ok 10 - object index gets written by default with ref index ok 11 - object index can be disabled # passed all 11 test(s) 1..11 # faking up non-zero exit with --invert-exit-code make[2]: *** [Makefile:75: t0613-reftable-write-options.sh] Error 1 Do it. Signed-off-by: Rubén Justo <rjusto@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01pathspec: fix typo "glossary-context.txt" -> "glossary-content.txt"Abhijeet Sonar1-1/+1
The pathspec syntax is explained in the file "glossary-content.txt". Moreover, no file named "glossary-context.txt" exists in the repository. Signed-off-by: Abhijeet Sonar <abhijeet.nkt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01submodule--helper: use strvec_pushf() for --super-prefixRené Scharfe1-11/+6
Use the strvec_pushf() call that already appends a slash to also produce the stuck form of the option --super-prefix instead of adding the option name in a separate call of strvec_push() or strvec_pushl(). This way we can more easily see that these parts make up a single option with its argument and save a function call. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-07-01git-send-email: use sanitized address when reading mbox bodyCsókás, Bence2-2/+45
Addresses that are mentioned on the trailers in the commit log messages (e.g., "Reviewed-by") are added to the "Cc:" list by "git send-email". These hand-written addresses, however, may be malformed (e.g., having unquoted "." and other punctutation marks in the display-name part) and can upset MTA. The code does use the sanitize_address() helper on these address-looking strings to turn them into valid addresses, but it is used only to see if the address should be suppressed. The original string taken from the message is added to the @cc list if the code decides the address is not suppressed. Because the addresses on trailer lines are hand-written and more likely to contain malformed addresses, when adding to the @cc list, use the result from sanitize_address, not the original. Note that we do not modify the behaviour for addresses taken from the e-mail headers, as they are more likely to be machine generated and well-formed. Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-30git-gui: fix inability to quit after closing another instanceOrgad Shaneh1-1/+1
If you open 2 git gui instances in the same directory, then close one of them and try to close the other, an error message pops up, saying: 'error renaming ".git/GITGUI_BCK": no such file or directory', and it is no longer possible to close the window ever. Fix by catching this error, and proceeding even if the file no longer exists. Signed-off-by: Orgad Shaneh <orgads@gmail.com>
2024-06-28Sync with 'maint'Junio C Hamano2-26/+80
2024-06-28More post 2.45.2 updates from the 'master' frontJunio C Hamano2-1/+81
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-28Merge branch 'ds/ahead-behind-fix' into maint-2.45Junio C Hamano2-2/+2
Fix for a progress bar. * ds/ahead-behind-fix: commit-graph: increment progress indicator
2024-06-28Merge branch 'ds/doc-add-interactive-singlekey' into maint-2.45Junio C Hamano1-4/+4
Doc update. * ds/doc-add-interactive-singlekey: doc: interactive.singleKey is disabled by default
2024-06-28Merge branch 'jc/varargs-attributes' into maint-2.45Junio C Hamano9-2/+11
Varargs functions that are unannotated as printf-like or execl-like have been annotated as such. * jc/varargs-attributes: __attribute__: add a few missing format attributes __attribute__: mark some functions with LAST_ARG_MUST_BE_NULL __attribute__: remove redundant attribute declaration for git_die_config() __attribute__: trace2_region_enter_printf() is like "printf"
2024-06-28Merge branch 'ps/ci-fix-detection-of-ubuntu-20' into maint-2.45Junio C Hamano1-1/+1
Fix for an embarrassing typo that prevented Python2 tests from running anywhere. * ps/ci-fix-detection-of-ubuntu-20: ci: fix check for Ubuntu 20.04
2024-06-28Merge branch 'jk/cap-exclude-file-size' into maint-2.45Junio C Hamano3-0/+40
An overly large ".gitignore" files are now rejected silently. * jk/cap-exclude-file-size: dir.c: reduce max pattern file size to 100MB dir.c: skip .gitignore, etc larger than INT_MAX
2024-06-28Merge branch 'jc/safe-directory-leading-path' into maint-2.45Junio C Hamano3-8/+32
The safe.directory configuration knob has been updated to optionally allow leading path matches. * jc/safe-directory-leading-path: safe.directory: allow "lead/ing/path/*" match
2024-06-28Merge branch 'rs/difftool-env-simplify' into maint-2.45Junio C Hamano1-8/+4
Code simplification. * rs/difftool-env-simplify: difftool: add env vars directly in run_file_diff()
2024-06-28Merge branch 'ps/fix-reinit-includeif-onbranch' into maint-2.45Junio C Hamano2-17/+105
"git init" in an already created directory, when the user configuration has includeif.onbranch, started to fail recently, which has been corrected. * ps/fix-reinit-includeif-onbranch: setup: fix bug with "includeIf.onbranch" when initializing dir
2024-06-28Merge branch 'es/chainlint-ncores-fix' into maint-2.45Junio C Hamano1-3/+17
The chainlint script (invoked during "make test") did nothing when it failed to detect the number of available CPUs. It now falls back to 1 CPU to avoid the problem. * es/chainlint-ncores-fix: chainlint.pl: latch CPU count directly reported by /proc/cpuinfo chainlint.pl: fix incorrect CPU count on Linux SPARC chainlint.pl: make CPU count computation more robust
2024-06-28Merge branch 'jc/rev-parse-fatal-doc' into maint-2.45Junio C Hamano1-2/+13
Doc update. * jc/rev-parse-fatal-doc: rev-parse: document how --is-* options work outside a repository
2024-06-28Merge branch 'jc/doc-diff-name-only' into maint-2.45Junio C Hamano1-2/+3
The documentation for "git diff --name-only" has been clarified that it is about showing the names in the post-image tree. * jc/doc-diff-name-only: diff: document what --name-only shows
2024-06-28Merge branch 'mt/t0211-typofix' into maint-2.45Junio C Hamano1-1/+1
Test fix. * mt/t0211-typofix: t/t0211-trace2-perf.sh: fix typo patern -> pattern
2024-06-28Merge branch 'dg/fetch-pack-code-cleanup' into maint-2.45Junio C Hamano1-5/+0
Code clean-up to remove an unused struct definition. * dg/fetch-pack-code-cleanup: fetch-pack: remove unused 'struct loose_object_iter'
2024-06-28Merge branch 'dm/update-index-doc-fix' into maint-2.45Junio C Hamano1-0/+1
Doc fix. * dm/update-index-doc-fix: documentation: git-update-index: add --show-index-version to synopsis
2024-06-28Merge branch 'ds/scalar-reconfigure-all-fix' into maint-2.45Junio C Hamano2-3/+45
Scalar fix. * ds/scalar-reconfigure-all-fix: scalar: avoid segfault in reconfigure --all
2024-06-28Merge branch 'vd/doc-merge-tree-x-option' into maint-2.45Junio C Hamano1-0/+5
Doc update. * vd/doc-merge-tree-x-option: Documentation/git-merge-tree.txt: document -X
2024-06-28Merge branch 'fa/p4-error' into maint-2.45Junio C Hamano1-11/+13
P4 update. * fa/p4-error: git-p4: show Perforce error to the user
2024-06-28Merge branch 'tb/attr-limits' into maint-2.45Junio C Hamano2-10/+19
The maximum size of attribute files is enforced more consistently. * tb/attr-limits: attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()
2024-06-28Merge branch 'rs/diff-parseopts-cleanup' into maint-2.45Junio C Hamano1-1/+0
Code clean-up to remove code that is now a noop. * rs/diff-parseopts-cleanup: diff-lib: stop calling diff_setup_done() in do_diff_cache()
2024-06-28Merge branch 'dk/zsh-git-repo-path-fix' into maint-2.45Junio C Hamano1-0/+1
Command line completion support for zsh (in contrib/) has been updated to stop exposing internal state to end-user shell interaction. * dk/zsh-git-repo-path-fix: completion: zsh: stop leaking local cache variable