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-21repository: remove unnecessary include of path.hElijah Newren
This also made it clear that several .c files that depended upon path.h were missing a #include for it; add the missing includes while at it. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21log-tree: replace include of revision.h with simple forward declarationElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21cache.h: remove this no-longer-used headerElijah Newren
Since this header showed up in some places besides just #include statements, update/clean-up/remove those other places as well. Note that compat/fsmonitor/fsm-path-utils-darwin.c previously got away with violating the rule that all files must start with an include of git-compat-util.h (or a short-list of alternate headers that happen to include it first). This change exposed the violation and caused it to stop building correctly; fix it by having it include git-compat-util.h first, as per policy. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21read-cache*.h: move declarations for read-cache.c functions from cache.hElijah Newren
For the functions defined in read-cache.c, move their declarations from cache.h to a new header, read-cache-ll.h. Also move some related inline functions from cache.h to read-cache.h. The purpose of the read-cache-ll.h/read-cache.h split is that about 70% of the sites don't need the inline functions and the extra headers they include. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21repository.h: move declaration of the_index from cache.hElijah Newren
the_index is a global variable defined in repository.c; as such, its declaration feels better suited living in repository.h rather than cache.h. Move it. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21merge.h: move declarations for merge.c from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21diff.h: move declaration for global in diff.c from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21preload-index.h: move declarations for preload-index.c from elsewhereElijah Newren
We already have a preload-index.c file; move the declarations for the functions in that file into a new preload-index.h. These were previously split between cache.h and repository.h. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21sparse-index.h: move declarations for sparse-index.c from cache.hElijah Newren
Note in particular that this reverses the decision made in 118a2e8bde0 ("cache: move ensure_full_index() to cache.h", 2021-04-01). Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21name-hash.h: move declarations for name-hash.c from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21run-command.h: move declarations for run-command.c from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21statinfo: move stat_{data,validity} functions from cache/read-cacheElijah Newren
These functions do not depend upon struct cache_entry or struct index_state in any way, and it seems more logical to break them out into this file, especially since statinfo.h already has the struct stat_data declaration. Diff best viewed with `--color-moved`. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21read-cache: move shared add/checkout/commit codeElijah Newren
The function add_files_to_cache(), plus associated helper functions, were defined in builtin/add.c, but also shared with builtin/checkout.c and builtin/commit.c. Move these shared functions to read-cache.c. Diff best viewed with `--color-moved`. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21add: modify add_files_to_cache() to avoid globalsElijah Newren
The function add_files_to_cache() is used by all three of builtin/{add, checkout, commit}.c. That suggests this is common library code, and should be moved somewhere else, like read-cache.c. However, the function and its helpers made use of two global variables that made straight code movement difficult: * the_index * include_sparse The latter was perhaps more problematic since it was only accessible in builtin/add.c but was still affecting builtin/checkout.c and builtin/commit.c without this fact being very clear from the code. I'm not sure if the other two callers would want to add a `--sparse` flag similar to add.c to get non-default behavior, but exposing this dependence will help if we ever decide we do want to add such a flag. Modify add_files_to_cache() and its helpers to accept the necessary arguments instead of relying on globals. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21read-cache: move shared commit and ls-files codeElijah Newren
The function overlay_tree_on_index(), plus associated helper functions, were defined in builtin/ls-files.c, but also shared with builtin/commit.c. Move these shared functions to read-cache.c. Diff best viewed with `--color-moved`. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21setup: adopt shared init-db & clone codeElijah Newren
The functions init_db() and initialize_repository_version() were shared by builtin/init-db.c and builtin/clone.c, and declared in cache.h. Move these functions, plus their several helpers only used by these functions, to setup.[ch]. Diff best viewed with `--color-moved`. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21init-db, clone: change unnecessary global into passed parameterElijah Newren
Much like the parent commit, this commit was prompted by a desire to move the functions which builtin/init-db.c and builtin/clone.c share out of the former file and into setup.c. A secondary issue that made it difficult was the init_shared_repository global variable; replace it with a simple parameter that is passed to the relevant functions. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21init-db: remove unnecessary global variableElijah Newren
This commit was prompted by a desire to move the functions which builtin/init-db.c and builtin/clone.c share out of the former file and into setup.c. One issue that made it difficult was the init_is_bare_repository global variable. init_is_bare_repository's sole use in life it to cache a value in init_db(), and then be used in create_default_files(). This is a bit odd since init_db() directly calls create_default_files(), and is the only caller of that function. Convert the global to a simple function parameter instead. (Of course, this doesn't fix the fact that this value is then ignored by create_default_files(), as noted in a big TODO comment in that function, but it at least includes no behavioral change other than getting rid of a very questionable global variable.) Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21init-db: document existing bug with core.bare in template configElijah Newren
The comments in create_default_files() talks about reading config from the config file in the specified `--templates` directory, which leads to the question of whether core.bare could be set in such a config file and thus whether the code is doing the right thing. It turns out, that it doesn't; it unconditionally ignores core.bare in the config file in any --templates directory. It is not clear to me that fixing it can be done within this function; it seems to occur too late: * create_default_files() is called by init_db() * init_db() is called by both builtin/{clone.c,init-db.c} * both callers of init_db() call set_git_work_tree() before init_db() and in order to actual affect whether a repository is bear, we'd need to somewhere reset these values, not just the is_bare_repository_cfg setting. I do not want to open this can of worms at this time; I'm trying to clean up some headers, for which I need to move some functions, for which I need to clean up some globals, and that's far enough down the rabbit hole. So, simply document the issue with a careful TODO comment and a few testcases. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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-15doc: trailer: add more examples in DESCRIPTIONLinus Arver
Be more up-front about what trailers are in practice with examples, to give the reader a visual cue while they go on to read the rest of the description. Also add an example for multiline values. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: mention 'key' in DESCRIPTIONLinus Arver
The 'key' option is used frequently in the examples at the bottom but there is no mention of it in the description. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer.<token>.command: emphasize deprecationLinus Arver
This puts the deprecation notice up front, instead of leaving it to the next paragraph. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: use angle brackets for <token> and <value>Linus Arver
We already use angle brackets elsewhere, so this makes things more consistent. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: remove redundant phrasingLinus Arver
The phrase "many rules" gets essentially repeated again with "many other rules", so remove this repetition. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: examples: avoid the word "message" by itselfLinus Arver
Previously, "message" could mean the input, output, commit message, or "internal body text inside the commit message" (in the EXAMPLES section). Avoid overloading this term by using the appropriate meanings explicitly. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: drop "commit message part" phrasingLinus Arver
The command can take inputs that are either just a commit message, or an email-like output such as git-format-patch which includes a commit message, "---" divider, and patch part. The existing explanation blends these two inputs together in the first sentence This command reads some patches or commit messages which then necessitates using the "commit message part" phrasing (as opposed to just "commit message") because the input is ambiguous per the above definition. This change separates the two input types and explains them separately, and so there is no longer a need to use the "commit message part" phrase. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: swap verb orderLinus Arver
This matches the order already used in the NAME section. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-15doc: trailer: fix grammarLinus Arver
Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-13Start the 2.42 cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-13Merge branch 'zh/ls-files-format-atoms'Junio C Hamano
Some atoms that can be used in "--format=<format>" for "git ls-tree" were not supported by "git ls-files", even though they were relevant in the context of the latter. * zh/ls-files-format-atoms: ls-files: align format atoms with ls-tree
2023-06-13Merge branch 'sl/diff-tree-sparse'Junio C Hamano
"git diff-tree" has been taught to take advantage of the sparse-index feature. * sl/diff-tree-sparse: diff-tree: integrate with sparse index
2023-06-13Merge branch 'jk/format-patch-message-id-unleak'Junio C Hamano
Leakfix. * jk/format-patch-message-id-unleak: format-patch: free elements of rev.ref_message_ids list format-patch: free rev.message_id when exiting
2023-06-13Merge branch 'jc/pack-ref-exclude-include'Junio C Hamano
"git pack-refs" learns "--include" and "--exclude" to tweak the ref hierarchy to be packed using pattern matching. * jc/pack-ref-exclude-include: pack-refs: teach pack-refs --include option pack-refs: teach --exclude option to exclude refs from being packed docs: clarify git-pack-refs --all will pack all refs
2023-06-13Merge branch 'sa/doc-ls-remote'Junio C Hamano
Doc update. * sa/doc-ls-remote: ls-remote doc: document the output format ls-remote doc: explain what each example does ls-remote doc: show peeled tags in examples ls-remote doc: remove redundant --tags example show-branch doc: say <ref>, not <reference> show-ref doc: update for internal consistency
2023-06-13Merge branch 'gc/doc-cocci-updates'Junio C Hamano
Update documentation regarding Coccinelle patches. * gc/doc-cocci-updates: cocci: codify authoring and reviewing practices cocci: add headings to and reword README