aboutsummaryrefslogtreecommitdiffstats
path: root/contrib (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-11-04Merge branch 'tu/credential-install'Junio C Hamano2-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 Hamano1-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 Uhle2-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 Uhle2-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 Fumiya1-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>
2025-10-02Merge branch 'ps/meson-build-docs'Junio C Hamano2-4/+4
The build procedure based on meson learned a target to only build documentation, similar to "make doc". * ps/meson-build-docs: ci: don't compile whole project when testing docs with Meson meson: print docs backend as part of the summary meson: introduce a "docs" alias to compile documentation only
2025-09-23Merge branch 'cs/subtree-squash-split-fix'Junio C Hamano2-8/+99
"git subtree" (in contrib/) did not work correctly when splitting squashed subtrees, which has been improved. * cs/subtree-squash-split-fix: contrib/subtree: fix split with squashed subtrees
2025-09-23Merge branch 'jk/add-i-color'Junio C Hamano1-0/+8
Some among "git add -p" and friends ignored color.diff and/or color.ui configuration variables, which is an old regression, which has been corrected. * jk/add-i-color: contrib/diff-highlight: mention interactive.diffFilter add-interactive: manually fall back color config to color.ui add-interactive: respect color.diff for diff coloring stash: pass --no-color to diff plumbing child processes
2025-09-11meson: introduce a "docs" alias to compile documentation onlyPatrick Steinhardt2-4/+4
Meson does not currently provide a target to compile documentation, only. Instead, users needs to compile the whole project, which may be way more than they really intend to do. Introduce a new "docs" alias to plug this gap. This alias can be invoked e.g. with `meson compile docs`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-11contrib/subtree: fix split with squashed subtreesColin Stagner2-8/+99
98ba49ccc2 (subtree: fix split processing with multiple subtrees present, 2023-12-01) increases the performance of git subtree split --prefix=subA by ignoring subtree merges which are outside of `subA/`. It also introduces a regression. Subtree merges that should be retained are incorrectly ignored if they: 1. are nested under `subA/`; and 2. are merged with `--squash`. For example, a subtree merged like: git subtree merge --squash --prefix=subA/subB "$rev" # ^^^^^^^^ ^^^^ is erroneously ignored during a split of `subA`. This causes missing tree files and different commit hashes starting in git v2.44.0-rc0. The method: should_ignore_subtree_split_commit REV should test only a single commit REV, but the combination of git log -1 --grep=... actually searches all *parent* commits until a `--grep` match is discovered. Rewrite this method to test only one REV at a time. Extract commit information with a single `git` call as opposed to three. The `test` conditions for rejecting a commit remain unchanged. Unit tests now cover nested subtrees. Signed-off-by: Colin Stagner <ask+git@howdoi.land> Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-09-08contrib/diff-highlight: mention interactive.diffFilterJeff King1-0/+8
When the README for diff-highlight was written, there was no way to trigger it for the `add -p` interactive patch mode. We've since grown a feature to support that, but it was documented only on the Git side. Let's also let people coming the other direction, from diff-highlight, know that it's an option. Suggested-by: Isaac Oscar Gariano <IsaacOscar@live.com.au> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-22Merge branch 'gh/git-jump-pathname-with-sp'Junio C Hamano1-1/+1
"git jump" (in contrib/) fails to parse the diff header correctly when a file has a space in its name, which has been corrected. * gh/git-jump-pathname-with-sp: git-jump: make `diff` work with filenames containing spaces
2025-08-17cmake: accommodate for `UNIT_TEST_SOURCES`Johannes Schindelin1-1/+3
As part of 9bbc981c6f2 (t/unit-tests: finalize migration of reftable-related tests, 2025-07-24), the explicit list of `UNIT_TEST_PROGRAMS` was turned into a wildcard pattern-derived list. Let's do the same in the CMake definition. This fixes build errors with symptoms like this: CMake Error at CMakeLists.txt:132 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): CMakeLists.txt:1037 (parse_makefile_for_scripts) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-11git-jump: make `diff` work with filenames containing spacesGreg Hurrell1-1/+1
In diff.c, we output a trailing "\t" at the end of any filename that contains a space: case DIFF_SYMBOL_FILEPAIR_PLUS: meta = diff_get_color_opt(o, DIFF_METAINFO); reset = diff_get_color_opt(o, DIFF_RESET); fprintf(o->file, "%s%s+++ %s%s%s\n", diff_line_prefix(o), meta, line, reset, strchr(line, ' ') ? "\t" : ""); break; That is, for a file "foo.txt", `git diff --no-prefix` will emit: +++ foo.txt but for "foo bar.txt" it will emit: +++ foo bar.txt\t This in turn leads `git-jump` to produce a quickfix format like this: foo bar.txt\t:1:1:contents Because no "foo bar.txt\t" file actually exists on disk, opening it in Vim will just land the user in an empty buffer. This commit takes the simple approach of unconditionally stripping any trailing tab. Consider the following three examples: 1. For file "foo", Git will emit "foo". 2. For file "foo bar", Git will emit "foo bar\t". 3. For file "foo\t", Git will emit "\"foo\t\"". 4. For file "foo bar\t", Git will emit "\"foo bar\t\"". Before this commit, `git-jump` correctly handled only case "1". After this commit, `git-jump` correctly handles cases "1" and "2". In reality, these are the only cases people are going to run into with any regularity, and the other two are rare edge cases, which probably aren't worth the effort to support unless somebody actually complains about them. Signed-off-by: Greg Hurrell <greg.hurrell@datadoghq.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-23config: drop `git_config()` wrapperPatrick Steinhardt1-1/+1
In 036876a1067 (config: hide functions using `the_repository` by default, 2024-08-13) we have moved around a bunch of functions in the config subsystem that depend on `the_repository`. Those function have been converted into mere wrappers around their equivalent function that takes in a repository as parameter, and the intent was that we'll eventually remove those wrappers to make the dependency on the global repository variable explicit at the callsite. Follow through with that intent and remove `git_config()`. All callsites are adjusted so that they use `repo_config(the_repository, ...)` instead. While some callsites might already have a repository available, this mechanical conversion is the exact same as the current situation and thus cannot cause any regression. Those sites should eventually be cleaned up in a later patch series. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-15Merge branch 'ps/object-store'Junio C Hamano1-1/+1
Code clean-up around object access API. * ps/object-store: odb: rename `read_object_with_reference()` odb: rename `pretend_object_file()` odb: rename `has_object()` odb: rename `repo_read_object_file()` odb: rename `oid_object_info()` odb: trivial refactorings to get rid of `the_repository` odb: get rid of `the_repository` when handling submodule sources odb: get rid of `the_repository` when handling the primary source odb: get rid of `the_repository` in `for_each()` functions odb: get rid of `the_repository` when handling alternates odb: get rid of `the_repository` in `odb_mkstemp()` odb: get rid of `the_repository` in `assert_oid_type()` odb: get rid of `the_repository` in `find_odb()` odb: introduce parent pointers object-store: rename files to "odb.{c,h}" object-store: rename `object_directory` to `odb_source` object-store: rename `raw_object_store` to `object_database`
2025-07-14Merge branch 'mc/netrc-service-names'Junio C Hamano2-7/+15
"netrc" credential helper has been improved to understand textual service names (like smtp) in addition to the numeric port numbers (like 25). * mc/netrc-service-names: contrib: better support symbolic port names in git-credential-netrc contrib: warn for invalid netrc file ports in git-credential-netrc contrib: use a more portable shebang for git-credential-netrc
2025-07-07Sync with Git 2.50.1Junio C Hamano1-7/+15
2025-07-02Merge branch 'ps/contrib-sweep'Junio C Hamano49-6822/+0
Remove bunch of stuff from contrib/ hierarchy. * ps/contrib-sweep: contrib: remove some scripts in "stats" directory contrib: remove "git-new-workdir" contrib: remove "emacs" directory contrib: remove "git-resurrect.sh" contrib: remove "persistent-https" remote helper contrib: remove "mw-to-git" contrib: remove "hooks" directory contrib: remove "thunderbird-patch-inline" contrib: remove remote-helper stubs contrib: remove "examples" directory contrib: remove "remotes2config.sh"
2025-07-01object-store: rename files to "odb.{c,h}"Patrick Steinhardt1-1/+1
In the preceding commits we have renamed the structures contained in "object-store.h" to `struct object_database` and `struct odb_backend`. As such, the code files "object-store.{c,h}" are confusingly named now. Rename them to "odb.{c,h}" accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30Merge branch 'jc/cocci-avoid-regexp-constraint'Junio C Hamano1-1/+2
Avoid regexp_constraint and instead use comparison_constraint when listing functions to exclude from application of coccinelle rules, as spatch can be built with different regexp engine X-<. * jc/cocci-avoid-regexp-constraint: cocci: matching (multiple) identifiers
2025-06-25contrib: better support symbolic port names in git-credential-netrcMaxim Cournoyer2-8/+11
To improve support for symbolic port names in netrc files, this changes does the following: - Treat symbolic port names as ports, not protocols in git-credential-netrc - Validate the SMTP server port provided to send-email - Convert the above symbolic port names to their numerical values. Before this change, it was not possible to have a SMTP server port set to "smtps" in a netrc file (e.g. Emacs' ~/.authinfo.gpg), as it would be registered as a protocol and break the match for a "smtp" protocol host, as queried for by git-send-email. Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-25contrib: warn for invalid netrc file ports in git-credential-netrcMaxim Cournoyer1-3/+8
Invalid ports were previously silently dropped; now a warning message is produced. Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-25contrib: use a more portable shebang for git-credential-netrcMaxim Cournoyer1-1/+1
While the installed scripts have their Perl shebang set to PERL_PATH, it is nevertheless useful to be able to run the uninstalled script for manual tests while developing. This change makes the shebang more portable by having the perl command looked from PATH instead of from a fixed location. Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-24Merge branch 'pw/subtree-gpg-sign'Junio C Hamano3-40/+158
"git subtree" (in contrib/) learns to grok GPG signing its commits. * pw/subtree-gpg-sign: contrib/subtree: add -S/--gpg-sign contrib/subtree: parse using --stuck-long
2025-06-20cocci: matching (multiple) identifiersJunio C Hamano1-1/+2
"make coccicheck" seems to work OK at GitHub CI using $ spatch --version spatch version 1.1.1 compiled with OCaml version 4.13.1 OCaml scripting support: yes Python scripting support: yes Syntax of regular expressions: PCRE but not with $ spatch --version spatch version 1.3 compiled with OCaml version 5.3.0 OCaml scripting support: yes Python scripting support: yes Syntax of regular expressions: Str Judging from https://ocaml.org/manual/5.3/api/Str.html, I suspect that this probably is caused by the distinction between BRE vs PCRE. As there is no reasonably clean way to write the multiple choice matches portably between these two pattern languages, let's stop using regexp_constraint and use compare_constraint instead when listing the function names to exclude. There are other uses of "!~" but they all want to match a single simple token, that should work fine either with BRE or PCRE. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-18Merge branch 'jw/doc-txt-to-adoc-refs'Junio C Hamano1-1/+1
Some leftover references to documentation source files that no longer exist, due to recent ".txt" -> ".adoc" renaming, have been corrected. * jw/doc-txt-to-adoc-refs: doc: update references to renamed AsciiDoc files
2025-06-15Sync with 2.49.1Junio C Hamano1-7/+15
2025-06-12Sync with 2.48.2Junio C Hamano1-7/+15
* maint-2.48: Git 2.48.2 Git 2.47.3 Git 2.46.4 Git 2.45.4 Git 2.44.4 Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-06doc: update references to renamed AsciiDoc filesJouke Witteveen1-1/+1
The .txt extensions were changed to .adoc in 1f010d6 (doc: use .adoc extension for AsciiDoc files, 2025-01-20). References to the renamed files were not updated yet. Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-04contrib/subtree: add -S/--gpg-signPatrik Weiskircher3-19/+145
Allows optionally signing the commits that git subtree creates. This can be necessary when working in a repository that requires gpg signed commits. Signed-off-by: Patrik Weiskircher <patrik@pspdfkit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-04contrib/subtree: parse using --stuck-longPatrik Weiskircher1-21/+13
Optional parameter handling only works unambiguous with git rev-parse --parseopt when using the --stuck-long option. To prepare for future commits which add flags with optional parameters, parse with --stuck-long. Signed-off-by: Patrik Weiskircher <patrik@pspdfkit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-02meson: introduce kwargs variable for testsPatrick Steinhardt2-2/+2
Meson has the ability to create a kwargs dictionary that can then be passed to any function call with the `kwargs:` positional argument. This allows one to deduplicate common parameters that one wishes to pass to several different function invocations. Our tests already have one common parameter that we use everywhere, "timeout", and we're about to add a second common parameter in the next commit. Let's prepare for this by introducing `test_kwargs` so that we can deduplicate these common arguments. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-28Sync with 2.47.3Taylor Blau1-7/+15
* maint-2.47: Git 2.47.3 Git 2.46.4 Git 2.45.4 Git 2.44.4 Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths
2025-05-28Sync with 2.46.4Taylor Blau1-7/+15
* maint-2.46: Git 2.46.4 Git 2.45.4 Git 2.44.4 Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Sync with 2.45.4Taylor Blau1-7/+15
* maint-2.45: Git 2.45.4 Git 2.44.4 Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Sync with 2.44.4Taylor Blau1-7/+15
* maint-2.44: Git 2.44.4 Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Sync with 2.43.7Taylor Blau1-7/+15
* maint-2.43: Git 2.43.7 wincred: avoid buffer overflow in wcsncat() bundle-uri: fix arbitrary file writes via parameter injection config: quote values containing CR character git-gui: sanitize 'exec' arguments: convert new 'cygpath' calls git-gui: do not mistake command arguments as redirection operators git-gui: introduce function git_redir for git calls with redirections git-gui: pass redirections as separate argument to git_read git-gui: pass redirections as separate argument to _open_stdout_stderr git-gui: convert git_read*, git_write to be non-variadic git-gui: override exec and open only on Windows gitk: sanitize 'open' arguments: revisit recently updated 'open' calls git-gui: use git_read in githook_read git-gui: sanitize $PATH on all platforms git-gui: break out a separate function git_read_nice git-gui: assure PATH has only absolute elements. git-gui: remove option --stderr from git_read git-gui: cleanup git-bash menu item git-gui: sanitize 'exec' arguments: background git-gui: avoid auto_execok in do_windows_shortcut git-gui: sanitize 'exec' arguments: simple cases git-gui: avoid auto_execok for git-bash menu item git-gui: treat file names beginning with "|" as relative paths git-gui: remove unused proc is_shellscript git-gui: remove git config --list handling for git < 1.5.3 git-gui: remove special treatment of Windows from open_cmd_pipe git-gui: remove HEAD detachment implementation for git < 1.5.3 git-gui: use only the configured shell git-gui: remove Tcl 8.4 workaround on 2>@1 redirection git-gui: make _shellpath usable on startup git-gui: use [is_Windows], not bad _shellpath git-gui: _which, only add .exe suffix if not present gitk: encode arguments correctly with "open" gitk: sanitize 'open' arguments: command pipeline gitk: collect construction of blameargs into a single conditional gitk: sanitize 'open' arguments: simple commands, readable and writable gitk: sanitize 'open' arguments: simple commands with redirections gitk: sanitize 'open' arguments: simple commands gitk: sanitize 'exec' arguments: redirect to process gitk: sanitize 'exec' arguments: redirections and background gitk: sanitize 'exec' arguments: redirections gitk: sanitize 'exec' arguments: 'eval exec' gitk: sanitize 'exec' arguments: simple cases gitk: have callers of diffcmd supply pipe symbol when necessary gitk: treat file names beginning with "|" as relative paths Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28wincred: avoid buffer overflow in wcsncat()Taylor Blau1-7/+15
The wincred credential helper uses a static buffer ("target") as a unique key for storing and comparing against internal storage. It does this by building up a string is supposed to look like: git:$PROTOCOL://$USERNAME@$HOST/@PATH However, the static "target" buffer is declared as a wide string with no more than 1,024 wide characters. The first call to wcsncat() is almost correct (it copies no more than ARRAY_SIZE(target) wchar_t's), but does not account for the trailing NUL, introducing an off-by-one error. But subsequent calls to wcsncat() have an additional problem on top of the off-by-one. They do not account for the length of the existing wide string being built up in 'target'. So the following: $ perl -e ' my $x = "x" x 1_000; print "protocol=$x\nhost=$x\nusername=$x\npath=$x\n" ' | C\:/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe get will result in a segmentation fault from over-filling buffer. This bug is as old as the wincred helper itself, dating back to a6253da0f3 (contrib: add win32 credential-helper, 2012-07-27). Commit 8b2d219a3d (wincred: improve compatibility with windows versions, 2013-01-10) replaced the use of strncat() with wcsncat(), but retained the buggy behavior. Fix this by using a "target_append()" helper which accounts for both the length of the existing string within the buffer, as well as the trailing NUL character. Reported-by: David Leadbeater <dgl@dgl.cx> Helped-by: David Leadbeater <dgl@dgl.cx> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-13Merge branch 'js/ci-buildsystems-cleanup'Junio C Hamano7-1864/+0
Code clean-up around stale CI elements and building with Visual Studio. * js/ci-buildsystems-cleanup: config.mak.uname: drop the `vcxproj` target contrib/buildsystems: drop support for building . vcproj/.vcxproj files ci: stop linking the `prove` cache
2025-05-12contrib: remove some scripts in "stats" directoryPatrick Steinhardt2-96/+0
The "stats" directory contains a couple of scripts to do some statistics on a repository: - "git-common-hash" shows the longest common hash prefixes and can be used to determine the minimum prefix length to use for object names to be unique. The script has last been touched in 53474eb92ff (contrib: update stats/mailmap script, 2012-12-12) and searching for it on the internet doesn't really surface any potential use cases or even mentions of it. Modern Git also shouldn't really need this tool as it knows to automatically scale printed prefixes via some heuristics. - "mailmap.pl" performs some statistics on the number of mailmapped commits in a repository. It has last been modified in 53474eb92ff (contrib: update stats/mailmap script, 2012-12-12) and has since been bitrotting. It doesn't even compile nowadays anymore: $ perl contrib/stats/mailmap.pl Experimental keys on scalar is now forbidden at contrib/stats/mailmap.pl line 57. Type of arg 1 to keys must be hash or array (not hash element) at contrib/stats/mailmap.pl line 57, near "}) " Experimental keys on scalar is now forbidden at contrib/stats/mailmap.pl line 57. Type of arg 1 to keys must be hash or array (not private variable) at contrib/stats/mailmap.pl line 57, near "$h)" Experimental keys on scalar is now forbidden at contrib/stats/mailmap.pl line 64. Type of arg 1 to keys must be hash or array (not private variable) at contrib/stats/mailmap.pl line 64, near "$h)" Execution of contrib/stats/mailmap.pl aborted due to compilation errors. This should be good-enough signal to indicate that nobody is using this script at all anymore. - "packinfo.pl" takes the output from git-verify-pack(1) and performs some pretty printing thereof. On the one hand it reformats the output to be easier to read and provide some summaries. On the other hand it may also print filenames of blobs. We don't have any replacement for this tool. Ideally, we should move its functionality into git-verify-pack(1) itself. Remove the first two scripts, but retain "packinfo.pl". Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "git-new-workdir"Patrick Steinhardt2-106/+0
The "git-new-workdir" command has been introduced to make it possible to have a separate working directory in a different place. The command thus predates git-worktree(1), which is what people use nowadays to create any such working directory. As such, the script doesn't really have much of a reason to exist nowadays anymore. It also doesn't seem like the script is still in use: the last time it has received an update was in e32afab7b03 (git-new-workdir: don't fail if the target directory is empty, 2014-11-26), more than a decade ago. Remove it as well as the tests that depend on it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "emacs" directoryPatrick Steinhardt3-45/+0
While the "emacs/" directory still exists, all of its code has been replaced with stubs in 6d5ed4836db (git{,-blame}.el: remove old bitrotting Emacs code, 2018-04-11). Instead, the recommendation is to use Emacs' own vc-annotate mode. Remove the code altogether. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "git-resurrect.sh"Patrick Steinhardt1-181/+0
The "git-resurrect.sh" script can be used to find traces of a branch tip in the reflog and resurrect that branch. Despite a couple of global cleanups, the script hasn't seen any activity since it was introduced in e1ff064e1bf (contrib git-resurrect: find traces of a branch name and resurrect it, 2009-02-04). Furthermore, the tool does not work with the "reftable" backend at all as it directly reads ".git/logs/HEAD". As reflogs are stored as part of the individual tables though that file wouldn't exist in a "reftable"- enabled repository. Last but not least, the tool doesn't even work unless it is explicitly invoked via `git resurrect` as it sources "git-sh-setup". As none of our build systems know to install this script, users thus have to go out of their way to really make it work, which is highly unlikely. Another source that indicates that this tool can be removed is a question for how to restore deleted branches on StackOverflow [1]. The top-voted answer uses git-reflog(1) directly and has received more than 3000 votes to date. While "git-resurrect.sh" is also mentioned, it only got 16 upvotes, and comments mention the above caveat that users have to do some manual setup to make it work. It's thus rather clear that the tool doesn't have a lot or even any users. Remove it. [1]: https://stackoverflow.com/questions/3640764/can-i-recover-a-branch-after-its-deletion-in-git Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "persistent-https" remote helperPatrick Steinhardt7-875/+0
The "persistent-https" remote helper supposedly speeds up SSL operations by running a daemon that keeps a connection open to a remote server. It is effectively unmaintained nowadays: the last time it received an update was in accb613afd2 (contrib/persistent-https: use Git version for build label, 2016-07-20) and its parent commits to make it compile with Go 1.7+. This Go toolchain is somewhat dated by now though and unsupported. The oldest still-supported toolchain is Go 1.23, which was released in August 2024. It is not possible to compile the remote helper with that Go version anymore: $ go version go version go1.23.8 linux/amd64 $ make case $(go version) in \ "go version go"1.[0-5].*) EQ=" " ;; *) EQ="=" ;; esac && \ go build -o git-remote-persistent-https \ -ldflags "-X main._BUILD_EMBED_LABEL${EQ}GIT_VERSION=2.49.0.943.g965a70ebf62" go: cannot find main module, but found .git/config in /home/pks/Development/git to create a module there, run: cd ../.. && go mod init make: *** [Makefile:31: git-remote-persistent-https] Error 1 The problem is that modern Go toolchains require a "go.mod" file, but we don't have any such files. This requirement exists since quite a while already, so it's clear that nobody has tried to use this remote helper anytime recent. Remove the remote helper. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "mw-to-git"Patrick Steinhardt22-3911/+0
The "mw-to-git" directory contains tools for accessing MediaWiki via Git. The scripts are essentially unmaintained in Git: despite a couple of global cleanups, the last changes were a couple of security-related issues part of 9a8606465e8 (remote-mediawiki: use "sh" to eliminate unquoted commands, 2020-09-21) and its parents. We don't ever run any of the tests so it is more likely than not that many of the tests have been bitrotting, like e.g. documented in f8ab018dafc (remote-mediawiki tests: annotate failing tests, 2020-09-21). According to Matthieu Moy [1], one of the original developers of this tool, it didn't receive any attention recently and there is no motivation to keep maintaining it anymore in the community. The project has been spun out of Git [2] and thus has a new official home, but did not receive much attention over there, either. As such, it seems like the MediaWiki transport helper is slowly fading away. But given that there is a new home, it doesn't make sense to have it as part of Git anymore only to let it rot. Remove the directory. [1]: <108f297a-b415-4742-80e4-51ea02af18e9@matthieu-moy.fr> [2]: https://github.com/Git-Mediawiki/Git-Mediawiki Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "hooks" directoryPatrick Steinhardt5-1443/+0
The "hooks" directory contains a handful of example hooks. Most of these hooks are highly specific and haven't really received any updates over the last couple of years, except for some global cleanups. The multimail hook has also been removed in f74d11471fa (multimail: stop shipping a copy, 2021-06-10) in favor of its upstream project [1]. Remove those hooks. If we want to provide examples for how to use Git hooks we should do that as part of our documentation, for example in githooks(5). [1]: https://github.com/git-multimail/git-multimail Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "thunderbird-patch-inline"Patrick Steinhardt2-75/+0
The "thunderbird-patch-inline" directory in "contrib/" contains a script to send patch files via Thunderbird. This script depends on the ExternalEditor extension [1], which seems to be effectively unmaintained with the last update being in 2008. While the extension has eventually been maintained in [2], that fork hasn't received any updates since 2020, either. As such, the ExternalEditor extension does not work with modern versions of Thunderbird anymore, and as the "thunderbird-patch-inline" script depends on the ExternalEditor extension it likely doesn't work anymore, either. The fact that this script hasn't been touched for the last 10 years outside of some global cleanup supports the idea that it is not useful anymore. Remove it. [1]: https://globs.org/articles.php?lng=en&pg=2 [2]: https://github.com/exteditor/exteditor/releases Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove remote-helper stubsPatrick Steinhardt3-37/+0
The "remote-helpers" directory contains two remote helper scripts for Mercurial and Bazaar. These scripts have since been converted into stubs in b2c851a8e67 (Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)", 2014-05-20) as the helpers have been moved into their own upstream projects [1][2]. Given that these stubs have been created more than a decade ago it is very unlikely that anybody still tries to use them. Remove them. [1]: https://github.com/felipec/git-remote-bzr [1]: https://github.com/felipec/git-remote-hg Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-12contrib: remove "examples" directoryPatrick Steinhardt1-20/+0
The "examples" directory used to contain scripted versions of some of our builtins. These have all been removed in 49eb8d39c78 (Remove contrib/examples/*, 2018-03-25), but we left a note in the directory to make it discoverable that there used to be examples. It is unlikely that anybody still looks at these examples more than 7 years after they have been removed. Remove the note and its directory. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>