Commit Graph

77517 Commits (next)

Author SHA1 Message Date
Junio C Hamano b4a081e467 Sync with 'master' 2025-07-02 12:09:39 -07:00
Junio C Hamano def60da09b Merge branch 'cb/ci-freebsd-update-to-14.3' into next
CI updates.

* cb/ci-freebsd-update-to-14.3:
  ci: update FreeBSD image to 14.3
2025-07-02 12:09:27 -07:00
Junio C Hamano a83386e565 Merge branch 'jj/doc-branch-markup-fix' into next
Doc markup fix.

* jj/doc-branch-markup-fix:
  doc: improve formatting in branch section
2025-07-02 12:09:27 -07:00
Junio C Hamano 8ad80bb873 Merge branch 'cb/daemon-retry-interrupted-accept' into next
When "git daemon" sees a signal while attempting to accept() a new
client, instead of retrying, it skipped it by mistake, which has
been corrected.

* cb/daemon-retry-interrupted-accept:
  daemon: correctly handle soft accept() errors in service_loop
2025-07-02 12:09:26 -07:00
Junio C Hamano 666bd0f1ca Merge branch 'jk/fix-leak-send-pack' into next
Leakfix.

* jk/fix-leak-send-pack:
  send-pack: clean-up even when taking an early exit
  send-pack: clean up extra_have oid array
2025-07-02 12:09:26 -07:00
Junio C Hamano db06df3871 Merge branch 'kn/fetch-push-bulk-ref-update' into next
"git push" and "git fetch" are taught to update refs in batches to
gain performance.

* kn/fetch-push-bulk-ref-update:
  receive-pack: handle reference deletions separately
  refs/files: skip updates with errors in batched updates
  receive-pack: use batched reference updates
  send-pack: fix memory leak around duplicate refs
  fetch: use batched reference updates
  refs: add function to translate errors to strings
2025-07-02 12:09:26 -07:00
Junio C Hamano 8b6f19ccfc The sixth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-02 12:08:05 -07:00
Junio C Hamano 41d0310a83 Merge branch 'jt/imap-send-message-fix'
Update some error messages from "git imap-send".

* jt/imap-send-message-fix:
  imap-send: improve error messages with configuration hints
  imap-send: fix confusing 'store' terminology in error message
2025-07-02 12:08:05 -07:00
Junio C Hamano 94c9350a67 Merge branch 'ps/contrib-sweep'
Remove bunch of stuff from contrib/ hierarchy.

* ps/contrib-sweep:
  contrib: remove some scripts in "stats" directory
  contrib: remove "git-new-workdir"
  contrib: remove "emacs" directory
  contrib: remove "git-resurrect.sh"
  contrib: remove "persistent-https" remote helper
  contrib: remove "mw-to-git"
  contrib: remove "hooks" directory
  contrib: remove "thunderbird-patch-inline"
  contrib: remove remote-helper stubs
  contrib: remove "examples" directory
  contrib: remove "remotes2config.sh"
2025-07-02 12:08:05 -07:00
Junio C Hamano e6c30289c6 Merge branch 'ag/imap-send-resurrection'
"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
2025-07-02 12:08:05 -07:00
Junio C Hamano b0e9d25865 send-pack: clean-up even when taking an early exit
Previous commit has plugged one leak in the normal code path, but
there is an early exit that leaves without releasing any resources
acquired in the function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01 14:17:25 -07:00
Carlo Marcelo Arenas Belón 1e77de1864 ci: update FreeBSD image to 14.3
FreeBSD 13.4 is no longer supported, and 13.5 will be the last
release from that series, so jump instead to 14.3 which should
be supported for another 10 months and will be at that point
the oldest supported release with the interim release of 15.

While at it, move some variables to the environment and make
sure to skip a git grep test that assumes glibc regex.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-01 07:46:22 -07:00
Junio C Hamano 83e99ddf40 Sync with 'master' 2025-06-30 14:38:08 -07:00
Junio C Hamano 7a88e3eff9 Merge branch 'cb/daemon-fd-check-fix' into next
Remove unnecessary check from "git daemon" code.

* cb/daemon-fd-check-fix:
  daemon: remove unnecesary restriction for listener fd
