summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-13Git 2.43.2v2.43.2Junio C Hamano3-2/+39
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13Merge branch 'pb/template-for-single-commit-pr' into maint-2.43Junio C Hamano1-0/+3
Doc update. * pb/template-for-single-commit-pr: .github/PULL_REQUEST_TEMPLATE.md: add a note about single-commit PRs
2024-02-13Merge branch 'jc/bisect-doc' into maint-2.43Junio C Hamano1-4/+6
Doc update. * jc/bisect-doc: bisect: document command line arguments for "bisect start" bisect: document "terms" subcommand more fully
2024-02-13Merge branch 'js/win32-retry-pipe-write-on-enospc' into maint-2.43Junio C Hamano1-4/+15
Update to the code that writes to pipes on Windows. * js/win32-retry-pipe-write-on-enospc: win32: special-case `ENOSPC` when writing to a pipe
2024-02-13Merge branch 'tb/pack-bitmap-drop-unused-struct-member' into maint-2.43Junio C Hamano1-7/+0
Code clean-up. * tb/pack-bitmap-drop-unused-struct-member: pack-bitmap: drop unused `reuse_objects`
2024-02-13Merge branch 'jt/p4-spell-re-with-raw-string' into maint-2.43Junio C Hamano1-13/+13
"git p4" update to squelch warnings from Python. * jt/p4-spell-re-with-raw-string: git-p4: use raw string literals for regular expressions
2024-02-13Merge branch 'jc/coc-whitespace-fix' into maint-2.43Junio C Hamano1-2/+2
Docfix. * jc/coc-whitespace-fix: CoC: whitespace fix
2024-02-13Merge branch 'sd/negotiate-trace-fix' into maint-2.43Junio C Hamano1-1/+1
Tracing fix. * sd/negotiate-trace-fix: push: region_leave trace for negotiate_using_fetch
2024-02-13Merge branch 'jc/majordomo-to-subspace' into maint-2.43Junio C Hamano2-4/+5
Doc update. * jc/majordomo-to-subspace: Docs: majordomo@vger.kernel.org has been decomissioned
2024-02-13Merge branch 'nb/rebase-x-shell-docfix' into maint-2.43Junio C Hamano1-4/+3
Doc update. * nb/rebase-x-shell-docfix: rebase: fix documentation about used shell in -x
2024-02-13Merge branch 'la/strvec-comment-fix' into maint-2.43Junio C Hamano1-4/+4
Comment fix. * la/strvec-comment-fix: strvec: use correct member name in comments
2024-02-13Merge branch 'ne/doc-filter-blob-limit-fix' into maint-2.43Junio C Hamano1-4/+4
Docfix. * ne/doc-filter-blob-limit-fix: rev-list-options: fix off-by-one in '--filter=blob:limit=<n>' explainer
2024-02-13Merge branch 'cp/git-flush-is-an-env-bool' into maint-2.43Junio C Hamano1-8/+8
Recent conversion to allow more than 0/1 in GIT_FLUSH broke the mechanism by flipping what yes/no means by mistake, which has been corrected. * cp/git-flush-is-an-env-bool: write-or-die: fix the polarity of GIT_FLUSH environment variable
2024-02-13Merge branch 'ps/report-failure-from-git-stash' into maint-2.43Junio C Hamano2-4/+56
"git stash" sometimes was silent even when it failed due to unwritable index file, which has been corrected. * ps/report-failure-from-git-stash: builtin/stash: report failure to write to index
2024-02-13Merge branch 'jc/sign-buffer-failure-propagation-fix' into maint-2.43Junio C Hamano3-3/+3
A failed "git tag -s" did not necessarily result in an error depending on the crypto backend, which has been corrected. * jc/sign-buffer-failure-propagation-fix: ssh signing: signal an error with a negative return value tag: fix sign_buffer() call to create a signed tag
2024-02-13Merge branch 'jc/comment-style-fixes' into maint-2.43Junio C Hamano3-7/+7
Rewrite //-comments to /* comments */ in files whose comments prevalently use the latter. * jc/comment-style-fixes: reftable/pq_test: comment style fix merge-ort.c: comment style fix builtin/worktree: comment style fixes
2024-02-13Merge branch 'jk/diff-external-with-no-index' into maint-2.43Junio C Hamano2-1/+14
"git diff --no-index file1 file2" segfaulted while invoking the external diff driver, which has been corrected. * jk/diff-external-with-no-index: diff: handle NULL meta-info when spawning external diff
2024-02-13Merge branch 'rs/parse-options-with-keep-unknown-abbrev-fix' into maint-2.43Junio C Hamano2-10/+17
"git diff --no-rename A B" did not disable rename detection but did not trigger an error from the command line parser. * rs/parse-options-with-keep-unknown-abbrev-fix: parse-options: simplify positivation handling parse-options: fully disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN
2024-02-13Merge branch 'en/diffcore-delta-final-line-fix' into maint-2.43Junio C Hamano2-0/+28
Rename detection logic ignored the final line of a file if it is an incomplete line. * en/diffcore-delta-final-line-fix: diffcore-delta: avoid ignoring final 'line' of file
2024-02-13Merge branch 'tc/show-ref-exists-fix' into maint-2.43Junio C Hamano2-3/+3
Update to a new feature recently added, "git show-ref --exists". * tc/show-ref-exists-fix: builtin/show-ref: treat directory as non-existing in --exists
2024-02-13A few more fixes before -rc1Junio C Hamano1-0/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13Merge branch 'cp/git-flush-is-an-env-bool'Junio C Hamano1-8/+8
Recent conversion to allow more than 0/1 in GIT_FLUSH broke the mechanism by flipping what yes/no means by mistake, which has been corrected. * cp/git-flush-is-an-env-bool: write-or-die: fix the polarity of GIT_FLUSH environment variable
2024-02-13Merge branch 'jc/unit-tests-make-relative-fix'Junio C Hamano1-14/+47
The mechanism to report the filename in the source code, used by the unit-test machinery, assumed that the compiler expanded __FILE__ to the path to the source given to the $(CC), but some compilers give full path, breaking the output. This has been corrected. * jc/unit-tests-make-relative-fix: unit-tests: do show relative file paths on non-Windows, too
2024-02-13Merge branch 'js/github-actions-update'Junio C Hamano2-12/+12
Update remaining GitHub Actions jobs to avoid warnings against using deprecated version of Node.js. * js/github-actions-update: ci(linux32): add a note about Actions that must not be updated ci: bump remaining outdated Actions versions
2024-02-13Merge branch 'jc/github-actions-update'Junio C Hamano3-12/+12
Squelch node.js 16 deprecation warnings from GitHub Actions CI by updating actions/github-script and actions/checkout that use node.js 20. * jc/github-actions-update: GitHub Actions: update to github-script@v7 GitHub Actions: update to checkout@v4
2024-02-13add -p tests: remove PERL prerequisitesGhanshyam Thakkar6-39/+27
The Perl version of the add -i/-p commands has been removed since 20b813d (add: remove "add.interactive.useBuiltin" & Perl "git add--interactive", 2023-02-07) Therefore, Perl prerequisite in the test scripts which use the patch mode functionality is not neccessary. Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13add-patch: classify '@' as a synonym for 'HEAD'Ghanshyam Thakkar7-41/+63
Currently, (restore, checkout, reset) commands correctly take '@' as a synonym for 'HEAD'. However, in patch mode different prompts/messages are given on command line due to patch mode machinery not considering '@' to be a synonym for 'HEAD' due to literal string comparison with the word 'HEAD', and therefore assigning patch_mode_($command)_nothead and triggering reverse mode (-R in diff-index). The NEEDSWORK comment suggested comparing commit objects to get around this. However, doing so would also take a non-checked out branch pointing to the same commit as HEAD, as HEAD. This would cause confusion to the user. Therefore, after parsing '@', replace it with 'HEAD' as reasonably early as possible. This also solves another problem of disparity between 'git checkout HEAD' and 'git checkout @' (latter detaches at the HEAD commit and the former does not). Trade-offs: - Some of the errors would show the revision argument as 'HEAD' when given '@'. This should be fine, as most users who probably use '@' would be aware that it is a shortcut for 'HEAD' and most probably used to use 'HEAD'. There is also relevant documentation in 'gitrevisions' manpage about '@' being the shortcut for 'HEAD'. Also, the simplicity of the solution far outweighs this cost. - Consider '@' as a shortcut for 'HEAD' even if 'refs/heads/@' exists at a different commit. Naming a branch '@' is an obvious foot-gun and many existing commands already take '@' for 'HEAD' even if 'refs/heads/@' exists at a different commit or does not exist at all (e.g. 'git log @', 'git push origin @' etc.). Therefore this is an existing assumption and should not be a problem. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Phillip Wood <phillip.wood123@gmail.com> Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13git: --no-lazy-fetch optionJunio C Hamano2-0/+8
Sometimes, especially during tests of low level machinery, it is handy to have a way to disable lazy fetching of objects. This allows us to say, for example, "git cat-file -e <object-name>", to see if the object is locally available. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13write-or-die: fix the polarity of GIT_FLUSH environment variableJunio C Hamano1-8/+8
When GIT_FLUSH is set to 1, true, on, yes, then we should disable skip_stdout_flush, but the conversion somehow did the opposite. With the understanding of the original motivation behind "skip" in 06f59e9f (Don't fflush(stdout) when it's not helpful, 2007-06-29), we can sympathize with the current naming (we wanted to avoid useless flushing of stdout by default, with an escape hatch to always flush), but it is still not a good excuse. Retire the "skip_stdout_flush" variable and replace it with "flush_stdout" that tells if we do or do not want to run fflush(). Reported-by: Xiaoguang WANG <wxiaoguang@gmail.com> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13column: guard against negative paddingKristoffer Haugsbakk1-0/+4
Make sure that client code can’t pass in a negative padding by accident. Suggested-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-13column: disallow negative paddingKristoffer Haugsbakk2-0/+13
A negative padding does not make sense and can cause errors in the memory allocator since it’s interpreted as an unsigned integer. Reported-by: Tiago Pascoal <tiago@pascoal.net> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12Sync with 'maint'Junio C Hamano0-0/+0
2024-02-12A few more topics before -rc1Junio C Hamano1-0/+24
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12Merge branch 'tb/multi-pack-reuse-experiment'Junio C Hamano5-41/+51
Setting `feature.experimental` opts the user into multi-pack reuse experiment * tb/multi-pack-reuse-experiment: pack-objects: enable multi-pack reuse via `feature.experimental` t5332-multi-pack-reuse.sh: extract pack-objects helper functions
2024-02-12Merge branch 'vd/for-each-ref-sort-with-formatted-timestamp'Junio C Hamano3-3/+57
"git branch" and friends learned to use the formatted text as sorting key, not the underlying timestamp value, when the --sort option is used with author or committer timestamp with a format specifier (e.g., "--sort=creatordate:format:%H:%M:%S"). * vd/for-each-ref-sort-with-formatted-timestamp: ref-filter.c: sort formatted dates by byte value
2024-02-12Merge branch 'pw/show-ref-pseudorefs'Junio C Hamano3-10/+18
"git show-ref --verify" did not show things like "CHERRY_PICK_HEAD", which has been corrected. * pw/show-ref-pseudorefs: t1400: use show-ref to check pseudorefs show-ref --verify: accept pseudorefs
2024-02-12Merge branch 'ps/report-failure-from-git-stash'Junio C Hamano2-4/+56
"git stash" sometimes was silent even when it failed due to unwritable index file, which has been corrected. * ps/report-failure-from-git-stash: builtin/stash: report failure to write to index
2024-02-12Merge branch 'pb/template-for-single-commit-pr'Junio C Hamano1-0/+3
Doc update. * pb/template-for-single-commit-pr: .github/PULL_REQUEST_TEMPLATE.md: add a note about single-commit PRs
2024-02-12Merge branch 'jc/sign-buffer-failure-propagation-fix'Junio C Hamano3-3/+3
A failed "git tag -s" did not necessarily result in an error depending on the crypto backend, which has been corrected. * jc/sign-buffer-failure-propagation-fix: ssh signing: signal an error with a negative return value tag: fix sign_buffer() call to create a signed tag
2024-02-12Merge branch 'jc/bisect-doc'Junio C Hamano1-4/+6
Doc update. * jc/bisect-doc: bisect: document command line arguments for "bisect start" bisect: document "terms" subcommand more fully
2024-02-12Merge branch 'bk/complete-bisect'Junio C Hamano2-7/+199
Command line completion support (in contrib/) has been updated for "git bisect". * bk/complete-bisect: completion: bisect: recognize but do not complete view subcommand completion: bisect: complete log opts for visualize subcommand completion: new function __git_complete_log_opts completion: bisect: complete missing --first-parent and - -no-checkout options completion: bisect: complete custom terms and related options completion: bisect: complete bad, new, old, and help subcommands completion: tests: always use 'master' for default initial branch name
2024-02-12Merge branch 'ps/reftable-styles'Junio C Hamano22-295/+236
Code clean-up in various reftable code paths. * ps/reftable-styles: reftable/record: improve semantics when initializing records reftable/merged: refactor initialization of iterators reftable/merged: refactor seeking of records reftable/stack: use `size_t` to track stack length reftable/stack: use `size_t` to track stack slices during compaction reftable/stack: index segments with `size_t` reftable/stack: fix parameter validation when compacting range reftable: introduce macros to allocate arrays reftable: introduce macros to grow arrays
2024-02-12Merge branch 'ps/reftable-multi-level-indices-fix'Junio C Hamano3-27/+122
Write multi-level indices for reftable has been corrected. * ps/reftable-multi-level-indices-fix: reftable: document reading and writing indices reftable/writer: fix writing multi-level indices reftable/writer: simplify writing index records reftable/writer: use correct type to iterate through index entries reftable/reader: be more careful about errors in indexed seeks
2024-02-12Merge branch 'ps/reftable-backend' into kn/for-all-refsJunio C Hamano17-7/+3248
* ps/reftable-backend: refs/reftable: fix leak when copying reflog fails ci: add jobs to test with the reftable backend refs: introduce reftable backend
2024-02-12Merge branch 'pb/imap-send-wo-curl-build-fix' into maint-2.43Junio C Hamano1-0/+1
* pb/imap-send-wo-curl-build-fix: imap-send: add missing "strbuf.h" include under NO_CURL
2024-02-12completion: add and use __git_compute_second_level_config_vars_for_sectionPhilippe Blain2-51/+22
In a previous commit we removed some hardcoded config variable names from function __git_complete_config_variable_name in the completion script by introducing a new function, __git_compute_first_level_config_vars_for_section. The remaining hardcoded config variables are "second level" configuration variables, meaning 'branch.<name>.upstream', 'remote.<name>.url', etc. where <name> is a user-defined name. Making use of the new existing --config flag to 'git help', add a new function, __git_compute_second_level_config_vars_for_section. This function takes as argument a config section name and computes the corresponding second-level config variables, i.e. those that contain a '<' which indicates the start of a placeholder. Note that as in __git_compute_first_level_config_vars_for_section added previsouly, we use indirect expansion instead of associative arrays to stay compatible with Bash 3 on which macOS is stuck for licensing reasons. As explained in the previous commit, we use the existing pattern in the completion script of using global variables to cache the list of variables for each section. Use this new function and the variables it defines in __git_complete_config_variable_name to remove hardcoded config variables, and add a test to verify the new function. Use a single 'case' for all sections with second-level variables names, since the code for each of them is now exactly the same. Adjust the name of a test added in a previous commit to reflect that it now tests the added function. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12completion: add and use __git_compute_first_level_config_vars_for_sectionPhilippe Blain2-4/+22
The function __git_complete_config_variable_name in the Bash completion script hardcodes several config variable names. These variables are those in config sections where user-defined names can appear, such as "branch.<name>". These sections are treated first by the case statement, and the two last "catch all" cases are used for other sections, making use of the __git_compute_config_vars and __git_compute_config_sections function, which omit listing any variables containing wildcards or placeholders. Having hardcoded config variables introduces the risk of the completion code becoming out of sync with the actual config variables accepted by Git. To avoid these hardcoded config variables, introduce a new function, __git_compute_first_level_config_vars_for_section, making use of the existing __git_config_vars variable. This function takes as argument a config section name and computes the matching "first level" config variables for that section, i.e. those _not_ containing any placeholder, like 'branch.autoSetupMerge, 'remote.pushDefault', etc. Use this function and the variables it defines in the 'branch.*', 'remote.*' and 'submodule.*' switches of the case statement instead of hardcoding the corresponding config variables. Note that we use indirect expansion to create a variable for each section, instead of using a single associative array indexed by section names, because associative arrays are not supported in Bash 3, on which macOS is stuck for licensing reasons. Use the existing pattern in the completion script of using global variables to cache the list of config variables for each section. The rationale for such caching is explained in eaa4e6ee2a (Speed up bash completion loading, 2009-11-17), and the current approach to using and defining them via 'test -n' is explained in cf0ff02a38 (completion: work around zsh option propagation bug, 2012-02-02). Adjust the name of one of the tests added in the previous commit, reflecting that it now also tests the new function. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12completion: complete 'submodule.*' config variablesPhilippe Blain2-0/+42
In the Bash completion script, function __git_complete_config_variable_name completes config variables and has special logic to deal with config variables involving user-defined names, like branch.<name>.* and remote.<name>.*. This special logic is missing for submodule-related config variables. Add the appropriate branches to the case statement, making use of the in-tree '.gitmodules' to list relevant submodules. Add corresponding tests in t9902-completion.sh, making sure we complete both first level submodule config variables as well as second level variables involving submodule names. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12completion: add space after config variable names also in Bash 3Philippe Blain1-3/+3
In be6444d1ca (completion: bash: add correct suffix in variables, 2021-08-16), __git_complete_config_variable_name was changed to use "${sfx- }" instead of "$sfx" as the fourth argument of _gitcomp_nl and _gitcomp_nl_append, such that this argument evaluates to a space if sfx is unset. This was to ensure that e.g. git config branch.autoSetupMe[TAB] correctly completes to 'branch.autoSetupMerge ' with the trailing space. This commits notes that the fix only works in Bash 4 because in Bash 3 the 'local sfx' construct at the beginning of __git_complete_config_variable_name creates an empty string. Make the fix also work for Bash 3 by using the "unset or null' parameter expansion syntax ("${sfx:- }"), such that the parameter is also expanded to a space if it is set but null, as is the behaviour of 'local sfx' in Bash 3. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-12use xstrncmpz()René Scharfe10-16/+38
Add and apply a semantic patch for calling xstrncmpz() to compare a NUL-terminated string with a buffer of a known length instead of using strncmp() and checking the terminating NUL explicitly. This simplifies callers by reducing code duplication. I had to adjust remote.c manually because Coccinelle inexplicably changed the indent of the else branches. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>