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-03-21wrapper.h: move declarations for wrapper.c functions from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21path.h: move function declarations for path.c functions from cache.hElijah Newren
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21cache.h: remove expand_user_path()Elijah Newren
expand_user_path() was renamed to interpolate_path() back in mid-2021, but reinstated with a #define and a NEEDSWORK comment that we would eventually want to get rid of it. Do so now. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21abspath.h: move absolute path functions from cache.hElijah Newren
This is another step towards letting us remove the include of cache.h in strbuf.c. It does mean that we also need to add includes of abspath.h in a number of C files. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21environment: move comment_line_char from cache.hElijah Newren
This is one step towards making strbuf.c not depend upon cache.h. Additional steps will follow in subsequent commits. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21treewide: remove unnecessary cache.h inclusion from several sourcesElijah Newren
A number of files were apparently including cache.h solely to get gettext.h. By making those files explicitly include gettext.h, we can already drop the include of cache.h in these files. On top of that, there were some files using cache.h that didn't need to for any reason. Remove these unnecessary includes. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21treewide: remove unnecessary inclusion of gettext.hElijah Newren
Looking at things from the opposite angle of the last patch, we had a few files that were including gettext.h and perhaps needed it at some point in history, but no longer require it. Remove the include. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21treewide: be explicit about dependence on gettext.hElijah Newren
Dozens of files made use of gettext functions, without explicitly including gettext.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include gettext.h if they are using it. However, while compat/fsmonitor/fsm-ipc-darwin.c should also gain an include of gettext.h, it was left out to avoid conflicting with an in-flight topic. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-21treewide: remove unnecessary cache.h inclusion from a few headersElijah Newren
Ever since a64215b6cd ("object.h: stop depending on cache.h; make cache.h depend on object.h", 2023-02-24), we have a few headers that could have replaced their include of cache.h with an include of object.h. Make that change now. Some C files had to start including cache.h after this change (or some smaller header it had brought in), because the C files were depending on things from cache.h but were only formerly implicitly getting cache.h through one of these headers being modified in this patch. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-20The second batchJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-20Merge branch 'jk/add-p-unmerged-fix'Junio C Hamano
"git add -p" while the index is unmerged sometimes failed to parse the diff output it internally produces and died, which has been corrected. * jk/add-p-unmerged-fix: add-patch: handle "* Unmerged path" lines
2023-03-20Merge branch 'ew/fetch-no-write-fetch-head-fix'Junio C Hamano
* ew/fetch-no-write-fetch-head-fix: fetch: pass --no-write-fetch-head to subprocesses
2023-03-20Merge branch 'fc/advice-diverged-history'Junio C Hamano
After "git pull" that is configured with pull.rebase=false merge.ff=only fails due to our end having our own development, give advice messages to get out of the "Not possible to fast-forward" state. * fc/advice-diverged-history: advice: add diverging advice for novices
2023-03-20Merge branch 'ab/fix-strategy-opts-parsing'Junio C Hamano
The code to parse "git rebase -X<opt>" was not prepared to see an unparsable option string, which has been corrected. * ab/fix-strategy-opts-parsing: sequencer.c: fix overflow & segfault in parse_strategy_opts()
2023-03-20Merge branch 'ds/reprepare-alternates-when-repreparing-packfiles'Junio C Hamano
Once we start running, we assumed that the list of alternate object databases would never change. Hook into the machinery used to update the list of packfiles during runtime to update this list as well. * ds/reprepare-alternates-when-repreparing-packfiles: object-file: reprepare alternates when necessary
2023-03-20Merge branch 'jk/format-patch-change-format-for-empty-commits'Junio C Hamano
"git format-patch" learned to write a log-message only output file for empty commits. * jk/format-patch-change-format-for-empty-commits: format-patch: output header for empty commits
2023-03-20Merge branch 'jk/bundle-use-dash-for-stdfiles'Junio C Hamano
"git bundle" learned that "-" is a common way to say that the input comes from the standard input and/or the output goes to the standard output. It used to work only for output and only from the root level of the working tree. * jk/bundle-use-dash-for-stdfiles: parse-options: use prefix_filename_except_for_dash() helper parse-options: consistently allocate memory in fix_filename() bundle: don't blindly apply prefix_filename() to "-" bundle: document handling of "-" as stdin bundle: let "-" mean stdin for reading operations
2023-03-20Merge branch 'jk/bundle-progress'Junio C Hamano
Simplify UI to control progress meter given by "git bundle" command. * jk/bundle-progress: bundle: turn on --all-progress-implied by default
2023-03-20Merge branch 'as/doc-markup-fix'Junio C Hamano
Fix for a mis-mark-up in doc made in Git 2.39 days. * as/doc-markup-fix: git-merge-tree.txt: replace spurious HTML entity
2023-03-20Merge branch 'rj/avoid-switching-to-already-used-branch'Junio C Hamano
A few subcommands have been taught to stop users from working on a branch that is being used in another worktree linked to the same repository. * rj/avoid-switching-to-already-used-branch: switch: reject if the branch is already checked out elsewhere (test) rebase: refuse to switch to a branch already checked out elsewhere (test) branch: fix die_if_checked_out() when ignore_current_worktree worktree: introduce is_shared_symref()
2023-03-20Merge branch 'rj/bisect-already-used-branch'Junio C Hamano
Allow "git bisect reset" to check out the original branch when the branch is already checked out in a different worktree linked to the same repository. * rj/bisect-already-used-branch: bisect: fix "reset" when branch is checked out elsewhere
2023-03-20Merge branch 'zh/push-to-delete-onelevel-ref'Junio C Hamano
"git push" has been taught to allow deletion of refs with one-level names to help repairing a repository who acquired such a ref by mistake. In general, we don't encourage use of such a ref, and creation or update to such a ref is rejected as before. * zh/push-to-delete-onelevel-ref: push: allow delete single-level ref receive-pack: fix funny ref error messsage
2023-03-20Merge branch 'ak/restore-both-incompatible-with-conflicts'Junio C Hamano
"git restore" supports options like "--ours" that are only meaningful during a conflicted merge, but these options are only meaningful when updating the working tree files. These options are marked to be incompatible when both "--staged" and "--worktree" are in effect. * ak/restore-both-incompatible-with-conflicts: restore: fault --staged --worktree with merge opts
2023-03-20Merge branch 'ew/commit-reach-clean-up-flags-fix'Junio C Hamano
Fix a segfaulting loop. The function and its caller may need further clean-up. * ew/commit-reach-clean-up-flags-fix: commit-reach: avoid NULL dereference
2023-03-20Merge branch 'ab/avoid-losing-exit-codes-in-tests'Junio C Hamano
Test clean-up. * ab/avoid-losing-exit-codes-in-tests: tests: don't lose misc "git" exit codes tests: don't lose exit status with "test <op> $(git ...)" tests: don't lose "git" exit codes in "! ( git ... | grep )" tests: don't lose exit status with "(cd ...; test <op> $(git ...))" t/lib-patch-mode.sh: fix ignored exit codes auto-crlf tests: don't lose exit code in loops and outside tests
2023-03-18Start the 2.41 cycleJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-18Merge branch 'fz/rebase-msg-update'Junio C Hamano
Message update. * fz/rebase-msg-update: rebase: fix capitalisation autoSquash in i18n string
2023-03-18Merge branch 'ew/fetch-hiderefs'Junio C Hamano
A new "fetch.hideRefs" option can be used to exclude specified refs from "rev-list --objects --stdin --not --all" traversal for checking object connectivity, most useful when there are many unrelated histories in a single repository. * ew/fetch-hiderefs: fetch: support hideRefs to speed up connectivity checks
2023-03-18Merge branch 'mc/credential-helper-www-authenticate'Junio C Hamano
Allow information carried on the WWW-AUthenticate header to be passed to the credential helpers. * mc/credential-helper-www-authenticate: credential: add WWW-Authenticate header to cred requests http: read HTTP WWW-Authenticate response headers t5563: add tests for basic and anoymous HTTP access
2023-03-18Merge branch 'jc/gpg-lazy-init'Junio C Hamano
Instead of forcing each command to choose to honor GPG related configuration variables, make the subsystem lazily initialize itself. * jc/gpg-lazy-init: drop pure pass-through config callbacks gpg-interface: lazily initialize and read the configuration
2023-03-18Merge branch 'jk/unused-post-2.39-part2'Junio C Hamano
More work towards -Wunused. * jk/unused-post-2.39-part2: (21 commits) help: mark unused parameter in git_unknown_cmd_config() run_processes_parallel: mark unused callback parameters userformat_want_item(): mark unused parameter for_each_commit_graft(): mark unused callback parameter rewrite_parents(): mark unused callback parameter fetch-pack: mark unused parameter in callback function notes: mark unused callback parameters prio-queue: mark unused parameters in comparison functions for_each_object: mark unused callback parameters list-objects: mark unused callback parameters mark unused parameters in signal handlers run-command: mark error routine parameters as unused mark "pointless" data pointers in callbacks ref-filter: mark unused callback parameters http-backend: mark unused parameters in virtual functions http-backend: mark argc/argv unused object-name: mark unused parameters in disambiguate callbacks serve: mark unused parameters in virtual functions serve: use repository pointer to get config ls-refs: drop config caching ...
2023-03-18Merge branch 'en/header-cleanup'Junio C Hamano
Code clean-up to clarify the rule that "git-compat-util.h" must be the first to be included. * en/header-cleanup: diff.h: remove unnecessary include of object.h Remove unnecessary includes of builtin.h treewide: replace cache.h with more direct headers, where possible replace-object.h: move read_replace_refs declaration from cache.h to here object-store.h: move struct object_info from cache.h dir.h: refactor to no longer need to include cache.h object.h: stop depending on cache.h; make cache.h depend on object.h ident.h: move ident-related declarations out of cache.h pretty.h: move has_non_ascii() declaration from commit.h cache.h: remove dependence on hex.h; make other files include it explicitly hex.h: move some hex-related declarations from cache.h hash.h: move some oid-related declarations from cache.h alloc.h: move ALLOC_GROW() functions from cache.h treewide: remove unnecessary cache.h includes in source files treewide: remove unnecessary cache.h includes treewide: remove unnecessary git-compat-util.h includes in headers treewide: ensure one of the appropriate headers is sourced first
2023-03-18Merge branch 'en/dir-api-cleanup'Junio C Hamano
Code clean-up to clarify directory traversal API. * en/dir-api-cleanup: unpack-trees: add usage notices around df_conflict_entry unpack-trees: special case read-tree debugging as internal usage unpack-trees: rewrap a few overlong lines from previous patch unpack-trees: mark fields only used internally as internal unpack_trees: start splitting internal fields from public API sparse-checkout: avoid using internal API of unpack-trees, take 2 sparse-checkout: avoid using internal API of unpack-trees unpack-trees: clean up some flow control dir: mark output only fields of dir_struct as such dir: add a usage note to exclude_per_dir dir: separate public from internal portion of dir_struct unpack-trees: heed requests to overwrite ignored files t2021: fix platform-specific leftover cruft
2023-03-18Merge branch 'jk/fsck-indices-in-worktrees'Junio C Hamano
"git fsck" learned to check the index files in other worktrees, just like "git gc" honors them as anchoring points. * jk/fsck-indices-in-worktrees: fsck: check even zero-entry index files fsck: mention file path for index errors fsck: check index files in all worktrees fsck: factor out index fsck
2023-03-13Git 2.40v2.40.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-13Merge tag 'l10n-2.40.0-rnd1' of https://github.com/git-l10n/git-poJunio C Hamano
l10n-2.40.0-rnd1 * tag 'l10n-2.40.0-rnd1' of https://github.com/git-l10n/git-po: l10n: zh_CN v2.40.0 round 1 l10n: update German translation l10n: tr: Update Turkish translations for v.2.40.0 l10n: fr: v2.40.0 rnd 2 l10n: fr: v2.40.0 rnd 1 l10n: fr: fix some typos l10n: po-id for 2.40 (round 1) l10n: sv.po: Update Swedish translation (5490t0f0u) l10n: bg.po: Updated Bulgarian translation (5490t) l10n: Update Catalan translation
2023-03-10Merge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-poJiang Xin
* 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po: l10n: zh_CN v2.40.0 round 1
2023-03-09object-file: reprepare alternates when necessaryDerrick Stolee
When an object is not found in a repository's object store, we sometimes call reprepare_packed_git() to see if the object was temporarily moved into a new pack-file (and its old pack-file or loose object was deleted). This process does a scan of each pack directory within each odb, but does not reevaluate if the odb list needs updating. Extend reprepare_packed_git() to also reprepare the alternate odb list by setting loaded_alternates to zero and calling prepare_alt_odb(). This will add newly-discoverd odbs to the linked list, but will not duplicate existing ones nor will it remove existing ones that are no longer listed in the alternates file. Do this under the object read lock to avoid readers from interacting with a potentially incomplete odb being added to the odb list. If the alternates file was edited to _remove_ some alternates during the course of the Git process, Git will continue to see alternates that were ever valid for that repository. ODBs are not removed from the list, the same as the existing behavior before this change. Git already has protections against an alternate directory disappearing from the filesystem during the lifetime of a process, and those are still in effect. This change is specifically for concurrent changes to the repository, so it is difficult to create a test that guarantees this behavior is correct. I manually verified by introducing a reprepare_packed_git() call into get_revision() and stepped into that call in a debugger with a parent 'git log' process. Multiple runs of prepare_alt_odb() kept the_repository->objects->odb as a single-item chain until I added a .git/objects/info/alternates file in a different process. The next run added the new odb to the chain and subsequent runs did not add to the chain. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-09fetch: pass --no-write-fetch-head to subprocessesEric Wong
It seems a user would expect this option would work regardless of whether it's fetching from a single remote, many remotes, or recursing into submodules. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-09add-patch: handle "* Unmerged path" linesJeff King
When we generate a diff with --cached, unmerged entries have no oid for their index entry: $ git diff-index --abbrev --cached HEAD :100644 000000 f719efd 0000000 U my-conflict So when we are asked to produce a patch, since we only have one side, we just emit a special message: $ git diff-index --cached -p HEAD * Unmerged path my-conflict This confuses interactive-patch modes that look at cached diffs. For example: $ git reset -p BUG: add-patch.c:498: diff starts with unexpected line: * Unmerged path my-conflict Making things even more confusing, you'll get that error only if the unmerged entry is alphabetically the first changed file. Otherwise, we simply stick the unrecognized line to the end of the previous hunk. There it's mostly harmless, as it eventually gets fed back to "git apply", which happily ignores it. But it's still shown to the user attached to the hunk, which is wrong. So let's handle these lines as a noop. There's not really anything useful to do with a conflicted merge in this case, and that's what we do for other cases like "add -p". There we get a "diff --cc" line, which we accept as starting a new file, but we refuse to use any of its hunks (their headers start with "@@@" and not "@@ ", so we silently ignore them). It seems like simply recognizing the line and continuing in our parsing loop would work. But we actually need to run the rest of the loop body to handle matching up our colored/filtered output. But that code assumes that we have some active file_diff we're working on. So instead, we'll just insert a dummy entry into our array. This ends up the same as if we saw a "diff --cc" line (a file with no hunks). Reported-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-09sequencer.c: fix overflow & segfault in parse_strategy_opts()Ævar Arnfjörð Bjarmason
The split_cmdline() function introduced in [1] returns an "int". If it's negative it signifies an error. The option parsing in [2] didn't account for this, and assigned the value directly to the "size_t xopts_nr". We'd then attempt to loop over all of these elements, and access uninitialized memory. There's a few things that use this for option parsing, but one way to trigger it is with a bad value to "-X <strategy-option>", e.g: git rebase -X"bad argument\"" In another context this might be a security issue, but in this case someone who's already able to inject arguments directly to our commands would be past other defenses, making this potential escalation a moot point. As the example above & test case shows the error reporting leaves something to be desired. The function will loop over the whitespace-split values, but when it encounters an error we'll only report the first element, which is OK, not the second "argument\"" whose quote is unbalanced. This is an inherent limitation of the current API, and the issue affects other API users. Let's not attempt to fix that now. If and when that happens these tests will need to be adjusted to assert the new output. 1. 2b11e3170e9 (If you have a config containing something like this:, 2006-06-05) 2. ca6c6b45dd9 (sequencer (rebase -i): respect strategy/strategy_opts settings, 2017-01-02) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-08advice: add diverging advice for novicesFelipe Contreras
The user might not necessarily know why ff only was configured, maybe an admin did it, or the installer (Git for Windows), or perhaps they just followed some online advice. This can happen not only on pull.ff=only, but merge.ff=only too. Even worse if the user has configured pull.rebase=false and merge.ff=only, because in those cases a diverging merge will constantly keep failing. There's no trivial way to get out of this other than `git merge --no-ff`. Let's not assume our users are experts in git who completely understand all their configurations. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-08Merge branch 'l10n-de-2.40' of github.com:ralfth/gitJiang Xin
* 'l10n-de-2.40' of github.com:ralfth/git: l10n: update German translation
2023-03-08Merge branch 'po-id' of github.com:bagasme/git-poJiang Xin
* 'po-id' of github.com:bagasme/git-po: l10n: po-id for 2.40 (round 1)
2023-03-08Merge branch 'catalan' of github.com:Softcatala/git-poJiang Xin
* 'catalan' of github.com:Softcatala/git-po: l10n: Update Catalan translation
2023-03-08Merge branch 'fr_2.40.0_rnd1' of github.com:jnavila/gitJiang Xin
* 'fr_2.40.0_rnd1' of github.com:jnavila/git: l10n: fr: v2.40.0 rnd 2 l10n: fr: v2.40.0 rnd 1 l10n: fr: fix some typos
2023-03-08Merge branch 'master' of github.com:nafmo/git-l10n-svJiang Xin
* 'master' of github.com:nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (5490t0f0u)
2023-03-08Merge branch 'master' of github.com:alshopov/git-poJiang Xin
* 'master' of github.com:alshopov/git-po: l10n: bg.po: Updated Bulgarian translation (5490t)
2023-03-08Merge branch 'turkish' of github.com:bitigchi/git-poJiang Xin
* 'turkish' of github.com:bitigchi/git-po: l10n: tr: Update Turkish translations for v.2.40.0
2023-03-08l10n: zh_CN v2.40.0 round 1Fangyi Zhou
Reviewed-by: 依云 <lilydjwg@gmail.com> Signed-off-by: Fangyi Zhou <me@fangyi.io>