Commit Graph

77385 Commits

Author SHA1 Message Date
Yee Cheng Chin
c7e3b8085b xdiff: optimize patience diff's LCS search
The find_longest_common_sequence() function in patience diff is
inefficient as it calls binary_search() for every unique line it
encounters when deciding where to put it in the sequence. From
instrumentation (using xctrace) on popular repositories, binary_search()
takes up 50-60% of the run time within patience_diff() when performing a
diff.

To optimize this, add a boundary condition check before binary_search()
is called to see if the encountered unique line is located after the
entire currently tracked longest subsequence. If so, skip the
unnecessary binary search and simply append the entry to the end of
sequence. Given that most files compared in a diff are usually quite
similar to each other, this condition is very common, and should be hit
much more frequently than the binary search.

Below are some end-to-end performance results by timing `git log
--shortstat --oneline -500 --patience` on different repositories with
the old and new code. Generally speaking this seems to give at least
8-10% speed up. The "binary search hit %" column describes how often the
algorithm enters the binary search path instead of the new faster path.
Even in the WebKit case we can see that it's quite rare (1.46%).

| Repo     | Speed difference | binary search hit % |
|----------|------------------|---------------------|
| vim      | 1.27x            | 0.01%               |
| pytorch  | 1.16x            | 0.02%               |
| cpython  | 1.14x            | 0.06%               |
| ripgrep  | 1.14x            | 0.03%               |
| git      | 1.13x            | 0.12%               |
| vscode   | 1.09x            | 0.10%               |
| WebKit   | 1.08x            | 1.46%               |

The benchmarks were done using hyperfine, on an Apple M1 Max laptop,
with git compiled with `-O3 -flto`.

Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-27 19:11:41 -08:00
Junio C Hamano
f368df439b Merge branch 'maint-2.49' into maint-2.50
* maint-2.49:
  t: avoid git config syntax from newer releases
2025-07-08 15:42:33 -07:00
Junio C Hamano
47243eeed1 Merge branch 'maint-2.48' into maint-2.49
* maint-2.48:
  t: avoid git config syntax from newer releases
2025-07-08 15:42:14 -07:00
Junio C Hamano
a1cf0cf13a Merge branch 'maint-2.47' into maint-2.48
* maint-2.47:
  t: avoid git config syntax from newer releases
2025-07-08 15:42:02 -07:00
Junio C Hamano
515a060550 Merge branch 'maint-2.46' into maint-2.47
* maint-2.46:
  t: avoid git config syntax from newer releases
2025-07-08 15:41:51 -07:00
Junio C Hamano
3d6d1296a4 Merge branch 'maint-2.45' into maint-2.46
This turns into a no-op merge, since more recent versions of Git
newer than 2.46 track do support the newer "git config" syntax.

* maint-2.45:
  t: avoid git config syntax from newer releases
2025-07-08 15:40:52 -07:00
Junio C Hamano
a98e34b5a7 Merge branch 'maint-2.44' into maint-2.45
* maint-2.44:
  t: avoid git config syntax from newer releases
2025-07-08 15:35:35 -07:00
Junio C Hamano
09669c729a Merge branch 'maint-2.43' into maint-2.44
* maint-2.43:
  t: avoid git config syntax from newer releases
2025-07-08 15:33:02 -07:00
Junio C Hamano
18e6be837a Merge branch 'tz/avoid-newer-config-syntax-in-older-maint-tracks' into maint-2.43
* tz/avoid-newer-config-syntax-in-older-maint-tracks:
  t: avoid git config syntax from newer releases
2025-07-08 15:31:56 -07:00
Todd Zullinger
428c9241c6 t: avoid git config syntax from newer releases
In a recent security release, 05e9cd64ee (config: quote values
containing CR character, 2025-05-19) added calls to `git config get`,
`git config set`, and `git config unset` which are not present on the
maint-2.43 branch.

These subcommands were added in the following commits, released in
git-2.46.0:

  4e51389000 (builtin/config: introduce "get" subcommand, 2024-05-06),
  00bbdde141 (builtin/config: introduce "set" subcommand, 2024-05-06),
  95ea69c67b (builtin/config: introduce "unset" subcommand, 2024-05-06)

Revert to the previous `git config` syntax for older maintenance
branches.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-08 15:06:35 -07:00
Junio C Hamano
463c211685 Merge branch 'maint-2.49' into maint-2.50
* maint-2.49:
  Documentation/RelNotes: use .adoc extension for new security releases
2025-07-08 13:04:39 -07:00
Taylor Blau
7f5dd143ac Documentation/RelNotes: use .adoc extension for new security releases
When preparing the latest round of security fixes, we wrote release
notes in v2.43.7, and then successively merged those up through to the
various 'maint' branches.

However, the 2.49 release series is the first to have commit 1f010d6bdf
(doc: use .adoc extension for AsciiDoc files, 2025-01-20). This means
that we should have renamed the new-but-historical release notes from
*.txt to *.adoc during the merge into the 'maint-2.49' branch, but
neglected to do so.

