]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 days agoMerge branch 'bc/stash-export-import' into next
Junio C Hamano [Tue, 24 Jun 2025 16:50:42 +0000 (09:50 -0700)] 
Merge branch 'bc/stash-export-import' into next

An interchange format for stash entries is defined, and subcommand
of "git stash" to import/export has been added.

* bc/stash-export-import:
  builtin/stash: provide a way to import stashes from a ref
  builtin/stash: provide a way to export stashes to a ref
  builtin/stash: factor out revision parsing into a function
  object-name: make get_oid quietly return an error

3 days agoMerge branch 'ag/imap-send-resurrection' into next
Junio C Hamano [Mon, 23 Jun 2025 16:49:01 +0000 (09:49 -0700)] 
Merge branch 'ag/imap-send-resurrection' into next

"git imap-send" has been broken for a long time, which has been
resurrected and then taught to talk OAuth2.0 etc.

* ag/imap-send-resurrection:
  imap-send: fix minor mistakes in the logs
  imap-send: display the destination mailbox when sending a message
  imap-send: display port alongwith host when git credential is invoked
  imap-send: add ability to list the available folders
  imap-send: enable specifying the folder using the command line
  imap-send: add PLAIN authentication method to OpenSSL
  imap-send: add support for OAuth2.0 authentication
  imap-send: gracefully fail if CRAM-MD5 authentication is requested without OpenSSL
  imap-send: fix memory leak in case auth_cram_md5 fails
  imap-send: fix bug causing cfg->folder being set to NULL

3 days agoMerge branch 'jc/cocci-avoid-regexp-constraint' into next
Junio C Hamano [Mon, 23 Jun 2025 16:49:00 +0000 (09:49 -0700)] 
Merge branch 'jc/cocci-avoid-regexp-constraint' into next

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

6 days agoMerge branch 'jg/mailinfo-leakfix' into next
Junio C Hamano [Fri, 20 Jun 2025 23:05:04 +0000 (16:05 -0700)] 
Merge branch 'jg/mailinfo-leakfix' into next

Leakfix.

* jg/mailinfo-leakfix:
  mailinfo.c: fix memory leak in function handle_content_type()

6 days agoMerge branch 'jc/diff-no-index-with-pathspec-fix' into next
Junio C Hamano [Fri, 20 Jun 2025 23:05:04 +0000 (16:05 -0700)] 
Merge branch 'jc/diff-no-index-with-pathspec-fix' into next

Recent code added a direct access to the d_type member in "struct
dirent", but some platforms lack it, which has been corrected.

* jc/diff-no-index-with-pathspec-fix:
  diff-no-index: do not reference .d_type member of struct dirent

6 days agococci: matching (multiple) identifiers
Junio C Hamano [Wed, 18 Jun 2025 17:55:02 +0000 (10:55 -0700)] 
cocci: matching (multiple) identifiers

"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>
6 days agoimap-send: fix minor mistakes in the logs
Aditya Garg [Fri, 20 Jun 2025 06:40:33 +0000 (12:10 +0530)] 
imap-send: fix minor mistakes in the logs

Some minor mistakes have been found in the logs. Most of them include
error messages starting with a capital letter, and ending with a period.
Abbreviations like "IMAP" and "OK" should also be in uppercase. Another
mistake was that the error message showing unknown authentication
mechanism used was displaying the host rather than the mechanism in the
logs. Fix them.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: display the destination mailbox when sending a message
Aditya Garg [Fri, 20 Jun 2025 06:40:32 +0000 (12:10 +0530)] 
imap-send: display the destination mailbox when sending a message

Whenever we sent a message using the `imap-send` command, it would
display a log showing the number of messages which are to be sent.
For example:

    sending 1 message
     100% (1/1) done

This had been made more informative by adding the name of the destination
folder as well:

    Sending 1 message to Drafts folder...
     100% (1/1) done

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: display port alongwith host when git credential is invoked
Aditya Garg [Fri, 20 Jun 2025 06:40:31 +0000 (12:10 +0530)] 
imap-send: display port alongwith host when git credential is invoked

When requesting for passsword, git credential helper used to display
only the host name. For example:

    Password for 'imaps://gargaditya08%40live.com@outlook.office365.com':

Now, it will display the port along with the host name:

    Password for 'imaps://gargaditya08%40live.com@outlook.office365.com:993':