2025-06-30 14:37:59 -07:00
Junio C Hamano 83014dc05f The fifth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30 14:30:31 -07:00
Junio C Hamano e3aa0eafbd Merge branch 'jk/test-seq-format'
A test helper "test_seq" function learned the "-f <fmt>" option,
which allowed us to simplify a lot of test scripts.

* jk/test-seq-format:
  test-lib: teach test_seq the -f option
  t7422: replace confusing printf with echo
2025-06-30 14:30:31 -07:00
Junio C Hamano d2e49d2b76 Merge branch 'jc/merge-compact-summary'
"git merge/pull" has been taught the "--compact-summary" option to
use the compact-summary format, intead of diffstat, when showing
the summary of the incoming changes.

* jc/merge-compact-summary:
  merge/pull: extend merge.stat configuration variable to cover --compact-summary
  merge/pull: add the "--compact-summary" option
2025-06-30 14:30:31 -07:00
Junio C Hamano 91f10d7ca2 Merge branch 'bc/stash-export-import'
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
2025-06-30 14:30:31 -07:00
Junio C Hamano a013680162 Merge branch 'jc/cocci-avoid-regexp-constraint'
Avoid regexp_constraint and instead use comparison_constraint when
listing functions to exclude from application of coccinelle rules,
as spatch can be built with different regexp engine X-<.

* jc/cocci-avoid-regexp-constraint:
  cocci: matching (multiple) identifiers
2025-06-30 14:30:30 -07:00
Jakub Ječmínek 996f14c02b doc: improve formatting in branch section
The 'branch' section of the git-config documentation was missing
inline code formatting and emphasis for the <name> placeholder.

Both changes improve readability, especially when viewed online.

Signed-off-by: Jakub Ječmínek <kuba@kubajecminek.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30 11:11:36 -07:00
Carlo Marcelo Arenas Belón 78b6601ca3 daemon: correctly handle soft accept() errors in service_loop
Since df076bdbcc ([PATCH] GIT: Listen on IPv6 as well, if available.,
2005-07-23), the original error checking was included in an inner loop
unchanged, where its effect was different.

Instead of retrying, after a EINTR during accept() in the listening
socket, it will advance to the next one and try with that instead,
leaving the client waiting for another round.

Make sure to retry with the same listener socket that failed originally.