Rename them accordingly to match the convention introduced by
1f010d6bdf. Since the release materials in question here were prepared
before v2.50.0 was tagged, the 'maint' track for that release series is
OK as is.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-08 13:03:27 -07:00
Junio C Hamano
d82adb61ba Git 2.50.1 v2.50.1 2025-06-15 21:57:08 -07:00
Junio C Hamano
e1775c0646 Sync with 2.49.1 2025-06-15 21:54:23 -07:00
Junio C Hamano
16bd9f20a4 Git 2.50
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.50.0
2025-06-15 21:17:21 -07:00
Junio C Hamano
f1ca98f609 Hopefully final bits before 2.50
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-13 13:29:15 -07:00
Junio C Hamano
7bd3e5397d 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
2025-06-13 13:29:15 -07:00
Junio C Hamano
e1f335f3d4 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"
2025-06-13 13:29:14 -07:00
Junio C Hamano
f2a6a1e596 Merge branch 'jc/sed-build-fixes'
Build fix.

* jc/sed-build-fixes:
  build: sed portability fixes
2025-06-13 13:29:14 -07:00
Junio C Hamano
aadf8ae518 Git 2.49.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.49.1
2025-06-13 07:51:58 -07:00
Junio C Hamano
b2bfd317a3 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
2025-06-12 17:31:42 -07:00
Junio C Hamano
a97f313784 Sync with 2.48.2
* 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-12 17:13:35 -07:00
Junio C Hamano
9edff09aec 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
2025-06-12 14:19:10 -07:00
Junio C Hamano
5acfacc2a1 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>
2025-06-12 13:44:10 -07:00
Junio C Hamano
9b662a5d21 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)
2025-06-12 13:35:08 -07:00
Sebastian Andrzej Siewior
1c62df0abe 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>
2025-06-12 13:23:39 -07:00
Yi-Jyun Pan
cbf346a996 l10n: zh_TW: update translation for Git 2.50
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2025-06-12 22:29:32 +08:00
Teng Long
925035958b 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>
2025-06-12 21:47:46 +08:00
Jiang Xin
36cbedb7cf 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
2025-06-12 09:53:04 +08:00
Jiang Xin
ee33b2ef37 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
2025-06-12 09:49:37 +08:00
Kristoffer Haugsbakk
1e2677f66f 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>
2025-06-11 13:32:14 -07:00
Johannes Schindelin
3cc4fc1ebd 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>
2025-06-11 10:01:14 -07:00
Johannes Schindelin
882efe0444 ci(coverity): fix building on Windows
When I added the Coverity workflow in a56b6230d0 (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-11 10:01:14 -07:00
Ralf Thielow
b21f7dd9e3 l10n: Update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2025-06-11 16:56:18 +02:00
Arkadii Yakovets
aeac109283 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>
2025-06-10 18:23:00 -07:00
Jiang Xin
a956283999 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.50
2025-06-10 07:43:17 +08:00
Jiang Xin
f6709fbc4a Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5819t)
2025-06-10 07:42:34 +08:00
Jiang Xin
104807f89e 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
2025-06-10 07:41:22 +08:00
Jiang Xin
b0f9a659b2 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
2025-06-10 07:39:49 +08:00
Jiang Xin
1963f3203a Merge branch 'master' of github.com:aindriu80/git-po
* 'master' of github.com:aindriu80/git-po:
  l10n: Add full Irish translation (ga.po)
2025-06-10 07:37:22 +08:00
Kristoffer Haugsbakk
6cd0701e3c doc: maintenance: fix linkgit syntax
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-09 11:33:25 -07:00
Junio C Hamano
4c0e625c09 Git 2.50-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.50.0-rc2
2025-06-09 07:18:49 -07:00
Junio C Hamano
427b538fc3 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
2025-06-09 07:15:51 -07:00
Junio C Hamano
8db3019401 A bit more before -rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-06-07 10:46:51 -07:00
Junio C Hamano
8546b3566e Merge branch 'js/curl-easy-setopt-typefix'
Adjust to newer version of libcURL.

* js/curl-easy-setopt-typefix:
  curl: pass `long` values where expected
2025-06-07 10:46:50 -07:00
Junio C Hamano
7558d89423 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()
2025-06-07 10:46:50 -07:00
Junio C Hamano
c20471e465 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
2025-06-07 10:46:50 -07:00
Junio C Hamano
e2e22932cd Merge branch 'cf/var-completion-obsd-fixes'
Build fix for OpenBSD.

* cf/var-completion-obsd-fixes:
  completion: make sed command that generates config-list.h portable.
2025-06-07 10:46:49 -07:00
Bagas Sanjaya
642fd4ff36 l10n: po-id for 2.50
Update following components:

  * builtin/cat-file.c
  * builtin/fast-export.c
  * builtin/fsck.c
  * builtin/merge-tree.c
  * builtin/mv.c
  * builtin/reflog.c
  * builtin/repack.c
  * builtin/rev-list.c
  * builtin/update-ref.c
  * command-list.h
  * midx-write.c
  * object-file.c
  * parse-options.c
  * promisor-remote.c
  * refs/packed-backend.c
  * scalar.c
  * t/helper/test-pack-deltas.c
  * git-send-email.perl

Translate following new components:

  * builtin/diff-pairs.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2025-06-07 08:27:57 +07:00
Junio C Hamano
83cb7ae638 Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
  git-gui: don't delete source files when auto_mkindex fails
2025-06-06 09:41:59 -07:00