summaryrefslogtreecommitdiffstats
path: root/contrib
AgeCommit message (Collapse)AuthorLines
12 daysMerge branch 'kn/osxkeychain-buildfix'Junio C Hamano-59/+6
Simplify build procedure for oxskeychain (in contrib/). * kn/osxkeychain-buildfix: osxkeychain: define build targets in the top-level Makefile.
13 daysMerge branch 'cs/subtree-split-fixes'Junio C Hamano-58/+190
An earlier attempt to optimize "git subtree" discarded too much relevant histories, which has been corrected. * cs/subtree-split-fixes: contrib/subtree: process out-of-prefix subtrees contrib/subtree: test history depth contrib/subtree: capture additional test-cases
14 daysMerge branch 'ps/receive-pack-shallow-optim'Junio C Hamano-1/+1
The code to accept shallow "git push" has been optimized. * ps/receive-pack-shallow-optim: commit: use commit graph in `lookup_commit_reference_gently()` commit: make `repo_parse_commit_no_graph()` more robust commit: avoid parsing non-commits in `lookup_commit_reference_gently()`
14 daysMerge branch 'ps/validate-prefix-in-subtree-split'Junio C Hamano-0/+31
"git subtree split --prefix=P <commit>" now checks the prefix P against the tree of the (potentially quite different from the current working tree) given commit. * ps/validate-prefix-in-subtree-split: subtree: validate --prefix against commit in split
2026-02-27Merge branch 'jh/alias-i18n'Junio C Hamano-1/+1
Extend the alias configuration syntax to allow aliases using characters outside ASCII alphanumeric (plus '-'). * jh/alias-i18n: completion: fix zsh alias listing for subsection aliases alias: support non-alphanumeric names via subsection syntax alias: prepare for subsection aliases help: use list_aliases() for alias listing
2026-02-25Merge branch 'mc/tr2-process-ancestry-cleanup'Junio C Hamano-0/+2
Add process ancestry data to trace2 on macOS to match what we already do on Linux and Windows. Also adjust the way Windows implementation reports this information to match the other two. * mc/tr2-process-ancestry-cleanup: t0213: add trace2 cmd_ancestry tests test-tool: extend trace2 helper with 400ancestry trace2: emit cmd_ancestry data for Windows trace2: refactor Windows process ancestry trace2 event build: include procinfo.c impl for macOS trace2: add macOS process ancestry tracing
2026-02-25Merge branch 'dk/complete-stash-import-export'Junio C Hamano-2/+8
Command line completion (in contrib/) update. * dk/complete-stash-import-export: completion: add stash import, export
2026-02-20contrib/subtree: process out-of-prefix subtreesColin Stagner-53/+65
`should_ignore_subtree_split_commit` detects subtrees which are outside of the current path --prefix and ignores them. This can speed up splits of repositories that have many subtrees. Since its inception [1], every iteration of this logic [2], [3] incorrectly excludes commits. This alters the split history. The split history and its commit hashes are API contract, so this is not permissible. While a commit from a different subtree may look like it doesn't contribute anything to a split, sometimes it does. Merge commits are a particular hot spot. For these, the pruning logic in `copy_or_skip` performs: 1. a check for "treesame" parents 2. two different common ancestry checks These checks operate on the **split history**, not the input history. The split history omits commits that do not affect the --prefix. This can significantly alter the ancestry of a merge. In order to determine if `copy_or_skip` will skip a merge, it is likely necessary to compute all the split history... which is what `should_ignore_subtree_split_commit` tries to avoid. To make this logic API-preserving, we could gate it behind a new CLI argument. The present implementation is actually a speed penalty in many cases, however, so this is not done here. Remove the `should_ignore_subtree_split_commit` logic. This fixes the regression reported in [4]. [1]: 98ba49ccc2 (subtree: fix split processing with multiple subtrees present, 2023-12-01) [2]: 83f9dad7d6 (contrib/subtree: fix split with squashed subtrees, 2025-09-09) [3]: 28a7e27cff (contrib/subtree: detect rewritten subtree commits, 2026-01-09) [4]: <20251230170719.845029-1-george@mail.dietrich.pub> Reported-by: George <george@mail.dietrich.pub> Reported-by: Christian Heusel <christian@heusel.eu> Signed-off-by: Colin Stagner <ask+git@howdoi.land> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20contrib/subtree: test history depthColin Stagner-6/+16
Add history depth checks to some of the subtree unit tests. These checks were previously introduced as part of 28a7e27cff (contrib/subtree: detect rewritten subtree commits, 2026-01-09), which has since been reverted. Signed-off-by: Colin Stagner <ask+git@howdoi.land> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20contrib/subtree: capture additional test-casesColin Stagner-0/+110
Patch series e7b07376e5 (Merge branch 'rs/subtree-fixes', 2018-10-26) corrects several defects in `git subtree split`. The defects affect `split --rejoin` and merge commit processing. There is no test coverage for this, and e7b07376e5 did not introduce any. Convert the minimum working example [1] from the original patch submission [2] into test cases. [1]: https://gist.github.com/FoxFireX/1b794384612b7fd5e7cd157cff96269e [2]: <20180928183540.48968-1-roger.strain@swri.org> Signed-off-by: Colin Stagner <ask+git@howdoi.land> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-20osxkeychain: define build targets in the top-level Makefile.Koji Nakamaru-59/+6
The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid incorrectly skipping store operation, 2025-11-14) introduced linkage with libgit.a, and its Makefile was adjusted accordingly. However, the build fails as of 864f55e190 because several macOS-specific refinements were applied to the top-level Makefile and config.mak.uname, such as: - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24) - cee341e9dd (macOS: use iconv from Homebrew if needed and present, 2025-12-24) - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15, 2026-01-12) Since libgit.a and its corresponding header files depend on many flags defined in the top-level Makefile, these flags must be consistently defined when building git-credential-osxkeychain. Continuing to manually adjust the git-credential-osxkeychain Makefile is cumbersome and fragile. Define the build targets for git-credential-osxkeychain in the top-level Makefile and modify its local Makefile to simply rely on those targets. Helped-by: Junio C Hamano <gitster@pobox.com> Reported-by: D. Ben Knoble <ben.knoble@gmail.com> Helped-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-19completion: fix zsh alias listing for subsection aliasesJonatan Holmgren-1/+1
The zsh completion function __git_zsh_cmd_alias() uses 'git config --get-regexp' to enumerate aliases and then strips the "alias." prefix from each key. For subsection-style aliases (alias.name.command), this leaves "name.command" as the completion candidate instead of just "name". The bash completion does not have this problem because it goes through 'git --list-cmds=alias', which calls list_aliases() in C and already handles both alias syntaxes correctly. However, zsh needs both the alias name and its value for descriptive completion, which --list-cmds=alias does not provide. Add a hidden --aliases-for-completion option to 'git help', following the existing --config-for-completion pattern. It outputs NUL-separated "name\nvalue" pairs using list_aliases(), which correctly resolves both the traditional (alias.name) and subsection (alias.name.command) formats. Update __git_zsh_cmd_alias() to use it. Signed-off-by: Jonatan Holmgren <jonatan@jontes.page> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-19commit: make `repo_parse_commit_no_graph()` more robustPatrick Steinhardt-1/+1
In the next commit we will start to parse more commits via the commit-graph. This change will lead to a segfault though because we try to access the tree of a commit via `repo_get_commit_tree()`, but: - The commit has been parsed via the commit-graph, and thus its `maybe_tree` field is not yet populated. - We cannot use the commit-graph to populate the commit's tree because we're in the process of writing the commit-graph. The consequence is that we'll get a `NULL` pointer for the tree in `write_graph_chunk_data()`. In theory we are already mindful of this situation, as we explicitly use `repo_parse_commit_no_graph()` to parse the commit without the help of the commit-graph. But that doesn't do the trick as the commit is already marked as parsed, so the function will not re-populate it. And as the commit-graph has been closed, neither will `get_commit_tree_oid()` be able to load the tree for us. It seems like this issue can only be hit under artificial circumstances: the error was hit via `git_test_write_commit_graph_or_die()`, which is run by git-commit(1) and git-merge(1) in case `GIT_TEST_COMMIT_GRAPH=1`: $ GIT_TEST_COMMIT_GRAPH=1 meson test t7507-commit-verbose \ --test-args=-ix -i ... ++ git -c commit.verbose=true commit --amend hint: Waiting for your editor to close the file... ./test-lib.sh: line 1012: 55895 Segmentation fault (core dumped) git -c commit.verbose=true commit --amend To the best of my knowledge, this is the only case where we end up writing a commit-graph in the same process that might have already consulted the commit-graph to look up arbitrary objects. But regardless of that, this feels like a bigger accident that is just waiting to happen. Make the code more robust by extending `repo_parse_commit_no_graph()` to unparse a commit first in case we detect it's coming from a graph. This ensures that we will re-read the object without it, and thus we will populate `maybe_tree` properly. This fix shouldn't have any performance consequences: the function is only ever called in the "commit-graph.c" code, and we'll only re-parse the commit at most once. Add an exclusion to our Coccinelle rules so that it doesn't complain about us accessing `maybe_tree` directly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-13Merge branch 'jc/ci-test-contrib-too'Junio C Hamano-0/+10
Test contrib/ things in CI to catch breakages before they enter the "next" branch. * jc/ci-test-contrib-too: : Some of our downstream folks run more tests than we do and catch : breakages in them, namely, where contrib/*/Makefile has "test" target. : Let's make sure we fail upon accepting a new topic that break them in : 'seen'. ci: ubuntu: use GNU coreutils for dirname test: optionally test contrib in CI
2026-02-13Merge branch 'ps/commit-list-functions-renamed'Junio C Hamano-4/+4
Rename three functions around the commit_list data structure. * ps/commit-list-functions-renamed: commit: rename `free_commit_list()` to conform to coding guidelines commit: rename `reverse_commit_list()` to conform to coding guidelines commit: rename `copy_commit_list()` to conform to coding guidelines
2026-02-13Merge branch 'jc/diff-highlight-main-master-testfix'Junio C Hamano-0/+2
Test fix (in contrib/) * jc/diff-highlight-main-master-testfix: diff-highlight: allow testing with Git 3.0 breaking changes
2026-02-13Merge branch 'cs/subtree-reftable-testfix'Junio C Hamano-4/+3
Test fix (in contrib/) * cs/subtree-reftable-testfix: contrib/subtree: fix tests with reftable backend
2026-02-13build: include procinfo.c impl for macOSMatthew John Cheetham-0/+2
Include an implementation of trace2_collect_process_info for macOS. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-07completion: add stash import, exportD. Ben Knoble-2/+8
These newer commands lack completion; implement basic support for options and arguments. Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-05test: optionally test contrib in CIJunio C Hamano-0/+10
Recently it was reported that a topic merged to 'next' broke build and test for contrib/subtree part of the system. Instead of having those who run 'next' or 'master' to hit the build and test breakage and report to us, make sure we notice breakages in contrib/ area before they hit my tree at all, during their own presubmit testing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-04contrib/subtree: fix tests with reftable backendColin Stagner-4/+3
One git-subtree test-case relies on git internals to infer the default branch name. This test fails with the new reftable backend. GIT_TEST_DEFAULT_REF_FORMAT=reftable \ meson test t7900-subtree This test script already sets GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main which eliminates the need to infer a branch name at runtime. Hardcode the branch name. Signed-off-by: Colin Stagner <ask+git@howdoi.land> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-03diff-highlight: allow testing with Git 3.0 breaking changesJunio C Hamano-0/+2
The diff-highlight (in contrib/) comes with its own test script, which relies on the initial branch name being 'master'. This is not just encoded in the test logic, but in the illustration in the file that shows the topology of the history. Force the initial branch name to 'master' to allow it pass. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-03cocci: extend MEMZERO_ARRAY() rulesToon Claes-6/+30
Recently the MEMZERO_ARRAY() macro was introduced. In that commit also coccinelle rules were added to capture cases that can be converted to use that macro. Later a few more cases were manually converted to use the macro, but coccinelle didn't capture those. Extend the rules to capture those as well. In various cases the code could be further beautified by removing parentheses which are no longer needed. Modify the coccinelle rules to optimize those as well and fix them. During conversion indentation also used spaces where tabs should be used, fix that in one go. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-02-03subtree: validate --prefix against commit in splitPushkar Singh-0/+31
git subtree split currently validates --prefix against the working tree. This breaks when splitting an older commit or when the working tree does not contain the subtree, even though the commit does. For example: git subtree split --prefix=pkg <commit> fails if pkg was removed later, even though it exists in <commit>. Fix this by validating the prefix against the specified commit using git cat-file instead of the working tree. Add a test to ensure this behavior does not regress. Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-25Revert "Merge branch 'cs/rebased-subtree-split'"Junio C Hamano-169/+55
This reverts commit 79e3055baba32e2952e6e8994cdcd4fc145ba7f0, reversing changes made to 9813aace1e52765e01e688672cdcdcbe25336ec7. Regresison report https://lore.kernel.org/git/755578cb-07e0-4b40-aa90-aacf4d45ccaa@heusel.eu/
2026-01-21Merge branch 'rs/tree-wo-the-repository'Junio C Hamano-113/+8
Remove implicit reliance on the_repository global in the APIs around tree objects and make it explicit which repository to work in. * rs/tree-wo-the-repository: cocci: remove obsolete the_repository rules cocci: convert parse_tree functions to repo_ variants tree: stop using the_repository tree: use repo_parse_tree() path-walk: use repo_parse_tree_gently() pack-bitmap-write: use repo_parse_tree() delta-islands: use repo_parse_tree() bloom: use repo_parse_tree() add-interactive: use repo_parse_tree_indirect() tree: add repo_parse_tree*() environment: move access to core.maxTreeDepth into repo settings
2026-01-15cocci: remove obsolete the_repository rulesRené Scharfe-117/+2
035c7de9e9e (cocci: apply the "revision.h" part of "the_repository.pending", 2023-03-28) removed the last of the repo-less functions and macros mentioned in the_repository.cocci at the time. No stragglers appeared since then. Remove the applied rules now that they have outlived their usefulness. Also add a reminder to eventually remove the just added rules for tree.h. Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-15commit: rename `free_commit_list()` to conform to coding guidelinesPatrick Steinhardt-4/+4
Our coding guidelines say that: Functions that operate on `struct S` are named `S_<verb>()` and should generally receive a pointer to `struct S` as first parameter. While most of the functions related to `struct commit_list` already follow that naming schema, `free_commit_list()` doesn't. Rename the function to address this and adjust all of its callers. Add a compatibility wrapper for the old function name to ease the transition and avoid any semantic conflicts with in-flight patch series. This wrapper will be removed once Git 2.53 has been released. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-09contrib/subtree: detect rewritten subtree commitsColin Stagner-55/+169
git subtree split --prefix P detects splits that are outside of path prefix `P` and prunes them from history graph processing. This improves the performance of repeated `split --rejoin` with many different prefixes. Both before and after 83f9dad7d6 (contrib/subtree: fix split with squashed subtrees, 2025-09-09), the pruning logic does not detect **rebased** or **cherry-picked** git-subtree commits. If `split` encounters any of these commits, the split output may have incomplete history. All commits authored by git subtree merge [--squash] --prefix Q have a first or second parent that has *only* subtree commits as ancestors. When splitting a completely different path `P/`, it is safe to ignore: 1. the merged tree 2. the subtree parent 3. *all* of that parent's ancestry, which applies only to path `Q/` and not `P/`. But this relationship no longer holds if the git-subtree commit is rebased or otherwise reauthored. After a rebase, the former git-subtree commit will have other unrelated commits as ancestors. Ignoring these commits may exclude the history of `P/`, leading to incomplete `subtree split` output. The pruning logic relies solely on the `git-subtree-*:` trailers to detect git-subtree commits, which it blindly accepts without further validation. The split logic also takes its time about being wrong: `cmd_split()` execs a `git show` for *every* commit in the split range… twice. This is inefficient in a shell script. Add a "reality check" to ignore rebased or rewritten commits: * Rewrites of non-merge commits cannot be detected, so the new detector no longer looks for them. * Merges carry a `git-subtree-mainline:` trailer with the hash of the **first parent**. If this hash differs, or if the "merge" commit no longer has multiple parents, a rewrite has occurred. To increase speed, package this logic in a new method, `find_other_splits()`. Perform the check up-front by iterating over a single `git log`. Add ignored subtrees to: 1. the `notree` cache, which excludes them from the `split` history 2. a `prune` negative refs list. The negative refs prevent recursing into other subtrees. Since there are potentially a *lot* of these, cache them on disk and use rev-list's `--stdin` mode. Reported-by: George <george@mail.dietrich.pub> Signed-off-by: Colin Stagner <ask+git@howdoi.land> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-01-09cocci: convert parse_tree functions to repo_ variantsRené Scharfe-0/+10
Add and apply a semantic patch to convert calls to parse_tree() and friends to the corresponding variant that takes a repository argument, to allow the functions that implicitly use the_repository to be retired once all potential in-flight topics are settled and converted as well. The changes in .c files were generated by Coccinelle, but I fixed a whitespace bug it would have introduced to builtin/commit.c. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-12-23Merge branch 'tc/memzero-array'Junio C Hamano-0/+26
MEMZERO_ARRAY() helper is introduced to avoid clearing only the first N bytes of an N-element array whose elements are larger than a byte. * tc/memzero-array: contrib/coccinelle: pass include paths to spatch(1) git-compat-util: introduce MEMZERO_ARRAY() macro
2025-12-23Merge branch 'jc/completion-no-single-letter-options'Junio C Hamano-1/+2
In-code comment update to clarify that single-letter options are outside of the scope of command line completion script. * jc/completion-no-single-letter-options: completion: clarify support for short options and arguments
2025-12-16Merge branch 'rs/ban-mktemp'Junio C Hamano-4/+0
Rewrite the only use of "mktemp()" that is subject to TOCTOU race and Stop using the insecure "mktemp()" function. * rs/ban-mktemp: compat: remove gitmkdtemp() banned.h: ban mktemp(3) compat: remove mingw_mktemp() compat: use git_mkdtemp() wrapper: add git_mkdtemp()
2025-12-11contrib/coccinelle: pass include paths to spatch(1)Toon Claes-0/+6
In the previous commit a new coccinelle rule is added. But neiter `make coccicheck` nor `meson compile coccicheck` did detect a case in builtin/last-modified.c. This case involves the field `scratch` in `struct last_modified`. This field is of type `struct bitmap` and that struct has a member `eword_t *words`. Both are defined in `ewah/ewok.h`. Now, while builtin/last-modified.c does include that header (with the subdir in the #include directive), it seems coccinelle does not process it. So it's unaware of the type of `words` in the bitmap, and it doesn't recognize the rule from previous commit that uses: type T; T *ptr; Fix coccicheck by passing all possible include paths inside the Git project so spatch(1) can find the headers and can determine the types. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-12-11git-compat-util: introduce MEMZERO_ARRAY() macroToon Claes-0/+20
Introduce a new macro MEMZERO_ARRAY() that zeroes the memory allocated by ALLOC_ARRAY() and friends. And add coccinelle rule to enforce the use of this macro. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-12-07completion: clarify support for short options and argumentsJunio C Hamano-1/+2
The list of supported completions in the header of the file was mostly written a long time ago when Shawn added the initial version of this script in 2006. The list explicitly states that we complete "common --long-options", which implies that we do not complete not-so-common ones and single letter options (this text dates back to May 2007). Update the description to explicitly state that single-letter options are not completed. Also, document that arguments to options are completed, even for single-letter options (e.g., "git -c <TAB>" offers configuration variables). The reason why we do not complete single-letter options is because it does not seem to help all that much to learn that the command takes -c, -d, -e options when "git foo -<TAB>" offers these three, unlike long options that is easier to guess what they are about. Because this rationale is primarily for our developers, let's leave it out of the completion script itself, whose messages are entirely for end-users. Our developers can run "git blame" to find this commit as needed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-12-07compat: remove gitmkdtemp()René Scharfe-4/+0
gitmkdtemp() has become a trivial wrapper around git_mkdtemp(). Remove this now unnecessary layer of indirection. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-26Merge branch 'js/wincred-get-credential-alloc-fix'Junio C Hamano-1/+1
Under-allocation fix. * js/wincred-get-credential-alloc-fix: wincred: avoid memory corruption
2025-11-26Merge branch 'js/cmake-libgit-fix'Junio C Hamano-13/+1
Makefile based build have recently been updated to build a libgit.a that also has reftable and xdiff objects; CMake based build procedure has been updated to match. * js/cmake-libgit-fix: cmake: stop trying to build the reftable and xdiff libraries
2025-11-17cmake: stop trying to build the reftable and xdiff librariesJohannes Schindelin-13/+1
In the `en/make-libgit-a` topic branch, more precisely in the commits f3b4c89d59f1 (make: delete REFTABLE_LIB, add reftable to LIB_OBJS, 2025-10-02) and cf680cdb9543 (make: delete XDIFF_LIB, add xdiff to LIB_OBJS, 2025-10-02), the strategy to build three static libraries was rethought, and instead only one static library is now built. This is good. However, the CMake definition was not changed accordingly, and now CMake-based builds fail thusly: [...] Generating hook-list.h CMake Error at CMakeLists.txt:122 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:711 (parse_makefile_for_sources) CMake Error at CMakeLists.txt:122 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:717 (parse_makefile_for_sources) -- Configuring incomplete, errors occurred! Fix that by removing the parts that expect the reftable and xdiff objects to be defined separately in the Makefile, still. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-17wincred: avoid memory corruptionDavid Macek-1/+1
`wcsncpy_s()` wants to write the terminating null character so we need to allocate one more space for it in the target memory block. This should fix crashes when trying to read passwords. When this happened, the password/token wouldn't print out and Git would therefore ask for a new password every time. Signed-off-by: David Macek <david.macek.0@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-14osxkeychain: avoid incorrectly skipping store operationKoji Nakamaru-30/+132
git-credential-osxkeychain skips storing a credential if its "get" action sets "state[]=osxkeychain:seen=1". This behavior was introduced in e1ab45b2 (osxkeychain: state to skip unnecessary store operations, 2024-05-15), which appeared in v2.46. However, this state[] persists even if a credential returned by "git-credential-osxkeychain get" is invalid and a subsequent helper's "get" operation returns a valid credential. Another subsequent helper (such as [1]) may expect git-credential-osxkeychain to store the valid credential, but the "store" operation is incorrectly skipped because it only checks "state[]=osxkeychain:seen=1". To solve this issue, "state[]=osxkeychain:seen" needs to contain enough information to identify whether the current "store" input matches the output from the previous "get" operation (and not a credential from another helper). Set "state[]=osxkeychain:seen" to a value encoding the credential output by "get", and compare it with a value encoding the credential input by "store". [1]: https://github.com/hickford/git-credential-oauth Reported-by: Petter Sælen <petter@saelen.eu> Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-12Merge branch 'dk/meson-html-dir'Junio C Hamano-2/+2
The build procedure based on meson learned to allow builders to specify the directory to install HTML documents. * dk/meson-html-dir: meson: make GIT_HTML_PATH configurable
2025-11-06meson: make GIT_HTML_PATH configurableD. Ben Knoble-2/+2
Makefile-based builds can configure Git's internal HTML_PATH by defining htmldir, which is useful for packagers that put documentation in different locations. Gentoo, for example, uses version-suffixed directories like ${prefix}/share/doc/git-2.51 and puts the HTML documentation in an 'html' subdirectory of the same. Propagate the same configuration knob to Meson-based builds so that "git --html-path" on such systems can be configured to output the correct directory. Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-06wincred: align Makefile with other Makefiles in contribThomas Uhle-8/+10
* Replace $(LOADLIBES) because it is deprecated since long and it is used nowhere else in the git project. * Use $(gitexecdir) instead of $(libexecdir) because config.mak defines $(libexecdir) as $(prefix)/libexec, not as $(prefix)/libexec/git-core. * Similar to other Makefiles, let install target rule create $(gitexecdir) to make sure the directory exists before copying the executable and also let it respect $(DESTDIR). * Shuffle the lines for the default settings to align them with the other Makefiles in contrib/credential. * Define .PHONY for all special targets (all, install, clean). Signed-off-by: Thomas Uhle <thomas.uhle@mailbox.tu-dresden.de> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-04Merge branch 'tu/credential-install'Junio C Hamano-2/+12
Contributed credential helpers (obviously in contrib/) now have "cd $there && make install" target. * tu/credential-install: contrib/credential: add install target
2025-10-30Merge branch 'kf/log-shortlog-completion-fix'Junio C Hamano-2/+3
"git shortlog" knows "--committer" and "--author" options, which the command line completion (in contrib/) did not handle well, which has been corrected. * kf/log-shortlog-completion-fix: completion: complete some 'git log' options
2025-10-25contrib/credential: add install targetThomas Uhle-2/+12
Add an install target rule to the Makefiles in contrib/credential in the same manner as in other Makefiles in contrib such as for contacts or subtree. Signed-off-by: Thomas Uhle <thomas.uhle@mailbox.tu-dresden.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-10-20contrib/credential: harmonize MakefilesThomas Uhle-23/+27
Update these Makefiles to be in line with other Makefiles from contrib such as for contacts or subtree by making the following changes: * Make the default settings after including config.mak.autogen and config.mak. * Add the missing $(CPPFLAGS) to the compiler command as well as the missing $(CFLAGS) to the linker command. * Use a pattern rule for compilation instead of a dedicated rule for each compile unit. * Get rid of $(MAIN), $(SRCS) and $(OBJS) and simply use their values such as git-credential-libsecret and git-credential-libsecret.o. * Strip @ from $(RM) to let the clean target rule be verbose. * Define .PHONY for all special targets (all, clean). Signed-off-by: Thomas Uhle <thomas.uhle@mailbox.tu-dresden.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-10-20completion: complete some 'git log' optionsKIYOTA Fumiya-2/+3
1. '--exclude=' option to 'git log' and 'git shortlog' are missing. Add the option to __git_log_shortlog_options. 2. The `--committer` option in `git log` requires a pattern, such as `--committer=ba`, but in `git shortlog`, specifying a pattern results in an error: “error: option `committer' takes no value.” Handle them as separate options for completion rather than a shared one. Signed-off-by: KIYOTA Fumiya <aimluck.kiyota@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>