To avoid an unlikely busy loop, fallback to the old behaviour after a
couple of attempts.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-30 08:31:06 -07:00
Jacob Keller d1c44861f9 send-pack: clean up extra_have oid array
Commit c800963578 ("fetch-pack, send-pack: clean up shallow oid
array", 2024-09-25) cleaned up the shallow oid array in cmd_send_pack,
but didn't clean up extra_have, which is still leaked at program exit.
I suspect the particular tests in t5539 don't trigger any additions to
the extra_have array, which explains why the tests can pass leak free
despite this gap.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-27 15:17:57 -07:00
Carlo Marcelo Arenas Belón 0c856224d2 daemon: remove unnecesary restriction for listener fd
Since df076bdbcc ([PATCH] GIT: Listen on IPv6 as well, if available.,
2005-07-23), any file descriptor assigned to a listening socket was
validated to be within the range to be used in an FDSET later.

6573faff34 (NO_IPV6 support for git daemon, 2005-09-28), moves to
use poll() instead of select(), that doesn't have that restriction,
so remove the original check.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Acked-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-26 08:35:08 -07:00
Junio C Hamano 74e6fc65d0 Sync with 'master' 2025-06-25 14:13:57 -07:00
Junio C Hamano cf6f63ea6b The fourth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-25 14:07:37 -07:00
Junio C Hamano d5ee0e2961 Merge branch 'jg/mailinfo-leakfix'
Leakfix.

* jg/mailinfo-leakfix:
  mailinfo.c: fix memory leak in function handle_content_type()
2025-06-25 14:07:37 -07:00
Junio C Hamano 567dc419b2 Merge branch 'jc/diff-no-index-with-pathspec-fix'
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
2025-06-25 14:07:36 -07:00
Junio C Hamano 4c9a5d7729 Merge branch 'ps/maintenance-ref-lock'
"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
2025-06-25 14:07:36 -07:00
Junio C Hamano a5cc6a2bc5 Merge branch 'jc/you-still-use-whatchanged'
"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
2025-06-25 14:07:35 -07:00
Karthik Nayak 5c697f0b7d receive-pack: handle reference deletions separately
In 9d2962a7c4 (receive-pack: use batched reference updates, 2025-05-19)
we updated the 'git-receive-pack(1)' command to use batched reference
updates. One edge case which was missed during this implementation was
when a user pushes multiple branches such as:

  delete refs/heads/branch/conflict
  create refs/heads/branch

Before using batched updates, the references would be applied
sequentially and hence no conflicts would arise. With batched updates,
while the first update applies, the second fails due to D/F conflict. A
similar issue was present in 'git-fetch(1)' and was fixed by separating
out reference pruning into a separate transaction in the commit 'fetch:
use batched reference updates'. Apply a similar mechanism for
'git-receive-pack(1)' and separate out reference deletions into its own
batch.

This means 'git-receive-pack(1)' will now use up to two transactions,
whereas before using batched updates it would use _at least_ two
transactions. So using batched updates is still the better option.

Add a test to validate this behavior.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-25 08:20:27 -07:00
Karthik Nayak 15c45c7458 refs/files: skip updates with errors in batched updates
The commit 23fc8e4f61 (refs: implement batch reference update support,
2025-04-08) introduced support for batched reference updates. This
allows users to batch updates together, while allowing some of the
updates to fail.

Under the hood, batched updates use the reference transaction mechanism.
Each update which fails is marked as such. Any failed updates must be
skipped over in the rest of the code, as they wouldn't apply any more.
In two of the loops within 'files_transaction_finish()' of the files
backend, the failed updates aren't skipped over. This can cause a
SEGFAULT otherwise. Add the missing skips and a test to validate the
same.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-25 08:20:27 -07:00
Junio C Hamano b486b64238 Sync with 'master' 2025-06-24 09:50:55 -07:00
Junio C Hamano 0354a7779f Merge branch 'jk/submodule-remote-lookup-cleanup' into next
Updating submodules from the upstream did not work well when
submodule's HEAD is detached, which has been improved.

* jk/submodule-remote-lookup-cleanup:
  submodule: look up remotes by URL first
  submodule: move get_default_remote_submodule()
  submodule--helper: improve logic for fallback remote name
  remote: remove the_repository from some functions
  dir: move starts_with_dot(_dot)_slash to dir.h
  remote: fix tear down of struct remote
  remote: remove branch->merge_name and fix branch_release()
2025-06-24 09:50:45 -07:00
Junio C Hamano 6726b890cb Merge branch 'jk/test-seq-format' into next
A test helper "test_seq" function learned the "-f <fmt>" option,
which allowed us to simplify a lot of test scripts.

* jk/test-seq-format:
  test-lib: teach test_seq the -f option
  t7422: replace confusing printf with echo
2025-06-24 09:50:44 -07:00
Junio C Hamano 106e5c22eb Merge branch 'jt/imap-send-message-fix' into next
Update some error messages from "git imap-send".

* jt/imap-send-message-fix:
  imap-send: improve error messages with configuration hints
  imap-send: fix confusing 'store' terminology in error message
2025-06-24 09:50:44 -07:00
Junio C Hamano 5d97a089a8 Merge branch 'ps/contrib-sweep' into next
Remove bunch of stuff from contrib/ hierarchy.

* ps/contrib-sweep:
  contrib: remove some scripts in "stats" directory
  contrib: remove "git-new-workdir"
  contrib: remove "emacs" directory
  contrib: remove "git-resurrect.sh"
  contrib: remove "persistent-https" remote helper
  contrib: remove "mw-to-git"
  contrib: remove "hooks" directory
  contrib: remove "thunderbird-patch-inline"
  contrib: remove remote-helper stubs
  contrib: remove "examples" directory
  contrib: remove "remotes2config.sh"
2025-06-24 09:50:43 -07:00
Junio C Hamano 29893fdca6 Merge branch 'jc/merge-compact-summary' into next
"git merge/pull" has been taught the "--compact-summary" option to
use the compact-summary format, intead of diffstat, when showing
the summary of the incoming changes.

* jc/merge-compact-summary:
  merge/pull: extend merge.stat configuration variable to cover --compact-summary
  merge/pull: add the "--compact-summary" option
2025-06-24 09:50:43 -07:00
Junio C Hamano 3dfd301fa1 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
2025-06-24 09:50:43 -07:00
Junio C Hamano f0135a9047 The third batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-24 09:48:52 -07:00
Junio C Hamano 277c3e82ed Merge branch 'ly/run-builtin-use-passed-in-repo'
Code clean-up.

* ly/run-builtin-use-passed-in-repo:
  git.c: remove the_repository dependence in run_builtin()
2025-06-24 09:48:52 -07:00
Junio C Hamano da59201dfc Merge branch 'rm/t2400-modernize'
Test clean-up.

* rm/t2400-modernize:
  t2400: replace 'test -[efd]' with 'test_path_is_*'
2025-06-24 09:48:52 -07:00
Junio C Hamano 1e60e1d6d8 Merge branch 'sa/multi-mailmap-fix'
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
2025-06-24 09:48:51 -07:00
Junio C Hamano 1f082506ba Merge branch 'jc/cg-let-bss-do-its-job'
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
2025-06-24 09:48:50 -07:00
Junio C Hamano 2859812ca3 Merge branch 'ac/preload-index-wo-the-repository'
Code clean-up.

* ac/preload-index-wo-the-repository:
  preload-index: stop depending on 'the_repository'
  environment: remove the global variable 'core_preload_index'
2025-06-24 09:48:49 -07:00
Junio C Hamano f6e507f7cb Merge branch 'ly/prepare-show-merge-leakfix'
Leakfix.

* ly/prepare-show-merge-leakfix:
  revision: fix memory leak in prepare_show_merge()
2025-06-24 09:48:49 -07:00
Junio C Hamano 77eb1dc722 Merge branch 'kj/stash-onbranch-submodule-fix'
"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
2025-06-24 09:48:48 -07:00
Junio C Hamano 91e15c5e0c Merge branch 'ag/send-email-edit-threading-fix'
"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
2025-06-24 09:48:47 -07:00
Junio C Hamano d2fb103447 Merge branch 'pw/stash-p-pathspec-fixes'
"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
2025-06-24 09:48:47 -07:00
Junio C Hamano afe1a7aee7 Merge branch 'pw/subtree-gpg-sign'
"git subtree" (in contrib/) learns to grok GPG signing its commits.

* pw/subtree-gpg-sign:
  contrib/subtree: add -S/--gpg-sign
  contrib/subtree: parse using --stuck-long
2025-06-24 09:48:46 -07:00
Jeff King b32c7ec02f test-lib: teach test_seq the -f option
The "seq" tool has a "-f" option to produce printf-style formatted
lines. Let's teach our test_seq helper the same trick. This lets us get
rid of some shell loops in test snippets (which are particularly verbose
in our test suite because we have to "|| return 1" to keep the &&-chain
going).

This converts a few call-sites I found by grepping around the test
suite. A few notes on these:

  - In "seq", the format specifier is a "%g" float. Since test_seq only
    supports integers, I've kept the more natural "%d" (which is what
    these call sites were using already).

  - Like "seq", test_seq automatically adds a newline to the specified
    format. This is what all callers are doing already except for t0021,
    but there we do not care about the exact format. We are just trying
    to printf a large number of bytes to a file. It's not worth
    complicating other callers or adding an option to avoid the newline
    in that caller.

  - Most conversions are just replacing a shell loop (which does get rid
    of an extra fork, since $() requires a subshell). In t0612 we can
    replace an awk invocation, which I think makes the end result more
    readable, as there's less quoting.

  - In t7422 we can replace one loop, but sadly we have to leave the
    loop directly above it. This is because that earlier loop wants to
    include the seq value twice in the output, which test_seq does not
    support (nor does regular seq). If you run:

      test_seq -f "foo-%d %d" 10

    the second "%d" will always be the empty string. You might naively
    think that test_seq could add some extra arguments, like:

      # 3 ought to be enough for anyone...
      printf "$fmt\n" "$i "$i" $i"

    but that just triggers printf to format multiple lines, one per
    extra set of arguments.

    So we'd have to actually parse the format string, figure out how
    many "%" placeholders are there, and then feed it that many
    instances of the sequence number. The complexity isn't worth it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-24 06:34:25 -07:00