This has been done to make credential helpers more specific for ports.
Also, this behaviour will also mimic git send-email, which displays
the port along with the host name when requesting for a password.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: add ability to list the available folders
Aditya Garg [Fri, 20 Jun 2025 06:40:30 +0000 (12:10 +0530)] 
imap-send: add ability to list the available folders

Various IMAP servers have different ways to name common folders.
For example, the folder where all deleted messages are stored is often
named "[Gmail]/Trash" on Gmail servers, and "Deleted" on Outlook.
Similarly, the Drafts folder is simply named "Drafts" on Outlook, but
on Gmail it is named "[Gmail]/Drafts".

This commit adds a `--list` command to the `imap-send` tool that lists
the available folders on the IMAP server, allowing users to see
which folders are available and how they are named. A sample output
looks like this when run against a Gmail server:

    Fetching the list of available folders...
    * LIST (\HasNoChildren) "/" "INBOX"
    * LIST (\HasChildren \Noselect) "/" "[Gmail]"
    * LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
    * LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
    * LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
    * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
    * LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
    * LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
    * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"

For OpenSSL, this is achived by running the 'IMAP LIST' command and
parsing the response. This command is specified in RFC6154:
https://datatracker.ietf.org/doc/html/rfc6154#section-5.1

For libcurl, the example code published in the libcurl documentation
is used to implement this functionality:
https://curl.se/libcurl/c/imap-list.html

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: enable specifying the folder using the command line
Aditya Garg [Fri, 20 Jun 2025 06:40:29 +0000 (12:10 +0530)] 
imap-send: enable specifying the folder using the command line

Some users may very often want to imap-send messages to a folder
other than the default set in the config. Add a command line
argument for the same.

While at it, fix minor mark-up inconsistencies in the existing
documentation text.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: add PLAIN authentication method to OpenSSL
Aditya Garg [Fri, 20 Jun 2025 06:40:28 +0000 (12:10 +0530)] 
imap-send: add PLAIN authentication method to OpenSSL

The current implementation for PLAIN in imap-send works just fine
if using curl, but if attempted to use for OpenSSL, it is treated
as an invalid mechanism. The default implementation for OpenSSL is
IMAP LOGIN command rather than AUTH PLAIN. Since AUTH PLAIN is
still used today by many email providers in form of app passwords,
lets add an implementation that can use AUTH PLAIN if specified.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: add support for OAuth2.0 authentication
Aditya Garg [Fri, 20 Jun 2025 06:40:27 +0000 (12:10 +0530)] 
imap-send: add support for OAuth2.0 authentication

OAuth2.0 is a new way of authentication supported by various email providers
these days. OAUTHBEARER and XOAUTH2 are the two most common mechanisms used
for OAuth2.0. OAUTHBEARER is described in RFC5801[1] and RFC7628[2], whereas
XOAUTH2 is Google's proprietary mechanism (See [3]).

[1]: https://datatracker.ietf.org/doc/html/rfc5801
[2]: https://datatracker.ietf.org/doc/html/rfc7628
[3]: https://developers.google.com/workspace/gmail/imap/xoauth2-protocol#initial_client_response

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: gracefully fail if CRAM-MD5 authentication is requested without OpenSSL
Aditya Garg [Fri, 20 Jun 2025 06:40:26 +0000 (12:10 +0530)] 
imap-send: gracefully fail if CRAM-MD5 authentication is requested without OpenSSL

Unlike PLAIN, XOAUTH2 and OAUTHBEARER, CRAM-MD5 authentication is not
supported by libcurl and requires OpenSSL. If the user tries to use
CRAM-MD5 authentication without OpenSSL, the previous behaviour was to
attempt to authenticate and fail with a die(error). Handle this in a
better way by first checking if OpenSSL is available and then attempting
to authenticate. If OpenSSL is not available, print an error message and
exit gracefully.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: fix memory leak in case auth_cram_md5 fails
Aditya Garg [Fri, 20 Jun 2025 06:40:25 +0000 (12:10 +0530)] 
imap-send: fix memory leak in case auth_cram_md5 fails

This patch fixes a memory leak by running free(response) in case
auth_cram_md5 fails.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoimap-send: fix bug causing cfg->folder being set to NULL
Aditya Garg [Fri, 20 Jun 2025 06:40:24 +0000 (12:10 +0530)] 
imap-send: fix bug causing cfg->folder being set to NULL

