summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-06-17Merge branch 'ds/path-walk-2'Junio C Hamano27-66/+620
"git pack-objects" learns to find delta bases from blobs at the same path, using the --path-walk API. * ds/path-walk-2: pack-objects: allow --shallow and --path-walk path-walk: add new 'edge_aggressive' option pack-objects: thread the path-based compression pack-objects: refactor path-walk delta phase scalar: enable path-walk during push via config pack-objects: enable --path-walk via config repack: add --path-walk option t5538: add tests to confirm deltas in shallow pushes pack-objects: introduce GIT_TEST_PACK_PATH_WALK p5313: add performance tests for --path-walk pack-objects: update usage to match docs pack-objects: add --path-walk option pack-objects: extract should_attempt_deltas()
2025-06-17Merge branch 'lo/my-first-ow-doc-update'Junio C Hamano1-11/+24
Doc update to the more recent world order. * lo/my-first-ow-doc-update: MyFirstContribution: add walken.c to meson.build MyFirstContribution: use struct repository in examples
2025-06-16t2400: replace 'test -[efd]' with 'test_path_is_*'Rodrigo Michelassi1-10/+10
'test_path_is_file', 'test_path_is_dir' and 'test_file_is_missing' are test helpers used in Git's development, that emit useful diagnostic information when they detect a failing condition, while test -[efd] does not. Replace the basic shell commands 'test -f', 'test -d' and 'test -e', with these test helpers. Co-authored-by: Isabella Caselli <icaselli@usp.br> Signed-off-by: Isabella Caselli <icaselli@usp.br> Signed-off-by: Rodrigo Michelassi <rodmichelassi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-16git.c: remove the_repository dependence in run_builtin()Lidong Yan1-2/+2
run_builtin() takes a repo parameter, so the use of the_repository is no longer necessary. Removed the usage of the_repository. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-15Git 2.50.1v2.50.1Junio C Hamano3-2/+10
2025-06-15Sync with 2.49.1Junio C Hamano34-449/+749
2025-06-15Git 2.50v2.50.0Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-14mailinfo.c: fix memory leak in function handle_content_type()Jinyao Guo1-0/+2
The function handle_content_type allocates memory for boundary using xmalloc(sizeof(struct strbuf)). If (++mi->content_top >= &mi->content[MAX_BOUNDARIES]) is true, the function returns without freeing boundary. Signed-off-by: Jinyao Guo <guo846@purdue.edu> 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-13Merge branch 'js/github-ci-win-coverity-fix'Junio C Hamano1-2/+6
Fixes for GitHub Actions Coverity job. * js/github-ci-win-coverity-fix: ci(coverity): output the build log upon error ci(coverity): fix building on Windows
2025-06-13Merge branch 'ss/revert-builtin-bswap-stuff'Junio C Hamano1-13/+1
Revert a botched bswap.h change that broke ntohll() functions on big-endian systems with __builtin_bswap32/64(). * ss/revert-builtin-bswap-stuff: Revert "bswap.h: add support for built-in bswap functions"
2025-06-13Merge branch 'jc/sed-build-fixes'Junio C Hamano2-5/+5
Build fix. * jc/sed-build-fixes: build: sed portability fixes
2025-06-13merge/pull: extend merge.stat configuration variable to cover --compact-summaryJunio C Hamano3-4/+87
Existing `merge.stat` configuration variable is a Boolean that defaults to `true` to control `git merge --[no-]stat` behaviour. Extend it to be "Boolean or text", that takes false, true, or "compact", with the last one triggering the --compact-summary option introduced earlier. Any other values are taken as the same as true, instead of signaling an error---it is not a grave enough offence to stop their merge. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-13merge/pull: add the "--compact-summary" optionJunio C Hamano5-6/+69
"git merge" and "git pull" shows "git diff --stat --summary @{1}" when they finish to indicate the extent of the changes brought into the history by default. While it gives a good overview, it becomes annoying when there are very many created or deleted paths. Introduce "--compact-summary" option to these two commands that tells it to instead show "git diff --compact-summary @{1}", which gives the same information in a lot more compact form in such a situation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-13cat-file: fix mailmap application for different author and committerSiddharth Asthana2-0/+37
The git cat-file command with --mailmap option fails to apply mailmap transformations to the committer field when the author and committer identities are different. This occurs due to a missing newline handling in apply_mailmap_to_header() after processing each identity line. When rewrite_ident_line() processes an identity, it stops at the end of the identity data (e.g., "Author Name <email> timestamp"), but doesn't account for the trailing newline. The current code adds the identity length to buf_offset but fails to advance past the newline character. This causes the next iteration to start parsing from the newline instead of the beginning of the next header line, making it impossible to match subsequent headers like "committer". Additionally, rewrite_ident_line() may reallocate the buffer during its operation. Any code using pointers into the old buffer would be using invalid memory after such a reallocation. This bug was introduced in e9c1b0e3 (revision: improve commit_rewrite_person(), 2022-07-19) when the much simpler version of commit_rewrite_person() that worked on one "person header" at a time was rewritten to use the current apply_mailmap_to_header() function. The original implementation processed author and committer separately, but the rewrite introduced this loop-based approach that failed to properly handle the transition between identity lines. Let's fix this by addressing both issues: 1. After processing an identity line, we now check if we're at a newline and advance past it, ensuring the next header line is parsed correctly. 2. We recompute the buffer position after rewrite_ident_line() to handle potential buffer reallocation. This ensures that all identity headers in commit and tag objects are consistently processed regardless of whether the author and committer are the same person. Reported-by: Vasilii Iakliushin <viakliushin@gitlab.com> Reviewed-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com> 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-12Merge tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-poJunio C Hamano1-516/+643
l10n-2.50.0-v2 * tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po: l10n: zh_TW: update translation for Git 2.50
2025-06-12Sync with 2.48.2Junio C Hamano33-449/+737
* 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-12Merge branch 'kh/maintenance-missing-tasks-docfix'Junio C Hamano1-1/+1
Doc mark-up fix for a topic that has graduated to 'master'. * kh/maintenance-missing-tasks-docfix: doc: maintenance: fix linkgit syntax
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-12Merge tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-poJunio C Hamano9-3311/+32401
l10n-2.50.0-rnd1 * tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po: l10n: zh_CN: updated translation for 2.50 l10n: Update German translation l10n: uk: add 2.50 translation l10n: po-id for 2.50 l10n: bg.po: Updated Bulgarian translation (5819t) l10n: tr: Update Turkish translations for 2.50 l10n: fr: v2.50 round 1 l10n: Add full Irish translation (ga.po)
2025-06-12builtin/stash: provide a way to import stashes from a refbrian m. carlson3-0/+275
Now that we have a way to export stashes to a ref, let's provide a way to import them from such a ref back to the stash. This works much the way the export code does, except that we strip off the first parent chain commit and then store each resulting commit back to the stash. We don't clear the stash first and instead add the specified stashes to the top of the stash. This is because users may want to export just a few stashes, such as to share a small amount of work in progress with a colleague, and it would be undesirable for the receiving user to lose all of their data. For users who do want to replace the stash, it's easy to do to: simply run "git stash clear" first. We specifically rely on the fact that we'll produce identical stash commits on both sides in our tests. This provides a cheap, straightforward check for our tests and also makes it easy for users to see if they already have the same data in both repositories. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12builtin/stash: provide a way to export stashes to a refbrian m. carlson2-1/+281
A common user problem is how to sync in-progress work to another machine. Users currently must use some sort of transfer of the working tree, which poses security risks and also necessarily causes the index to become dirty. The experience is suboptimal and frustrating for users. A reasonable idea is to use the stash for this purpose, but the stash is stored in the reflog, not in a ref, and as such it cannot be pushed or pulled. This also means that it cannot be saved into a bundle or preserved elsewhere, which is a problem when using throwaway development environments. In addition, users often want to replicate stashes across machines, such as when they must use multiple machines or when they use throwaway dev environments, such as those based on the Devcontainer spec, where they might otherwise lose various in-progress work. Let's solve this problem by allowing the user to export the stash to a ref (or, to just write it into the repository and print the hash, à la git commit-tree). Introduce git stash export, which writes a chain of commits where the first parent is always a chain to the previous stash, or to a single, empty commit (for the final item) and the second is the stash commit normally written to the reflog. Iterate over each stash from top to bottom, looking up the data for each one, and then create the chain from the single empty commit back up in reverse order. Generate a predictable empty commit so our behavior is reproducible. Create a useful commit message, preserving the author and committer information, to help users identify stash commits when viewing them as normal commits. If the user has specified specific stashes they'd like to export instead, use those instead of iterating over all of the stashes. As part of this, specifically request quiet behavior when looking up the OID for a revision because we will eventually hit a revision that doesn't exist and we don't want to die when that occurs. When exporting stashes, be sure to verify that they look like valid stashes and don't contain invalid data. This will help avoid failures on import or problems due to attempting to export invalid refs that are not stashes. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12builtin/stash: factor out revision parsing into a functionbrian m. carlson1-11/+22
We allow several special forms of stash names in this code. In the future, we'll want to allow these same forms without parsing a stash commit, so let's refactor this code out into a function for reuse. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12object-name: make get_oid quietly return an errorbrian m. carlson2-1/+6
A reasonable person looking at the signature and usage of get_oid and friends might conclude that in the event of an error, it always returns -1. However, this is not the case. Instead, get_oid_basic dies if we go too far back into the history of a reflog (or, when quiet, simply exits). This is not especially useful, since in many cases, we might want to handle this error differently. Let's add a flag here to make it just return -1 like elsewhere in these code paths. Note that we cannot make this behavior the default, since we have many other codepaths that rely on the existing behavior, including in tests. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-12Merge branch 'ss/revert-builtin-bswap-stuff' into ss/compat-bswap-revampJunio C Hamano1-13/+1
* ss/revert-builtin-bswap-stuff: Revert "bswap.h: add support for built-in bswap functions"
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-12Merge branch '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10nJiang Xin1-387/+262
* '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n: l10n: uk: add 2.50 translation
2025-06-12Merge branch 'l10n-de-2.50' of https://github.com/ralfth/gitJiang Xin1-408/+277
* 'l10n-de-2.50' of https://github.com/ralfth/git: l10n: Update German translation
2025-06-11CodingGuidelines: let BSS do its jobJunio C Hamano1-0/+3
We have mentioned this in various reviews, but I didn't see it mentioned in the CodingGuildelines document. Let's add it. Signed-off-by: Junio C Hamano <gitster@pobox.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-11stash: fix incorrect branch name in stash messageK Jayatheerth2-2/+40
When creating a stash, Git uses the current branch name of the superproject to construct the stash commit message. However, in repositories with submodules, the message may mistakenly display the submodule branch name instead. This is because `refs_resolve_ref_unsafe()` returns a pointer to a static buffer. Subsequent calls to the same function overwrite the buffer, corrupting the originally fetched `branch_name` used for the stash message. Use `xstrdup()` to duplicate the branch name immediately after resolving it, so that later buffer overwrites do not affect the stash message. Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com> 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-10preload-index: stop depending on 'the_repository'Ayush Chandekar1-3/+2
Refactor "preload-index.c" to remove the dependency on the global 'the_repository'. Replace the occurrences of 'the_repository' with 'index->repo' and thus remove the definition '#define USE_THE_REPOSITORY_VARIABLE'. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Ayush Chandekar <ayu.chandekar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-10environment: remove the global variable 'core_preload_index'Ayush Chandekar4-9/+4
The global variable 'core_preload_index' is used in a single function named 'preload_index()' in "preload-index.c". Move its declaration inside that function, removing unnecessary global state. This change is part of an ongoing effort to eliminate global variables, improve modularity and help libify the codebase. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Ayush Chandekar <ayu.chandekar@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-09revision: fix memory leak in prepare_show_merge()Lidong Yan2-0/+25
In revision.c:prepare_show_merge(), we allocated an array in prune but forget to free it. Since parse_pathspec is not responsible to free prune, we should add `free(prune)` in the end of prepare_show_merge(). Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-10Merge branch 'po-id' of github.com:bagasme/git-poJiang Xin1-493/+344
* 'po-id' of github.com:bagasme/git-po: l10n: po-id for 2.50
2025-06-10Merge branch 'master' of github.com:alshopov/git-poJiang Xin1-728/+586
* 'master' of github.com:alshopov/git-po: l10n: bg.po: Updated Bulgarian translation (5819t)
2025-06-10Merge branch 'l10n_fr_v2.50' of github.com:jnavila/gitJiang Xin1-385/+531
* 'l10n_fr_v2.50' of github.com:jnavila/git: l10n: fr: v2.50 round 1
2025-06-10Merge branch 'tr-l10n' of github.com:bitigchi/git-poJiang Xin1-429/+295
* 'tr-l10n' of github.com:bitigchi/git-po: l10n: tr: Update Turkish translations for 2.50
2025-06-10Merge branch 'master' of github.com:aindriu80/git-poJiang Xin2-0/+29762
* 'master' of github.com:aindriu80/git-po: l10n: Add full Irish translation (ga.po)
2025-06-09rebase: write script before initializing stateØystein Walle2-21/+31
If rebase.instructionFormat is invalid the repository is left in a strange state when the interactive rebase fails. `git status` outputs boths the same as it would in the normal case *and* something related to interactive rebase: $ git -c rebase.instructionFormat=blah rebase -i fatal: invalid --pretty format: blah $ git status On branch master Your branch is ahead of 'upstream/master' by 1 commit. (use "git push" to publish your local commits) git-rebase-todo is missing. No commands done. No commands remaining. You are currently editing a commit while rebasing branch 'master' on '8db3019401'. (use "git commit --amend" to amend the current commit) (use "git rebase --continue" once you are satisfied with your changes) By attempting to write the rebase script before initializing the state this potential scenario is avoided. Signed-off-by: Junio C Hamano <gitster@pobox.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-09test-lib: add missing prerequisites for DarwinRamsay Jones1-0/+3
commit d3d8c601fd ("t7815: fix unexpectedly passing test on macOS", 2025-06-02) added a MACOS prerequisite by adding a 'Darwin' case label to the 'OS-specific' case statement. However, this commit forgot to set several prerequisites which appear in the 'default' case label, in addition to the new MACOS prerequisite. This causes several tests, which macOS should pass, being skipped. In order to run all applicable tests on macOS, add the missing prerequisites to the 'Darwin' case. Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-09pack-bitmap: remove checks before bitmap_freeLidong Yan2-2/+19
In pack-bitmap.c:find_boundary_objects(), the roots_bitmap is only freed if cascade_pseudo_merges_1() fails. However, cascade_pseudo_merges_1() uses roots_bitmap as a mutable reference without taking ownership of it. As a result, if cascade_pseudo_merges_1() succeeds, roots_bitmap is leaked. And this leak currently lacks a dedicated test to detect it. To fix this leak, remove if cascade_pseudo_merges_1() succeed check and always calling bitmap_free(roots_bitmap); To trigger this leak, we need roots_bitmap that contains at least one pseudo merge. So that we can use pseudo merge bitmap when we compute roots reachable bitmap. Here we create two commits: first A then B. Add A to the pseudo-merge and perform a traversal over the range A..B. In this scenario, the "haves" set will be {A}, and cascade_pseudo_merges_1 will succeed, thereby exposing the leak due to the missing roots_bitmap cleanup. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>