Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-30Merge branch 'ds/remove-idx-before-pack'Junio C Hamano
We create .pack and then .idx, we consider only packfiles that have .idx usable (those with only .pack are not ready yet), so we should remove .idx before removing .pack for consistency. * ds/remove-idx-before-pack: packfile: delete .idx files before .pack files
2023-06-26The fifth batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-26Merge branch 'tb/collect-pack-filenames-fix'Junio C Hamano
Avoid breakage of "git pack-objects --cruft" due to inconsistency between the way the code enumerates packfiles in the repository. * tb/collect-pack-filenames-fix: builtin/repack.c: only collect fully-formed packs
2023-06-26Merge branch 'jk/commit-use-no-divider-with-interpret-trailers'Junio C Hamano
When "git commit --trailer=..." invokes the interpret-trailers machinery, it knows what it feeds to interpret-trailers is a full log message without any patch, but failed to express that by passing the "--no-divider" option, which has been corrected. * jk/commit-use-no-divider-with-interpret-trailers: commit: pass --no-divider to interpret-trailers
2023-06-25Merge branch 'maint'Junio C Hamano
* maint: http: handle both "h2" and "h2h3" in curl info lines
2023-06-25Merge branch 'jk/redact-h2h3-headers-fix' into maint-2.41Junio C Hamano
* jk/redact-h2h3-headers-fix: http: handle both "h2" and "h2h3" in curl info lines
2023-06-23The fourth batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-23Merge branch 'js/defeat-ignore-submodules-config-with-explicit-addition'Junio C Hamano
Even when diff.ignoreSubmodules tells us to ignore submodule changes, "git commit" with an index that already records changes to submodules should include the submodule changes in the resulting commit, but it did not. * js/defeat-ignore-submodules-config-with-explicit-addition: diff-lib: honor override_submodule_config flag bit
2023-06-23Merge branch 'rj/leakfixes'Junio C Hamano
Leakfixes * rj/leakfixes: tests: mark as passing with SANITIZE=leak config: fix a leak in git_config_copy_or_rename_section_in_file branch: fix a leak in cmd_branch branch: fix a leak in setup_tracking rev-parse: fix a leak with --abbrev-ref branch: fix a leak in setup_tracking branch: fix a leak in check_tracking_branch branch: fix a leak in inherit_tracking branch: fix a leak in dwim_and_setup_tracking remote: fix a leak in query_matches_negative_refspec config: fix a leak in git_config_copy_or_rename_section_in_file
2023-06-23Merge branch 'tb/open-midx-bitmap-fallback'Junio C Hamano
Gracefully deal with a stale MIDX file that lists a packfile that no longer exists. * tb/open-midx-bitmap-fallback: pack-bitmap.c: gracefully degrade on failure to load MIDX'd pack
2023-06-23Merge branch 'tb/gc-recent-object-hook'Junio C Hamano
"git pack-objects" learned to invoke a new hook program that enumerates extra objects to be used as anchoring points to keep otherwise unreachable objects in cruft packs. * tb/gc-recent-object-hook: gc: introduce `gc.recentObjectsHook` reachable.c: extract `obj_is_recent()`
2023-06-23Merge branch 'tz/lib-gpg-prereq-fix'Junio C Hamano
Test update. * tz/lib-gpg-prereq-fix: t/lib-gpg: require GPGSSH for GPGSSH_VERIFYTIME prereq
2023-06-23Merge branch 'sl/worktree-sparse'Junio C Hamano
"git worktree" learned to work better with sparse index feature. * sl/worktree-sparse: worktree: integrate with sparse-index
2023-06-23Merge branch 'rs/run-command-exec-error-on-noent'Junio C Hamano
Simplify error message when run-command fails to start a command. * rs/run-command-exec-error-on-noent: run-command: report exec error even on ENOENT t1800: loosen matching of error message for bad shebang
2023-06-23Merge branch 'mh/credential-erase-improvements'Junio C Hamano
* mh/credential-erase-improvements: credential: erase all matching credentials credential: avoid erasing distinct password
2023-06-23Merge branch 'gc/discover-not-setup'Junio C Hamano
discover_git_directory() no longer touches the_repository. * gc/discover-not-setup: setup.c: don't setup in discover_git_directory()
2023-06-23The third batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-23Merge branch 'jt/doc-use-octal-with-printf'Junio C Hamano
Suggest to refrain from using hex literals that are non-portable when writing printf(1) format strings. * jt/doc-use-octal-with-printf: CodingGuidelines: use octal escapes, not hex
2023-06-23Merge branch 'rs/doc-ls-tree-hex-literal'Junio C Hamano
Doc update. * rs/doc-ls-tree-hex-literal: ls-tree: fix documentation of %x format placeholder
2023-06-23Merge branch 'la/docs-typofixes'Junio C Hamano
Typofixes. * la/docs-typofixes: docs: typofixes
2023-06-23Merge branch 'as/dtype-compilation-fix'Junio C Hamano
Compilation fix for platforms without D_TYPE in struct dirent. * as/dtype-compilation-fix: statinfo.h: move DTYPE defines from dir.h
2023-06-23Merge branch 'ds/add-i-color-configuration-fix'Junio C Hamano
The reimplemented "git add -i" did not honor color.ui configuration. * ds/add-i-color-configuration-fix: add: test use of brackets when color is disabled add: check color.ui for interactive add
2023-06-23Merge branch 'ps/cat-file-null-output'Junio C Hamano
"git cat-file --batch" and friends learned "-Z" that uses NUL delimiter for both input and output. * ps/cat-file-null-output: cat-file: add option '-Z' that delimits input and output with NUL cat-file: simplify reading from standard input strbuf: provide CRLF-aware helper to read until a specified delimiter t1006: modernize test style to use `test_cmp` t1006: don't strip timestamps from expected results
2023-06-23Merge branch 'ds/disable-replace-refs'Junio C Hamano
Introduce a mechanism to disable replace refs globally and per repository. * ds/disable-replace-refs: repository: create read_replace_refs setting replace-objects: create wrapper around setting repository: create disable_replace_refs()
2023-06-23Merge branch 'tb/pack-bitmap-traversal-with-boundary'Junio C Hamano
The object traversal using reachability bitmap done by "pack-object" has been tweaked to take advantage of the fact that using "boundary" commits as representative of all the uninteresting ones can save quite a lot of object enumeration. * tb/pack-bitmap-traversal-with-boundary: pack-bitmap.c: use commit boundary during bitmap traversal pack-bitmap.c: extract `fill_in_bitmap()` object: add object_array initializer helper function
2023-06-23Merge branch 'ja/worktree-orphan'Junio C Hamano
'git worktree add' learned how to create a worktree based on an orphaned branch with `--orphan`. * ja/worktree-orphan: worktree add: emit warn when there is a bad HEAD worktree add: extend DWIM to infer --orphan worktree add: introduce "try --orphan" hint worktree add: add --orphan flag t2400: add tests to verify --quiet t2400: refactor "worktree add" opt exclusion tests t2400: cleanup created worktree in test worktree add: include -B in usage docs
2023-06-21The second batch for 2.42Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21Merge branch 'la/doc-interpret-trailers'Junio C Hamano
Doc update. * la/doc-interpret-trailers: doc: trailer: add more examples in DESCRIPTION doc: trailer: mention 'key' in DESCRIPTION doc: trailer.<token>.command: emphasize deprecation doc: trailer: use angle brackets for <token> and <value> doc: trailer: remove redundant phrasing doc: trailer: examples: avoid the word "message" by itself doc: trailer: drop "commit message part" phrasing doc: trailer: swap verb order doc: trailer: fix grammar
2023-06-21Merge branch 'jk/log-follow-with-non-literal-pathspec'Junio C Hamano
"git [-c log.follow=true] log [--follow] ':(glob)f**'" used to barf. * jk/log-follow-with-non-literal-pathspec: diff: detect pathspec magic not supported by --follow diff: factor out --follow pathspec check pathspec: factor out magic-to-name function
2023-06-21Merge branch 'vd/worktree-config-is-per-repository'Junio C Hamano
The value of config.worktree is per-repository, but has been kept in a singleton global variable per process. This has been OK as most Git operations interacted with a single repository at a time, but not right for operations like recursive "grep" that want to access multiple repositories from a single process without forking. The global variable has been eliminated and made into a member in the per-repository data structure. * vd/worktree-config-is-per-repository: repository: move 'repository_format_worktree_config' to repo scope config: pass 'repo' directly to 'config_with_options()' config: use gitdir to get worktree config
2023-06-21Merge branch 'tb/submodule-null-deref-fix'Junio C Hamano
"git submodule" code trusted the data coming from the config (and the in-tree .gitmodules file) too much without validating, leading to NULL dereference if the user mucks with a repository (e.g. submodule.<name>.url is removed). This has been corrected. * tb/submodule-null-deref-fix: builtin/submodule--helper.c: handle missing submodule URLs
2023-06-21Merge branch 'jc/test-modernization-2'Junio C Hamano
Test style updates. * jc/test-modernization-2: t9400-git-cvsserver-server: modernize test format t9200-git-cvsexportcommit: modernize test format t9104-git-svn-follow-parent: modernize test format t9100-git-svn-basic: modernize test format t7700-repack: modernize test format t7600-merge: modernize test format t7508-status: modernize test format t7201-co: modernize test format t7111-reset-table: modernize test format t7110-reset-merge: modernize test format
2023-06-21Merge branch 'jc/test-modernization'Junio C Hamano
* jc/test-modernization: t7101-reset-empty-subdirs: modernize test format t6050-replace: modernize test format t5306-pack-nobase: modernize test format t5303-pack-corruption-resilience: modernize test format t5301-sliding-window: modernize test format t5300-pack-object: modernize test format t4206-log-follow-harder-copies: modernize test format t4202-log: modernize test format t4004-diff-rename-symlink: modernize test format t4003-diff-rename-1: modernize test format t4002-diff-basic: modernize test format t3903-stash: modernize test format t3700-add: modernize test format t3500-cherry: modernize test format t1006-cat-file: modernize test format t1002-read-tree-m-u-2way: modernize test format t1001-read-tree-m-2way: modernize test format t3210-pack-refs: modernize test format t0030-stripspace: modernize test format t0000-basic: modernize test format
2023-06-21Merge branch 'kh/use-default-notes-doc'Junio C Hamano
Doc update. * kh/use-default-notes-doc: notes: move the documentation to the struct notes: update documentation for `use_default_notes`
2023-06-21Merge branch 'pb/complete-and-document-auto-merge-and-friends'Junio C Hamano
Document more pseudo-refs and teach the command line completion machinery to complete AUTO_MERGE. * pb/complete-and-document-auto-merge-and-friends: completion: complete AUTO_MERGE Documentation: document AUTO_MERGE git-merge.txt: modernize word choice in "True merge" section completion: complete REVERT_HEAD and BISECT_HEAD revisions.txt: document more special refs revisions.txt: use description list for special refs
2023-06-21Merge branch 'mh/commit-reach-get-reachable-plug-leak'Junio C Hamano
Plug memory leak. * mh/commit-reach-get-reachable-plug-leak: commit-reach: fix memory leak in get_reachable_subset()
2023-06-21Merge branch 'tz/test-fix-pthreads-prereq'Junio C Hamano
Test fix. * tz/test-fix-pthreads-prereq: trace2 tests: fix PTHREADS prereq
2023-06-21Merge branch 'tz/test-ssh-verifytime-fix'Junio C Hamano
Test fix. * tz/test-ssh-verifytime-fix: t/lib-gpg: fix ssh-keygen -Y check-novalidate with openssh-9.0
2023-06-21Merge branch 'jk/ci-use-clang-for-sanitizer-jobs'Junio C Hamano
Clang's sanitizer implementation seems to work better than GCC's. * jk/ci-use-clang-for-sanitizer-jobs: ci: drop linux-clang job ci: run ASan/UBSan in a single job ci: use clang for ASan/UBSan checks
2023-06-21Merge branch 'tl/quote-problematic-arg-for-clarity'Junio C Hamano
Error message fix. * tl/quote-problematic-arg-for-clarity: surround %s with quotes when failed to lookup commit
2023-06-21Merge branch 'ps/fetch-cleanups'Junio C Hamano
Code clean-up. * ps/fetch-cleanups: fetch: use `fetch_config` to store "submodule.fetchJobs" value fetch: use `fetch_config` to store "fetch.parallel" value fetch: use `fetch_config` to store "fetch.recurseSubmodules" value fetch: use `fetch_config` to store "fetch.showForcedUpdates" value fetch: use `fetch_config` to store "fetch.pruneTags" value fetch: use `fetch_config` to store "fetch.prune" value fetch: pass through `fetch_config` directly fetch: drop unneeded NULL-check for `remote_ref` fetch: drop unused DISPLAY_FORMAT_UNKNOWN enum value
2023-06-20packfile: delete .idx files before .pack filesDerrick Stolee
When installing a packfile, we place the .pack file before the .idx file. The intention is that Git scans for .idx files in the pack directory and then loads the .pack files from that list. However, when we delete packfiles, we do not do this in the reverse order as we should. The unlink_pack_path() method deletes the .pack followed by the .idx. This creates a window where the process could be interrupted between the .pack deletion and the .idx deletion, leaving the repository in a state that looks strange, but isn't actually too problematic if we assume the pack was safe to delete. The .idx without a .pack will cause some overhead, but will not interrupt other Git processes. This ordering was introduced into the 'git repack' builtin by a1bbc6c0176 (repack: rewrite the shell script in C, 2013-09-15), though we must be careful to track history through the code move in 8434e85d5f9 (repack: refactor pack deletion for future use, 2019-06-10) to see that. This became more important after 73320e49add (builtin/repack.c: only collect fully-formed packs, 2023-06-07) changed how 'git repack' scanned for packfiles for use in the cruft pack process. It previously looked for .pack files, but that was problematic due to the order that packs are installed: repacks between the creation of a .pack and the creation of its .idx would result in hard failures. There is an independent proposal about what to do in the case of a .idx without a .pack during this 'git repack' scenario, but this change is focused on deleting .pack files more safely. Modify the order to delete the .idx before the .pack. The rest of the modifiers on the .pack should still come after the .pack so we know all of the presumed properties of the packfile as long as it exists in the filesystem, in case we wish to reinstate it by re-indexing the .pack file. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17http: handle both "h2" and "h2h3" in curl info linesJeff King
When redacting auth tokens in trace output from curl, we look for http/2 headers of the form "h2h3 [header: value]". This comes from b637a41ebe (http: redact curl h2h3 headers in info, 2022-11-11). But the "h2h3" prefix changed to just "h2" in curl's fc2f1e547 (http2: support HTTP/2 to forward proxies, non-tunneling, 2023-04-14). That's in released version curl 8.1.0; linking against that version means we'll fail to correctly redact the trace. Our t5559.17 notices and fails. We can fix this by matching either prefix, which should handle both old and new versions. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17tests: mark as passing with SANITIZE=leakRubén Justo
The tests listed below, since previous commits, no longer trigger any leak. + t1507-rev-parse-upstream.sh + t1508-at-combinations.sh + t1514-rev-parse-push.sh + t2027-checkout-track.sh + t3200-branch.sh + t3204-branch-name-interpretation.sh + t5404-tracking-branches.sh + t5517-push-mirror.sh + t5525-fetch-tagopt.sh + t6040-tracking-info.sh + t7508-status.sh Let's mark them with "TEST_PASSES_SANITIZE_LEAK=true" to notice and fix promptly any new leak that may be introduced and triggered by them in the future. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17config: fix a leak in git_config_copy_or_rename_section_in_fileRubén Justo
A branch can have its configuration spread over several configuration sections. This situation was already foreseen in 52d59cc645 (branch: add a --copy (-c) option to go with --move (-m), 2017-06-18) when "branch -c" was introduced. Unfortunately, a leak was also introduced: $ git branch foo $ cat >> .git/config <<EOF [branch "foo"] some-key-a = a value [branch "foo"] some-key-b = b value [branch "foo"] some-key-c = c value EOF $ git branch -c foo bar Direct leak of 130 byte(s) in 2 object(s) allocated from: ... in xrealloc wrapper.c ... in strbuf_grow strbuf.c ... in strbuf_vaddf strbuf.c ... in strbuf_addf strbuf.c ... in store_create_section config.c ... in git_config_copy_or_rename_section_in_file config.c ... in git_config_copy_section_in_file config.c ... in git_config_copy_section config.c ... in copy_or_rename_branch builtin/branch.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c Let's fix it. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17branch: fix a leak in cmd_branchRubén Justo
In 98e7ab6d42 (for-each-ref: delay parsing of --sort=<atom> options, 2021-10-20) a new string_list was introduced to accumulate any "branch.sort" setting. That string_list is cleared in ref_sorting_options(), which is only called when processing the "--list" sub-command. Therefore, with other sub-command, while having any sort option set, a leak is produced, e.g.: $ git config branch.sort invalid_sort_option $ git branch --edit-description Direct leak of 384 byte(s) in 1 object(s) allocated from: ... in xrealloc wrapper.c ... in string_list_append_nodup string-list.c ... in string_list_append string-list.c ... in git_branch_config builtin/branch.c ... in configset_iter config.c ... in repo_config config.c ... in git_config config.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c Indirect leak of 20 byte(s) in 1 object(s) allocated from: ... in xstrdup wrapper.c ... in string_list_append string-list.c ... in git_branch_config builtin/branch.c ... in configset_iter config.c ... in repo_config config.c ... in git_config config.c ... in cmd_branch builtin/branch.c ... in run_builtin git.c We don't have a common clean-up section in cmd_branch(). To avoid refactoring, keep the fix simple, and while we find a better solution which hopefuly will avoid entirely that string_list, when no sort options are needed; let's squelch the leak sanitizer using UNLEAK(). Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17branch: fix a leak in setup_trackingRubén Justo
In bdaf1dfae7 (branch: new autosetupmerge option "simple" for matching branches, 2022-04-29) a new exit for setup_tracking() missed the clean-up, producing a leak. $ git config branch.autoSetupMerge simple $ git remote add local . $ git update-ref refs/remotes/local/foo HEAD $ git branch bar local/foo Direct leak of 384 byte(s) in 1 object(s) allocated from: ... in xrealloc wrapper.c ... in string_list_append_nodup string-list.c ... in find_tracked_branch branch.c ... in for_each_remote remote.c ... in setup_tracking branch.c ... in create_branch branch.c ... in cmd_branch builtinbranch.c ... in run_builtin git.c Indirect leak of 24 byte(s) in 1 object(s) allocated from: ... in xrealloc wrapper.c ... in strbuf_grow strbuf.c ... in strbuf_add strbuf.c ... in match_name_with_pattern remote.c ... in query_refspecs remote.c ... in remote_find_tracking remote.c ... in find_tracked_branch branch.c ... in for_each_remote remote.c ... in setup_tracking branch.c ... in create_branch branch.c ... in cmd_branch builtinbranch.c ... in run_builtin git.c The return introduced in bdaf1dfae7 was to avoid setting up the tracking, but even in that case it is still necessary to do the clean-up. Let's do it. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17rev-parse: fix a leak with --abbrev-refRubén Justo
To handle "--abbrev-ref" we use shorten_unambiguous_ref(). This function takes a refname and returns a shortened refname, which is a newly allocated string that needs to be freed. Unfortunately, the refname variable is reused to receive the shortened one. Therefore, we lose the original refname, which needs to be freed as well, producing a leak. This leak can be reviewed with: $ for a in {1..10}; do git branch foo_${a}; done $ git rev-parse --abbrev-ref refs/heads/foo_{1..10} Direct leak of 171 byte(s) in 10 object(s) allocated from: ... in xstrdup wrapper.c ... in expand_ref refs.c ... in repo_dwim_ref refs.c ... in show_rev builtin/rev-parse.c ... in cmd_rev_parse builtin/rev-parse.c ... in run_builtin git.c We have this leak since a45d34691e (rev-parse: --abbrev-ref option to shorten ref name, 2009-04-13) when "--abbrev-ref" was introduced. Let's fix it. Signed-off-by: Rubén Justo <rjusto@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-17commit: pass --no-divider to interpret-trailersJeff King
When git-commit sees any "--trailer" options, it passes the COMMIT_EDITMSG file through git-interpret-trailers. But it does so without passing --no-divider, which means that interpret-trailers will look for a "---" divider to signal the end of the commit message. That behavior doesn't make any sense in this context; we know we have a complete and solitary commit message, not something we have to further parse. And as a result, we'll do the wrong thing if the commit message contains a "---" marker (which otherwise is not syntactically significant), inserting any new trailers at the wrong spot. We can fix this by passing --no-divider. This is the exact situation for which it was added in 1688c9a489 (interpret-trailers: allow suppressing "---" divider, 2018-08-22). As noted in the message for that commit, it just adds the mechanism, and further patches were needed to trigger it from various callers. We did that back then in a few spots, like ffce7f590f (sequencer: ignore "---" divider when parsing trailers, 2018-08-22), but obviously missed this one. Reported-by: <eric.frederich@siemens.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-16setup.c: don't setup in discover_git_directory()Glen Choo
discover_git_directory() started modifying the_repository in ebaf3bcf1ae (repository: move global r_f_p_c to repo struct, 2021-06-17), when, in the repository setup process, we started copying members from the "struct repository_format" we're inspecting to the appropriate "struct repository". However, discover_git_directory() isn't actually used in the setup process (its only caller in the Git binary is read_early_config()), so it shouldn't be doing this setup at all! As explained by 16ac8b8db6 (setup: introduce the discover_git_directory() function, 2017-03-13) and the comment on its declaration, discover_git_directory() is intended to be an entrypoint into setup.c machinery that allows the Git directory to be discovered without side effects, e.g. so that read_early_config() can read ".git/config" before the_repository has been set up. Fortunately, we didn't start to rely on this unintended behavior between then and now, so we let's just remove it. It isn't harming anyone, but it's confusing. Signed-off-by: Glen Choo <chooglen@google.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>