6d1f198f34 (imap-send: fix leaking memory in `imap_server_conf`, 2024-06-07)
resulted a change in static int git_imap_config which resulted in cfg->folder
being incorrectly set to NULL in case imap.user, imap.pass, imap.tunnel and
imap.authmethod were defined. Because of this, since Git 2.46.0,
git-imap-send is not usable at all. The bug seems to have been unnoticed for
a long time, likely due to better options like git-send-email.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'ly/run-builtin-use-passed-in-repo' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:46 +0000 (13:57 -0700)] 
Merge branch 'ly/run-builtin-use-passed-in-repo' into next

Code clean-up.

* ly/run-builtin-use-passed-in-repo:
  git.c: remove the_repository dependence in run_builtin()

8 days agoMerge branch 'rm/t2400-modernize' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:46 +0000 (13:57 -0700)] 
Merge branch 'rm/t2400-modernize' into next

Test clean-up.

* rm/t2400-modernize:
  t2400: replace 'test -[efd]' with 'test_path_is_*'

8 days agoMerge branch 'sa/multi-mailmap-fix' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:45 +0000 (13:57 -0700)] 
Merge branch 'sa/multi-mailmap-fix' into next

When asking to apply mailmap to both author and committer field
while showing a commit object, the field that appears later was not
correctly parsed and replaced, which has been corrected.

* sa/multi-mailmap-fix:
  cat-file: fix mailmap application for different author and committer

8 days agoMerge branch 'jc/cg-let-bss-do-its-job' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:45 +0000 (13:57 -0700)] 
Merge branch 'jc/cg-let-bss-do-its-job' into next

Clarify "do not explicitly initialize to zero" rule in the
CodingGuidelines document.

* jc/cg-let-bss-do-its-job:
  CodingGuidelines: let BSS do its job

8 days agoMerge branch 'ac/preload-index-wo-the-repository' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:45 +0000 (13:57 -0700)] 
Merge branch 'ac/preload-index-wo-the-repository' into next

Code clean-up.

* ac/preload-index-wo-the-repository:
  preload-index: stop depending on 'the_repository'
  environment: remove the global variable 'core_preload_index'

8 days agoMerge branch 'ly/prepare-show-merge-leakfix' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:44 +0000 (13:57 -0700)] 
Merge branch 'ly/prepare-show-merge-leakfix' into next

Leakfix.

* ly/prepare-show-merge-leakfix:
  revision: fix memory leak in prepare_show_merge()

8 days agoMerge branch 'kj/stash-onbranch-submodule-fix' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:44 +0000 (13:57 -0700)] 
Merge branch 'kj/stash-onbranch-submodule-fix' into next

"git stash" recorded a wrong branch name when submodules are
present in the current checkout, which has been corrected.

* kj/stash-onbranch-submodule-fix:
  stash: fix incorrect branch name in stash message

8 days agoMerge branch 'ag/send-email-edit-threading-fix' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:43 +0000 (13:57 -0700)] 
Merge branch 'ag/send-email-edit-threading-fix' into next

"git send-email" incremented its internal message counter when a
message was edited, which made logic that treats the first message
specially misbehave, which has been corrected.

* ag/send-email-edit-threading-fix:
  send-email: show the new message id assigned by outlook in the logs
  send-email: fix bug resulting in broken threads if a message is edited

8 days agoMerge branch 'pw/stash-p-pathspec-fixes' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:43 +0000 (13:57 -0700)] 
Merge branch 'pw/stash-p-pathspec-fixes' into next

"git stash -p <pathspec>" improvements.

* pw/stash-p-pathspec-fixes:
  stash: allow "git stash [<options>] --patch <pathspec>" to assume push
  stash: allow "git stash -p <pathspec>" to assume push again

8 days agoMerge branch 'pw/subtree-gpg-sign' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:42 +0000 (13:57 -0700)] 
Merge branch 'pw/subtree-gpg-sign' into next

"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

8 days agoMerge branch 'ps/maintenance-ref-lock' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:42 +0000 (13:57 -0700)] 
Merge branch 'ps/maintenance-ref-lock' into next

"git maintenance" lacked the care "git gc" had to avoid holding
onto the repository lock for too long during packing refs, which
has been remedied.

* ps/maintenance-ref-lock:
  builtin/maintenance: fix locking race when handling "gc" task
  builtin/gc: avoid global state in `gc_before_repack()`
  usage: allow dying without writing an error message
  builtin/maintenance: fix locking race with refs and reflogs tasks
  builtin/maintenance: split into foreground and background tasks
  builtin/maintenance: fix typedef for function pointers
  builtin/maintenance: extract function to run tasks
  builtin/maintenance: stop modifying global array of tasks
  builtin/maintenance: mark "--task=" and "--schedule=" as incompatible
  builtin/maintenance: centralize configuration of explicit tasks
  builtin/gc: drop redundant local variable
  builtin/gc: use designated field initializers for maintenance tasks

