summaryrefslogtreecommitdiffstats
path: root/git-gui/lib (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2025-06-15Git 2.50v2.50.0Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-13Hopefully final bits before 2.50Junio C Hamano1-2/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-13Git 2.49.1v2.49.1Junio C Hamano3-2/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12build: sed portability fixesJunio C Hamano2-5/+5
Recently generating the version-def.h file and the config-list.h file have been updated, which broke versions of "sed" that do not want to be fed a file that ends with an incomplete line, and/or that do not understand the more recent "-E" option to use extended regular expression. Fix them in response to a build-failure reported on Solaris boxes. cf. https://lore.kernel.org/git/09f954b8-d9c3-418f-ad4b-9cb9b063f4ae@comstyle.com/ Reported-by: Brad Smith <brad@comstyle.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12Revert "bswap.h: add support for built-in bswap functions"Sebastian Andrzej Siewior1-13/+1
Since 6547d1c9 (bswap.h: add support for built-in bswap functions, 2025-04-23) tweaked the way the bswap32/64 macros are defined, on platforms with __builtin_bswap32/64 supported, the bswap32/64 macros are defined even on big endian platforms. However the rest of this file assumes that bswap32/64() are defined ONLY on little endian machines and uses that assumption to redefine ntohl/ntohll macros. The said commit broke t4014-format-patch.sh test, among many others on s390x. Revert the commit. Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12l10n: zh_TW: update translation for Git 2.50Yi-Jyun Pan1-516/+643
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2025-06-12l10n: zh_CN: updated translation for 2.50Teng Long1-481/+344
Helped-by: 依云 <lilydjwg@gmail.com> Helped-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Teng Long <dyroneteng@gmail.com>
2025-06-11RelNotes/2.50.0: fix typos & other improvementsKristoffer Haugsbakk1-9/+8
• Replace with phrases that are more standard (“all-or-nothing” instead of “-none”) • Add coordinating words that make it less likely for you to trip over the sentence (“*that* "gc" can do”) • Use “SMTP” instead of both SMTP and smtp • Don’t mention `git fsck --reference` since the previous release was not affected by this minor bug. Also say “errored out” since the git-refs(1) bug was there in v2.48.0 as well • Use the more widespread “linked” instead of “secondary worktree” Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-11ci(coverity): output the build log upon errorJohannes Schindelin1-1/+5
It is quite helpful to know what Coverity said, exactly, in case it fails to analyze the code. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-11ci(coverity): fix building on WindowsJohannes Schindelin1-1/+1
When I added the Coverity workflow in a56b6230d0b1 (ci: add a GitHub workflow to submit Coverity scans, 2023-09-25), I merely converted an Azure Pipeline definition that had been running successfully for ages. In the meantime, the current Coverity documentation describes a very different way to install the analysis tool, recommending to add the `bin/` directory to the _end_ of `PATH` (when originally, IIRC, it was recommended to add it to the _beginning_ of the `PATH`). This is crucial! The reason is that the current incarnation of the Windows variant of Coverity's analysis tools come with a _lot_ of DLL files in their `bin/` directory, some of them interferring rather badly with the `gcc.exe` in Git for Windows' SDK that we use to run the Coverity build. The symptom is a cryptic error message: make: *** [Makefile:2960: headless-git.o] Error 1 make: *** Waiting for unfinished jobs.... D:\git-sdk-64-minimal\mingw64\bin\windres.exe: preprocessing failed. make: *** [Makefile:2679: git.res] Error 1 make: *** [Makefile:2893: git.o] Error 1 make: *** [Makefile:2893: builtin/add.o] Error 1 Attempting to detect unconfigured compilers in build |0----------25-----------50----------75---------100| **************************************************** Warning: Build command make.exe exited with code 2. Please verify that the build completed successfully. Warning: Emitted 0 C/C++ compilation units (0%) successfully 0 C/C++ compilation units (0%) are ready for analysis For more details, please look at: D:/a/git/git/cov-int/build-log.txt The log (which the workflow is currently not configured to reveal) then points out that the `windows.h` header cannot be found, which is _still_ not very helpful. The underlying root cause is that the `gcc.exe` in Git for Windows' SDK determines the location of the header files via the location of certain DLL files, and finding the "wrong" ones first on the `PATH` misleads that logic. Let's fix this problem by following Coverity's current recommendation and append the `bin/` directory in which `cov-int` can be found to the _end_ of `PATH`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-11l10n: Update German translationRalf Thielow1-408/+277
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2025-06-10l10n: uk: add 2.50 translationArkadii Yakovets1-387/+262
Co-authored-by: Kate Golovanova <kate@kgthreads.com> Co-authored-by: Tamara Lazerka <98753789+aramattamara@users.noreply.github.com> Signed-off-by: Arkadii Yakovets <ark@cho.red> Signed-off-by: Kate Golovanova <kate@kgthreads.com> Signed-off-by: Tamara Lazerka <98753789+aramattamara@users.noreply.github.com>
2025-06-09doc: maintenance: fix linkgit syntaxKristoffer Haugsbakk1-1/+1
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-09Git 2.50-rc2v2.50.0-rc2Junio C Hamano2-1/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-07A bit more before -rc2Junio C Hamano1-0/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-07l10n: po-id for 2.50Bagas Sanjaya1-493/+344
Update following components: * builtin/cat-file.c * builtin/fast-export.c * builtin/fsck.c * builtin/merge-tree.c * builtin/mv.c * builtin/reflog.c * builtin/repack.c * builtin/rev-list.c * builtin/update-ref.c * command-list.h * midx-write.c * object-file.c * parse-options.c * promisor-remote.c * refs/packed-backend.c * scalar.c * t/helper/test-pack-deltas.c * git-send-email.perl Translate following new components: * builtin/diff-pairs.c Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2025-06-06curl: pass `long` values where expectedJohannes Schindelin3-17/+17
As of Homebrew's update to cURL v8.14.0, there are new compile errors to be observed in the `osx-gcc` job of Git's CI builds: In file included from http.h:8, from imap-send.c:36: In function 'setup_curl', inlined from 'curl_append_msgs_to_imap' at imap-send.c:1460:9, inlined from 'cmd_main' at imap-send.c:1581:9: /usr/local/Cellar/curl/8.14.0/include/curl/typecheck-gcc.h:50:15: error: call to '_curl_easy_setopt_err_long' declared with attribute warning: curl_easy_setopt expects a long argument [-Werror=attribute-warning] 50 | _curl_easy_setopt_err_long(); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/Cellar/curl/8.14.0/include/curl/curl.h:54:7: note: in definition of macro 'CURL_IGNORE_DEPRECATION' 54 | statements \ | ^~~~~~~~~~ imap-send.c:1423:9: note: in expansion of macro 'curl_easy_setopt' 1423 | curl_easy_setopt(curl, CURLOPT_PORT, srvc->port); | ^~~~~~~~~~~~~~~~ [... many more instances of nearly identical warnings...] See for example this CI workflow run: https://github.com/git/git/actions/runs/15454602308/job/43504278284#step:4:307 The most likely explanation is the entry "typecheck-gcc.h: fix the typechecks" in cURL's release notes (https://curl.se/ch/8.14.0.html). Nearly identical compile errors afflicted recently-updated Debian setups, which have been addressed by `jk/curl-easy-setopt-typefix`. However, on macOS Git is built with different build options, which uncovered more instances of `int` values that need to be cast to constants, which were not covered by 6f11c42e8edc (curl: fix integer constant typechecks with curl_easy_setopt(), 2025-06-04). Let's explicitly convert even those remaining `int` constants in `curl_easy_setopt()` calls to `long` parameters. In addition to looking at the compile errors of the `osx-gcc` job, I verified that there are no other instances of the same issue that need to be handled in this manner (and that might not be caught by our CI builds because of yet other build options that might skip those code parts), I ran the following command and inspected all 23 results manually to ensure that the fix is now actually complete: git grep -n curl_easy_setopt | grep -ve ',.*, *[A-Za-z_"&]' \ -e ',.*, *[-0-9]*L)' \ -e ',.*,.* (long)' Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-06git-gui: don't delete source files when auto_mkindex failsJohannes Sixt1-1/+1
Commit 2cc5b0facfa4 (git-gui: extract script to generate "tclIndex", 2025-03-11) converted commands in a Makefile rule to a shell script. In this process, the Makefile variable $@ had to be replaced by the file name that it represents, 'lib/tclIndex'. However, the occurrence in `rm -f $@` was missed. In a shell script, $@ expands to all command line arguments, which happen to be the source files lib/*.tcl in this case. Needless to say that we do not want to remove source files during a build. Replace $@ by the intended 'lib/tclIndex'. Reported-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2025-06-05t5410: avoid hangs in CI runs in the win+Meson test jobsJohannes Schindelin1-2/+15
In the GitHub workflow used in Git's CI builds, the `vs test` jobs use a subset of a specific revision of Git for Windows' SDK to run Git's test suite. This revision is validated by another CI workflow to ensure that said revision _can_ run Git's test suite successfully, skipping buggy updates in Git for Windows' SDK. The `win+Meson test` jobs do things differently, quite differently. They use the Bash of the Git for Windows version that is installed on the runners to run Git's test suite. This difference has consequences. When 68cb0b5253a0 (builtin/receive-pack: add option to skip connectivity check, 2025-05-20) introduced a test case that uses `tee <file> | git receive-pack` as `--receive-pack` parameter (imitating an existing pattern in the same test script), it hit just the sweet spot to trigger a bug in the MSYS2 runtime shipped in Git for Windows v2.49.0. This version is the one currently installed on GitHub's runners. The problem is that the `git receive-pack` process finishes while the `tee` process does not need to write anything anymore and therefore does not receive an EOF. Instead, it should receive a SIGPIPE, but the bug in the MSYS2 runtime prevents that from working as intended. As a consequence, the `tee` process waits for more input from the `git.exe send-pack` process but none is coming, and the test script patiently waits until the 6h timeout hits. Only every once in a while, the `git receive-pack` process manages to send an EOF to the `tee` process and no hang occurs. Therefore, the problem can be worked around by cancelling the clearly-hanging job after twenty or so minutes and re-running it, repeating the process about half a dozen times, until the hang was successfully avoided. This bug in the MSYS2 runtime has been fixed in the meantime, which is the reason why the same test case causes no problems in the `win test` and the `vs test` jobs. This will continue to be the case until the Git for Windows version on the GitHub runners is upgraded to a version that distributes a newer MSYS2 runtime version. However, as of time of writing, this _is_ the latest Git for Windows version, and will be for another 1.5 weeks, until Git v2.50.0 is scheduled to appear (and shortly thereafter Git for Windows v2.50.0). Traditionally it takes a while before the runners pick up the new version. We could just wait it out, six hours at a time. Here, I opt for an alternative: Detect the buggy MSYS2 runtime and simply skip the test case. It's not like the `receive-pack` test cases are specific to Windows, and even then, to my chagrin the CI runs in git-for-windows/git spend around ten hours of compute time each and every time to run the entire test suite on all the platforms, even the tests that cover cross-platform code, and for Windows alone we do that three times: with GCC, with MSVC, and with MSVC via Meson. Therefore, I deem it more than acceptable to skip this test case in one of those matrices. For good luck, also the preceding test case is skipped in that scenario, as it uses the same `--receive-pack=tee <file> | git receive-pack` pattern, even though I never observed that test case to hang in practice. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-04curl: fix symbolic constant typechecks with curl_easy_setopt()Jeff King1-7/+7
As with the previous two commits, we should be passing long integers, not regular ones, to curl_easy_setopt(), and compiling against curl 8.14 loudly complains if we don't. This patch catches the remaining cases, which are ones where we pass curl's own symbolic constants. We'll cast them to long manually in each call. It seems kind of weird to me that curl doesn't define these constants as longs, since the point of them is to pass to curl_easy_setopt(). But in the curl documentation and examples, they clearly show casting them as part of the setopt calls. It may be that there is some reason not to push the type into the macro, like backwards compatibility. I didn't dig, as it doesn't really matter: we have to follow what existing curl versions ask for anyway. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-04curl: fix integer variable typechecks with curl_easy_setopt()Jeff King1-3/+3
As discussed in the previous commit, we should be passing long integers, not regular ones, to curl_easy_setopt(), and compiling against curl 8.14 loudly complains if we don't. That patch fixed integer constants by adding an "L". This one deals with actual variables. Arguably these variables could just be declared as "long" in the first place. But it's actually kind of awkward due to other code which uses them: - port is conceptually a short, and we even call htons() on it (though weirdly it is defined as a regular int). - ssl_verify is conceptually a bool, and we assign to it from git_config_bool(). So I think we could probably switch these out for longs without hurting anything, but it just feels a bit weird. Doubly so because if you don't set USE_CURL_FOR_IMAP_SEND set, then the current types are fine! So let's just cast these to longs in the curl calls, which makes what's going on obvious. There aren't that many spots to modify (and as you can see from the context, we already have some similar casts). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-04curl: fix integer constant typechecks with curl_easy_setopt()Jeff King3-11/+11
The curl documentation specifies that curl_easy_setopt() takes either: ...a long, a function pointer, an object pointer or a curl_off_t, depending on what the specific option expects. But when we pass an integer constant like "0", it will by default be a regular non-long int. This has always been wrong, but seemed to work in practice (I didn't dig into curl's implementation to see whether this might actually be triggering undefined behavior, but it seems likely and regardless we should do what the docs say). This is especially important since curl has a type-checking macro that causes building against curl 8.14 to produce many warnings. The specific commit is due to their 79b4e56b3 (typecheck-gcc.h: fix the typechecks, 2025-04-22). Curiously, it does only seem to trigger when compiled with -O2 for me. We can fix it by just marking the constants with a long "L". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-03Git 2.50-rc1v2.50.0-rc1Junio C Hamano2-3/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-03compat: fixes for header handling with OpenBSD / NetBSDBrad Smith1-5/+5
Handle OpenBSD and NetBSD as FreeBSD / DragonFly are. OpenBSD would need _XOPEN_SOURCE to be set to 700. Its simpler to just not set _XOPEN_SOURCE. CC strbuf.o strbuf.c:645:6: warning: call to undeclared function 'getdelim'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] r = getdelim(&sb->buf, &sb->alloc, term, fp); ^ 1 warning generated. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-02completion: make sed command that generates config-list.h portable.Collin Funk3-3/+4
The OpenBSD 'sed' command does not support '\n' to represent newlines in sed expressions. This leads to the follow compiler error: In file included from builtin/help.c:15: ./config-list.h:282:18: error: use of undeclared identifier 'n' "gitcvs.dbUser",n "gitcvs.dbPass", ^ 1 error generated. gmake: *** [Makefile:2821: builtin/help.o] Error 1 We can fix this by documenting related configuration variables one-per-line instead of listing them separated by commas. This allows us to remove the unportable part of the sed expression in generate-configlist.sh. Signed-off-by: Collin Funk <collin.funk1@gmail.com> Reviewed-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-02fsck: ignore missing "refs" directory for linked worktreesshejialuo2-0/+22
"git refs verify" doesn't work if there are worktrees created on Git v2.43.0 or older versions. These versions don't automatically create the "refs" directory, causing the error: error: cannot open directory .git/worktrees/<worktree name>/refs: No such file or directory Since 8f4c00de95 (builtin/worktree: create refdb via ref backend, 2024-01-08), we automatically create the "refs" directory for new worktrees. And in 7c78d819e6 (ref: support multiple worktrees check for refs, 2024-11-20), we assume that all linked worktrees have this directory and would wrongly report an error to the user, thus introducing compatibility issue. Check for ENOENT errno before reporting directory access errors for linked worktrees to maintain backward compatibility. Reported-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: shejialuo <shejialuo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-02A bit more before -rc1Junio C Hamano1-0/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-01config.mak.uname: update settings for OpenBSDBrad Smith1-4/+1
OpenBSD requires DIR_HAS_BSD_GROUP_SEMANTICS. OpenBSD has never had the BSD sysctl KERN_PROC_PATHNAME nor does it support or use the /proc filesystem. OpenBSD has had strcasestr() since 3.8. OpenBSD has had memmem() since 5.4. Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-01builtin/gc: correct physical memory detection for OpenBSD / NetBSDBrad Smith1-1/+3
OpenBSD / NetBSD use HW_PHYSMEM64 to detect the amount of physical memory in a system. HW_PHYSMEM will not provide the correct amount on a system with >=4GB of memory. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-01doc: column: fix blank lines around block delimitersKristoffer Haugsbakk1-3/+3
227c4f33a03 (doc: add a blank line around block delimiters, 2025-03-09) added blank lines around block delimiters as a defensive measure. For each block you had to mind the con- text (like the commit says): • Top-level: just add blank lines • Block: use list continuation (+) But list continuation was used here at the top level, which results in literal `+` in the output formats. Acked-by: Jean-Noël Avila <jn.avila@free.fr> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-01thread-utils.c: detect online CPU count on OpenBSD / NetBSDBrad Smith1-4/+4
OpenBSD / NetBSD use HW_NCPUONLINE to detect the online CPU count. OpenBSD ships with SMT disabled on X86 systems so HW_NCPU would provide double the number of CPUs as opposed to the proper online count. Signed-off-by: Brad Smith <brad@comstyle.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-30t: run tests from a normalized working directoryMark Mentovai1-0/+2
Some tests make git perform actions that produce observable pathnames, and have expectations on those paths. Tests run with $HOME set to a $TRASH_DIRECTORY, and with their working directory the same $TRASH_DIRECTORY, although these paths are logically identical, they do not observe the same pathname canonicalization rules and thus might not be represented by strings that compare equal. In particular, no pathname normalization is applied to $TRASH_DIRECTORY or $HOME, while tests change their working directory with `cd -P`, which normalizes the working directory's path by fully resolving symbolic links. t7900's macOS maintenance tests (which are not limited to running on macOS) have an expectation on a path that `git maintenance` forms by using abspath.c strbuf_realpath() to resolve a canonical absolute path based on $HOME. When t7900 runs from a working directory that contains symbolic links in its pathname, $HOME will also contain symbolic links, which `git maintenance` resolves but the test's expectation does not, causing a test failure. Align $TRASH_DIRECTORY and $HOME with the normalized path as used for the working directory by resetting them to match the working directory after it's established by `cd -P`. With all paths in agreement and symbolic links resolved, pathname expectations can be set and met based on string comparison without regard to external environmental factors such as the presence of symbolic links in a path. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Mark Mentovai <mark@chromium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-30A bit more topics for -rc1Junio C Hamano1-0/+22
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-30doc: sparse-checkout: use consistent inline list styleWonuk Kim1-1/+1
Fix this inline list to use a single style, namely numeric, instead of `(1)` followed by `(b)`. Signed-off-by: Wonuk Kim <kimww0306@gmail.com> Acked-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-29l10n: bg.po: Updated Bulgarian translation (5819t)Alexander Shopov1-728/+586
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2025-05-29reftable: make REFTABLE_UNUSED C99 compatibleCarlo Marcelo Arenas Belón1-0/+4
Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED` annotation, 2025-02-18), the reftable library was migrated to use an internal version of `UNUSED`, which unconditionally sets a GNU __attribute__ to avoid warnings function parameters that are not being used. Make the definition conditional to prevent breaking the build with non GNU compilers. Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-29l10n: tr: Update Turkish translations for 2.50Emir SARI1-429/+295
Signed-off-by: Emir SARI <emir_sari@icloud.com>
2025-05-29l10n: fr: v2.50 round 1Jean-Noël Avila1-385/+531
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2025-05-29l10n: Add full Irish translation (ga.po)Aindriú Mac Giolla Eoin2-0/+29762
- Added complete Irish translation (ga.po). - Added entry for Irish in po/TEAMS. - Corrected email format and removed trailing whitespace. - Translated new strings from Git 2.50.0-rc0 Signed-off-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>
2025-05-28Git 2.48.2v2.48.2Taylor Blau3-2/+10
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Git 2.47.3v2.47.3Taylor Blau3-2/+10
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Git 2.46.4v2.46.4Taylor Blau3-2/+9
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Git 2.45.4v2.45.4Taylor Blau3-2/+9
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Git 2.44.4v2.44.4Taylor Blau3-2/+9
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28Git 2.43.7v2.43.7Taylor Blau3-2/+75
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2025-05-28fast-export: --signed-commits is experimentalJunio C Hamano5-30/+16
As the design of signature handling is still being discussed, it is likely that the data stream produced by the code in Git 2.50 would have to be changed in such a way that is not backward compatible. Mark the feature as experimental and discourge its use for now. Also flip the default on the generation side to "strip"; users of existing versions would not have passed --signed-commits=strip and will be broken by this change if the default is made to abort, and will be encouraged by the error message to produce data stream with future breakage guarantees by passing --signed-commits option. As we tone down the default behaviour, we no longer need the FAST_EXPORT_SIGNED_COMMITS_NOABORT environment variable, which was not discoverable enough. Signed-off-by: Junio C Hamano <gitster@pobox.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-28Git 2.50-rc0v2.50.0-rc0Junio C Hamano2-1/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-28midx: stop repeatedly looking up nonexistent packfilesPatrick Steinhardt1-2/+10
The multi-pack index acts as a cache across a set of packfiles so that we can quickly look up which of those packfiles contains a given object. As such, the multi-pack index naturally needs to be updated every time one of the packfiles goes away, or otherwise the multi-pack index has grown stale. A stale multi-pack index should be handled gracefully by Git though, and in fact it is: if the indexed pack cannot be found we simply ignore it and eventually we fall back to doing the object lookup by just iterating through all packs, even if those aren't indexed. But while this fallback works, it has one significant downside: we don't cache the fact that a pack has vanished. This leads to us repeatedly trying to look up the same pack only to realize that it (still) doesn't exist. This issue can be easily demonstrated by creating a repository with a stale multi-pack index and a couple of objects. We do so by creating a repository with two packfiles, both of which are indexed by the multi-pack index, and then repack those two packfiles. Note that we have to move the multi-pack-index before doing the final repack, as Git knows to delete it otherwise. $ git init repo $ cd repo/ $ git config set maintenance.auto false $ for i in $(seq 1000); do printf "%d-original" $i >file-$i; done $ git add . $ git commit -moriginal $ git repack -dl $ for i in $(seq 1000); do printf "%d-modified" $i >file-$i; done $ git commit -a -mmodified $ git repack -dl $ git multi-pack-index write $ mv .git/objects/pack/multi-pack-index . $ git repack -Adl $ mv multi-pack-index .git/objects/pack/ Commands that cause a lot of objects lookups will now repeatedly invoke `add_packed_git()`, which leads to three failed access(3p) calls as well as one failed stat(3p) call. The following strace for example is done for `git log --patch` in the above repository: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 74.67 0.024693 1 18038 18031 access 25.33 0.008378 1 6045 6017 newfstatat ------ ----------- ----------- --------- --------- ---------------- 100.00 0.033071 1 24083 24048 total Fix the issue by introducing a negative lookup cache for indexed packs. This cache works by simply storing an invalid pointer for a missing pack when `prepare_midx_pack()` fails to look up the pack. Most users of the `packs` array don't need to be adjusted, either, as they all know to call `prepare_midx_pack()` before accessing the array. With this change in place we can now see a significantly reduced number of syscalls: % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 73.58 0.000323 5 60 28 newfstatat 26.42 0.000116 5 23 16 access ------ ----------- ----------- --------- --------- ---------------- 100.00 0.000439 5 83 44 total Furthermore, this change also results in a speedup: Benchmark 1: git log --patch (revision = HEAD~) Time (mean ± σ): 50.4 ms ± 2.5 ms [User: 22.0 ms, System: 24.4 ms] Range (min … max): 45.4 ms … 54.9 ms 53 runs Benchmark 2: git log --patch (revision = HEAD) Time (mean ± σ): 12.7 ms ± 0.4 ms [User: 11.1 ms, System: 1.6 ms] Range (min … max): 12.4 ms … 15.0 ms 191 runs Summary git log --patch (revision = HEAD) ran 3.96 ± 0.22 times faster than git log --patch (revision = HEAD~) In the end, it should in theory never be necessary to have this negative lookup cache given that we know to update the multi-pack index together with repacks. But as the change is quite contained and as the speedup can be significant as demonstrated above, it does feel sensible to have the negative lookup cache regardless. Based-on-patch-by: Jeff King <peff@peff.net> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-05-28packfile: explain ordering of how we look up auxiliary pack filesPatrick Steinhardt1-0/+11
When adding a packfile to an object database we perform four syscalls: - Three calls to access(3p) are done to check for auxiliary data structures. - One call to stat(3p) is done to check for the ".pack" itself. One curious bit is that we perform the access(3p) calls before checking for the packfile itself, but if the packfile doesn't exist we discard all results. The access(3p) calls are thus essentially wasted, so one may be triggered to reorder those calls so that we can short-circuit the other syscalls in case the packfile does not exist. The order in which we look up files is quite important though to help avoid races: - When installing a packfile we move auxiliary data structures into place before we install the ".idx" file. - When deleting a packfile we first delete the ".idx" and ".pack" files before deleting auxiliary data structures. As such, to avoid any races with concurrently created or deleted packs we need to make sure that we _first_ read auxiliary data structures before we read the corresponding ".idx" or ".pack" file. Otherwise it may easily happen that we return a populated but misclassified pack. Add a comment to `add_packed_git()` to make future readers aware of this ordering requirement. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>