8 days agoMerge branch 'jc/you-still-use-whatchanged' into next
Junio C Hamano [Wed, 18 Jun 2025 20:57:41 +0000 (13:57 -0700)] 
Merge branch 'jc/you-still-use-whatchanged' into next

"git whatchanged" that is longer to type than "git log --raw"
which is its modern rough equivalent has outlived its usefulness
more than 10 years ago.  Plan to deprecate and remove it.

* jc/you-still-use-whatchanged:
  whatschanged: list it in BreakingChanges document
  whatchanged: remove when built with WITH_BREAKING_CHANGES
  whatchanged: require --i-still-use-this
  tests: prepare for a world without whatchanged
  doc: prepare for a world without whatchanged
  you-still-use-that??: help deprecating commands for removal

8 days agoThe second batch
Junio C Hamano [Wed, 18 Jun 2025 20:53:08 +0000 (13:53 -0700)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'rj/meson-tap-parse-fixup'
Junio C Hamano [Wed, 18 Jun 2025 20:53:36 +0000 (13:53 -0700)] 
Merge branch 'rj/meson-tap-parse-fixup'

An earlier test update incorrectly lost three prerequisites on
macOS, which has been corrected.

* rj/meson-tap-parse-fixup:
  test-lib: add missing prerequisites for Darwin

8 days agoMerge branch 'ly/submodule-update-failure-leakfix'
Junio C Hamano [Wed, 18 Jun 2025 20:53:36 +0000 (13:53 -0700)] 
Merge branch 'ly/submodule-update-failure-leakfix'

A memory leak on an error code path has been plugged.

* ly/submodule-update-failure-leakfix:
  builtin/submodule--helper: fix leak when remote_submodule_branch() failed

8 days agoMerge branch 'jm/bundle-uri-debug-output-to-fp'
Junio C Hamano [Wed, 18 Jun 2025 20:53:35 +0000 (13:53 -0700)] 
Merge branch 'jm/bundle-uri-debug-output-to-fp'

Code clean-up.

* jm/bundle-uri-debug-output-to-fp:
  bundle-uri: send debug output to given FILE * stream

8 days agoMerge branch 'bs/solaris-10-and-11'
Junio C Hamano [Wed, 18 Jun 2025 20:53:35 +0000 (13:53 -0700)] 
Merge branch 'bs/solaris-10-and-11'

Add settings for Solaris 10 & 11.

* bs/solaris-10-and-11:
  config.mak.uname: update settings for Solaris 10 and 11

8 days agoMerge branch 'jw/doc-txt-to-adoc-refs'
Junio C Hamano [Wed, 18 Jun 2025 20:53:34 +0000 (13:53 -0700)] 
Merge branch 'jw/doc-txt-to-adoc-refs'

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

8 days agoMerge branch 'ma/doc-diff-cc-headers'
Junio C Hamano [Wed, 18 Jun 2025 20:53:34 +0000 (13:53 -0700)] 
Merge branch 'ma/doc-diff-cc-headers'

Doc mark-up update.

* ma/doc-diff-cc-headers:
  diff-generate-patch.adoc: drop spurious backticks

8 days agoMerge branch 'ly/pack-bitmap-root-leakfix'
Junio C Hamano [Wed, 18 Jun 2025 20:53:34 +0000 (13:53 -0700)] 
Merge branch 'ly/pack-bitmap-root-leakfix'

Memleak fix on an error code path.

* ly/pack-bitmap-root-leakfix:
  pack-bitmap: remove checks before bitmap_free

8 days agoMerge branch 'ly/commit-buffer-reencode-leakfix'
Junio C Hamano [Wed, 18 Jun 2025 20:53:33 +0000 (13:53 -0700)] 
Merge branch 'ly/commit-buffer-reencode-leakfix'

Leakfix.

* ly/commit-buffer-reencode-leakfix:
  repo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode ()

8 days agoMerge branch 'cf/guideline-documenting-config-vars'
Junio C Hamano [Wed, 18 Jun 2025 20:53:33 +0000 (13:53 -0700)] 
Merge branch 'cf/guideline-documenting-config-vars'

CodingGuidelines update.

* cf/guideline-documenting-config-vars:
  CodingGuidelines: document formatting of similar config variables.

8 days agoCodingGuidelines: document formatting of similar config variables.
Collin Funk [Tue, 3 Jun 2025 22:45:39 +0000 (15:45 -0700)] 
CodingGuidelines: document formatting of similar config variables.

Document that related `git config` variables should be placed
one-per-line instead of separated by commas.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agodiff-no-index: do not reference .d_type member of struct dirent
Junio C Hamano [Wed, 18 Jun 2025 20:04:12 +0000 (13:04 -0700)] 
diff-no-index: do not reference .d_type member of struct dirent

Some platforms like AIX lack .d_type member in "struct dirent"; use
the DTYPE(e) macro instead of a direct reference to e->d_type and
when it yields DT_UNKNOWN, find the real type with get_dtype().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoStart 2.51 cycle, the first batch
Junio C Hamano [Tue, 17 Jun 2025 17:34:53 +0000 (10:34 -0700)] 
Start 2.51 cycle, the first batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoMerge branch 'ps/meson-tap-parse'
Junio C Hamano [Tue, 17 Jun 2025 17:44:42 +0000 (10:44 -0700)] 
Merge branch 'ps/meson-tap-parse'

Meson-based build/test framework now understands TAP output
generated by our tests.

* ps/meson-tap-parse:
  meson: parse TAP output generated by our tests
  meson: introduce kwargs variable for tests
  test-lib: fail on unexpectedly passing tests
  t7815: fix unexpectedly passing test on macOS
  t/test-lib: fix TAP format for BASH_XTRACEFD warning
  t/test-lib: don't print shell traces to stdout
  t983*: use prereq to check for Python-specific git-p4(1) support
  t9822: use prereq to check for ISO-8859-1 support
  t: silence output from `test_create_repo()`
  t: stop announcing prereqs

9 days agoMerge branch 'jk/diff-no-index-with-pathspec'
Junio C Hamano [Tue, 17 Jun 2025 17:44:41 +0000 (10:44 -0700)] 
Merge branch 'jk/diff-no-index-with-pathspec'

"git diff --no-index dirA dirB" can limit the comparison with
pathspec at the end of the command line, just like normal "git
diff".

* jk/diff-no-index-with-pathspec:
  diff --no-index: support limiting by pathspec
  pathspec: add flag to indicate operation without repository
  pathspec: add match_leading_pathspec variant

9 days agoMerge branch 'ly/fetch-pack-leakfix'
Junio C Hamano [Tue, 17 Jun 2025 17:44:41 +0000 (10:44 -0700)] 
Merge branch 'ly/fetch-pack-leakfix'

A memory-leak in an error code path has been plugged.

* ly/fetch-pack-leakfix:
  builtin/fetch-pack: cleanup before return error

9 days agoMerge branch 'ly/commit-graph-graph-write-leakfix'
Junio C Hamano [Tue, 17 Jun 2025 17:44:41 +0000 (10:44 -0700)] 
Merge branch 'ly/commit-graph-graph-write-leakfix'

A memory-leak in an error code path has been plugged.

* ly/commit-graph-graph-write-leakfix:
  commit-graph: fix start_delayed_progress() leak

9 days agoMerge branch 'ly/do-not-localize-bug-messages'
Junio C Hamano [Tue, 17 Jun 2025 17:44:40 +0000 (10:44 -0700)] 
Merge branch 'ly/do-not-localize-bug-messages'

Code clean-up.

* ly/do-not-localize-bug-messages:
  BUG(): remove leading underscore of the format string

9 days agoMerge branch 'ly/sequencer-update-squash-is-fixup-only'
Junio C Hamano [Tue, 17 Jun 2025 17:44:40 +0000 (10:44 -0700)] 
Merge branch 'ly/sequencer-update-squash-is-fixup-only'

Code clean-up.

* ly/sequencer-update-squash-is-fixup-only:
  sequencer: replace error() with BUG() in update_squash_messages ()

9 days agoMerge branch 'vd/cat-file-objectmode-update'
Junio C Hamano [Tue, 17 Jun 2025 17:44:39 +0000 (10:44 -0700)] 
Merge branch 'vd/cat-file-objectmode-update'

"git cat-file --batch" learns to understand %(objectmode) atom to
allow the caller to tell missing objects (due to repository
corruption) and submodules (whose commit objects are OK to be
missing) apart.

* vd/cat-file-objectmode-update:
  cat-file.c: add batch handling for submodules
  cat-file: add %(objectmode) atom
  t1006: update 'run_tests' to test generic object specifiers

9 days agoMerge branch 'ag/send-email-docs'
Junio C Hamano [Tue, 17 Jun 2025 17:44:39 +0000 (10:44 -0700)] 
Merge branch 'ag/send-email-docs'

Documentation for "git send-email" has been updated with a bit more
credential helper and OAuth information.

* ag/send-email-docs:
  docs: make the purpose of using app password for Gmail more clear in send-email
  docs: remove credential helper links for emails from gitcredentials
  docs: improve formatting in git-send-email documentation
  docs: add credential helper for yahoo and link Google's sendgmail tool

9 days agoMerge branch 'rc/userdiff-r'
Junio C Hamano [Tue, 17 Jun 2025 17:44:38 +0000 (10:44 -0700)] 
Merge branch 'rc/userdiff-r'

Userdiff patterns for the R language.

* rc/userdiff-r:
  userdiff: add support for R programming language

9 days agoMerge branch 'ds/path-walk-2'
Junio C Hamano [Tue, 17 Jun 2025 17:44:38 +0000 (10:44 -0700)] 
Merge branch 'ds/path-walk-2'

"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()

9 days agoMerge branch 'lo/my-first-ow-doc-update'
Junio C Hamano [Tue, 17 Jun 2025 17:44:37 +0000 (10:44 -0700)] 
Merge branch 'lo/my-first-ow-doc-update'

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

10 days agot2400: replace 'test -[efd]' with 'test_path_is_*'
Rodrigo Michelassi [Tue, 17 Jun 2025 00:29:39 +0000 (21:29 -0300)] 
t2400: replace 'test -[efd]' with 'test_path_is_*'

'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>
10 days agogit.c: remove the_repository dependence in run_builtin()
Lidong Yan [Mon, 16 Jun 2025 06:22:33 +0000 (14:22 +0800)] 
git.c: remove the_repository dependence in run_builtin()

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>
11 days agoGit 2.50 maint v2.50.0
Junio C Hamano [Mon, 16 Jun 2025 04:17:21 +0000 (21:17 -0700)] 
Git 2.50

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agomailinfo.c: fix memory leak in function handle_content_type()
Jinyao Guo [Fri, 13 Jun 2025 19:26:45 +0000 (19:26 +0000)] 
mailinfo.c: fix memory leak in function handle_content_type()

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>
13 days agoHopefully final bits before 2.50
Junio C Hamano [Fri, 13 Jun 2025 20:28:57 +0000 (13:28 -0700)] 
Hopefully final bits before 2.50

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoMerge branch 'js/github-ci-win-coverity-fix'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'js/github-ci-win-coverity-fix'

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

13 days agoMerge branch 'ss/revert-builtin-bswap-stuff'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'ss/revert-builtin-bswap-stuff'

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"

13 days agoMerge branch 'jc/sed-build-fixes'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'jc/sed-build-fixes'

Build fix.

* jc/sed-build-fixes:
  build: sed portability fixes

13 days agocat-file: fix mailmap application for different author and committer
Siddharth Asthana [Fri, 13 Jun 2025 11:57:17 +0000 (17:27 +0530)] 
cat-file: fix mailmap application for different author and committer

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>
2 weeks agoMerge tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po
Junio C Hamano [Fri, 13 Jun 2025 00:31:42 +0000 (17:31 -0700)] 
Merge tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po

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

2 weeks agoMerge branch 'kh/maintenance-missing-tasks-docfix'
Junio C Hamano [Thu, 12 Jun 2025 21:19:10 +0000 (14:19 -0700)] 
Merge branch 'kh/maintenance-missing-tasks-docfix'

Doc mark-up fix for a topic that has graduated to 'master'.

* kh/maintenance-missing-tasks-docfix:
  doc: maintenance: fix linkgit syntax

2 weeks agobuild: sed portability fixes
Junio C Hamano [Thu, 12 Jun 2025 17:04:58 +0000 (10:04 -0700)] 
build: sed portability fixes

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>
2 weeks agoMerge tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po
Junio C Hamano [Thu, 12 Jun 2025 20:35:08 +0000 (13:35 -0700)] 
Merge tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po

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)

2 weeks agobuiltin/stash: provide a way to import stashes from a ref
brian m. carlson [Thu, 12 Jun 2025 01:12:20 +0000 (01:12 +0000)] 
builtin/stash: provide a way to import stashes from a ref

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>
2 weeks agobuiltin/stash: provide a way to export stashes to a ref
brian m. carlson [Thu, 12 Jun 2025 01:12:19 +0000 (01:12 +0000)] 
builtin/stash: provide a way to export stashes to a ref

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>
2 weeks agobuiltin/stash: factor out revision parsing into a function
brian m. carlson [Thu, 12 Jun 2025 01:12:18 +0000 (01:12 +0000)] 
builtin/stash: factor out revision parsing into a function

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>
2 weeks agoobject-name: make get_oid quietly return an error
brian m. carlson [Thu, 12 Jun 2025 01:12:17 +0000 (01:12 +0000)] 
object-name: make get_oid quietly return an error

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>
2 weeks agoRevert "bswap.h: add support for built-in bswap functions"
Sebastian Andrzej Siewior [Wed, 11 Jun 2025 22:14:37 +0000 (00:14 +0200)] 
Revert "bswap.h: add support for built-in bswap functions"

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>
2 weeks agol10n: zh_TW: update translation for Git 2.50
Yi-Jyun Pan [Thu, 12 Jun 2025 14:25:39 +0000 (22:25 +0800)] 
l10n: zh_TW: update translation for Git 2.50

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2 weeks agol10n: zh_CN: updated translation for 2.50
Teng Long [Wed, 11 Jun 2025 14:04:19 +0000 (22:04 +0800)] 
l10n: zh_CN: updated translation for 2.50

Helped-by: 依云 <lilydjwg@gmail.com>
Helped-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
2 weeks agoMerge branch '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n
Jiang Xin [Thu, 12 Jun 2025 01:53:04 +0000 (09:53 +0800)] 
Merge branch '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n

* '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n:
  l10n: uk: add 2.50 translation

2 weeks agoMerge branch 'l10n-de-2.50' of https://github.com/ralfth/git
Jiang Xin [Thu, 12 Jun 2025 01:49:37 +0000 (09:49 +0800)] 
Merge branch 'l10n-de-2.50' of https://github.com/ralfth/git

* 'l10n-de-2.50' of https://github.com/ralfth/git:
  l10n: Update German translation

2 weeks agoCodingGuidelines: let BSS do its job
Junio C Hamano [Wed, 11 Jun 2025 21:16:58 +0000 (14:16 -0700)] 
CodingGuidelines: let BSS do its job

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>
2 weeks agoRelNotes/2.50.0: fix typos & other improvements
Kristoffer Haugsbakk [Wed, 11 Jun 2025 17:35:24 +0000 (19:35 +0200)] 
RelNotes/2.50.0: fix typos & other improvements

• 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>
2 weeks agoci(coverity): output the build log upon error
Johannes Schindelin [Wed, 11 Jun 2025 15:54:38 +0000 (15:54 +0000)] 
ci(coverity): output the build log upon error

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>
2 weeks agoci(coverity): fix building on Windows
Johannes Schindelin [Wed, 11 Jun 2025 15:54:37 +0000 (15:54 +0000)] 
ci(coverity): fix building on Windows

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>
2 weeks agostash: fix incorrect branch name in stash message
K Jayatheerth [Wed, 11 Jun 2025 01:42:03 +0000 (07:12 +0530)] 
stash: fix incorrect branch name in stash message

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>
2 weeks agol10n: Update German translation
Ralf Thielow [Sat, 31 May 2025 12:40:17 +0000 (14:40 +0200)] 
l10n: Update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 weeks agol10n: uk: add 2.50 translation
Arkadii Yakovets [Wed, 11 Jun 2025 01:23:00 +0000 (18:23 -0700)] 
l10n: uk: add 2.50 translation

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>
2 weeks agopreload-index: stop depending on 'the_repository'
Ayush Chandekar [Tue, 10 Jun 2025 13:02:21 +0000 (18:32 +0530)] 
preload-index: stop depending on 'the_repository'

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>
2 weeks agoenvironment: remove the global variable 'core_preload_index'
Ayush Chandekar [Tue, 10 Jun 2025 13:02:20 +0000 (18:32 +0530)] 
environment: remove the global variable 'core_preload_index'

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>
2 weeks agorevision: fix memory leak in prepare_show_merge()
Lidong Yan [Tue, 10 Jun 2025 00:37:59 +0000 (00:37 +0000)] 
revision: fix memory leak in prepare_show_merge()

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>
2 weeks agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Mon, 9 Jun 2025 23:43:17 +0000 (07:43 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.50

2 weeks agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Mon, 9 Jun 2025 23:42:34 +0000 (07:42 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5819t)

2 weeks agoMerge branch 'l10n_fr_v2.50' of github.com:jnavila/git
Jiang Xin [Mon, 9 Jun 2025 23:41:22 +0000 (07:41 +0800)] 
Merge branch 'l10n_fr_v2.50' of github.com:jnavila/git

* 'l10n_fr_v2.50' of github.com:jnavila/git:
  l10n: fr: v2.50 round 1

2 weeks agoMerge branch 'tr-l10n' of github.com:bitigchi/git-po
Jiang Xin [Mon, 9 Jun 2025 23:39:49 +0000 (07:39 +0800)] 
Merge branch 'tr-l10n' of github.com:bitigchi/git-po

* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations for 2.50

2 weeks agoMerge branch 'master' of github.com:aindriu80/git-po
Jiang Xin [Mon, 9 Jun 2025 23:37:22 +0000 (07:37 +0800)] 
Merge branch 'master' of github.com:aindriu80/git-po

* 'master' of github.com:aindriu80/git-po:
  l10n: Add full Irish translation (ga.po)

2 weeks agodoc: maintenance: fix linkgit syntax
Kristoffer Haugsbakk [Mon, 9 Jun 2025 15:59:42 +0000 (17:59 +0200)] 
doc: maintenance: fix linkgit syntax

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agotest-lib: add missing prerequisites for Darwin
Ramsay Jones [Mon, 9 Jun 2025 17:13:38 +0000 (18:13 +0100)] 
test-lib: add missing prerequisites for Darwin

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>
2 weeks agopack-bitmap: remove checks before bitmap_free
Lidong Yan [Mon, 9 Jun 2025 08:18:44 +0000 (08:18 +0000)] 
pack-bitmap: remove checks before bitmap_free

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>
2 weeks agoGit 2.50-rc2 v2.50.0-rc2
Junio C Hamano [Mon, 9 Jun 2025 14:17:31 +0000 (07:17 -0700)] 
Git 2.50-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'mm/test-in-absolute-home'
Junio C Hamano [Mon, 9 Jun 2025 14:15:50 +0000 (07:15 -0700)] 
Merge branch 'mm/test-in-absolute-home'

Tests that compare $HOME and $(pwd), which should be the same
directory unless the tests chdir's around, would fail when the user
enters the test directory via symbolic links, which has been
corrected.

* mm/test-in-absolute-home:
  t: run tests from a normalized working directory

2 weeks agobuiltin/submodule--helper: fix leak when remote_submodule_branch() failed
Lidong Yan [Sun, 8 Jun 2025 03:56:59 +0000 (03:56 +0000)] 
builtin/submodule--helper: fix leak when remote_submodule_branch() failed

In builtin/submodule--helper.c:update_submodule(), the variable
remote_name is allocated in get_default_remote_submodule() but
may be leaked if remote_submodule_branch() fails. Although it is
unlikely that remote_submodule_branch() would fail after successfully
obtaining a remote ref name from get_default_remote_submodule(),
it is still possible. To prevent a potential memory leak, add a
call to free(remote_name) at the early exit point.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoconfig.mak.uname: update settings for Solaris 10 and 11
Brad Smith [Sun, 8 Jun 2025 01:26:52 +0000 (21:26 -0400)] 
config.mak.uname: update settings for Solaris 10 and 11

Solaris 10 and newer has strtoumax().

Solaris 11 and newer has mkdtemp(), memmem(), and strcasestr().

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>
2 weeks agoA bit more before -rc2
Junio C Hamano [Sat, 7 Jun 2025 17:46:34 +0000 (10:46 -0700)] 
A bit more before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'js/curl-easy-setopt-typefix'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'js/curl-easy-setopt-typefix'

Adjust to newer version of libcURL.

* js/curl-easy-setopt-typefix:
  curl: pass `long` values where expected

2 weeks agoMerge branch 'jk/curl-easy-setopt-typefix'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'jk/curl-easy-setopt-typefix'

Adjust to newer version of libcURL.

* jk/curl-easy-setopt-typefix:
  curl: fix symbolic constant typechecks with curl_easy_setopt()
  curl: fix integer variable typechecks with curl_easy_setopt()
  curl: fix integer constant typechecks with curl_easy_setopt()

2 weeks agoMerge branch 'bs/bsd-wo-specific-xopen-source'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'bs/bsd-wo-specific-xopen-source'

Build fix for BSDs.

* bs/bsd-wo-specific-xopen-source:
  compat: fixes for header handling with OpenBSD / NetBSD