]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
9 months agoMerge https://github.com/prati0100/git-gui
Junio C Hamano [Thu, 24 Aug 2023 16:57:43 +0000 (09:57 -0700)] 
Merge https://github.com/prati0100/git-gui

* https://github.com/prati0100/git-gui:
  git-gui - use mkshortcut on Cygwin
  git-gui - use cygstart to browse on Cygwin
  git-gui - remove obsolete Cygwin specific code
  git gui Makefile - remove Cygwin modifications
  Makefiles: change search through $(MAKEFLAGS) for GNU make 4.4
  Work around Tcl's default `PATH` lookup
  Move the `_which` function (almost) to the top
  Move is_<platform> functions to the beginning
  is_Cygwin: avoid `exec`ing anything
  windows: ignore empty `PATH` elements
  git-gui: Fix a typo in README

9 months agoStart the 2.43 cycle
Junio C Hamano [Thu, 24 Aug 2023 16:31:49 +0000 (09:31 -0700)] 
Start the 2.43 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoMerge branch 'ds/maintenance-schedule-fuzz'
Junio C Hamano [Thu, 24 Aug 2023 16:32:34 +0000 (09:32 -0700)] 
Merge branch 'ds/maintenance-schedule-fuzz'

Hourly and other schedule of "git maintenance" jobs are randomly
distributed now.

* ds/maintenance-schedule-fuzz:
  maintenance: update schedule before config
  maintenance: fix systemd schedule overlaps
  maintenance: use random minute in systemd scheduler
  maintenance: swap method locations
  maintenance: use random minute in cron scheduler
  maintenance: use random minute in Windows scheduler
  maintenance: use random minute in launchctl scheduler
  maintenance: add get_random_minute()

9 months agoMerge branch 'ob/test-lib-rebase-fake-editor-updates'
Junio C Hamano [Thu, 24 Aug 2023 16:32:34 +0000 (09:32 -0700)] 
Merge branch 'ob/test-lib-rebase-fake-editor-updates'

Test updates.

* ob/test-lib-rebase-fake-editor-updates:
  t/lib-rebase: improve documentation of set_fake_editor()
  t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently
  t/lib-rebase: set_fake_editor(): fix recognition of reset's short command

9 months agoMerge branch 'mp/rebase-label-length-limit'
Junio C Hamano [Thu, 24 Aug 2023 16:32:33 +0000 (09:32 -0700)] 
Merge branch 'mp/rebase-label-length-limit'

Overly long label names used in the sequencer machinery are now
chopped to fit under filesystem limitation.

* mp/rebase-label-length-limit:
  rebase: allow overriding the maximal length of the generated labels
  sequencer: truncate labels to accommodate loose refs

9 months agoMerge branch 'ds/upload-pack-error-sequence-fix'
Junio C Hamano [Thu, 24 Aug 2023 16:32:33 +0000 (09:32 -0700)] 
Merge branch 'ds/upload-pack-error-sequence-fix'

Error message generation fix.

* ds/upload-pack-error-sequence-fix:
  upload-pack: fix exit code when denying fetch of unreachable object ID
  upload-pack: fix race condition in error messages

9 months agoMerge branch 'ws/git-push-doc-grammofix'
Junio C Hamano [Thu, 24 Aug 2023 16:32:33 +0000 (09:32 -0700)] 
Merge branch 'ws/git-push-doc-grammofix'

Doc update.

* ws/git-push-doc-grammofix:
  git-push.txt: fix grammar

9 months agoMerge branch 'tb/repack-geometry-cleanup'
Junio C Hamano [Thu, 24 Aug 2023 16:32:33 +0000 (09:32 -0700)] 
Merge branch 'tb/repack-geometry-cleanup'

Code clean-up.

* tb/repack-geometry-cleanup:
  repack: move `pack_geometry` struct to the stack

9 months agoMerge branch 'ob/sequencer-rearrange-cleanup'
Junio C Hamano [Thu, 24 Aug 2023 16:32:33 +0000 (09:32 -0700)] 
Merge branch 'ob/sequencer-rearrange-cleanup'

Code clean-up.

* ob/sequencer-rearrange-cleanup:
  sequencer: simplify allocation of result array in todo_list_rearrange_squash()

9 months agoMerge branch 'rj/branch-in-use-error-message'
Junio C Hamano [Thu, 24 Aug 2023 16:32:32 +0000 (09:32 -0700)] 
Merge branch 'rj/branch-in-use-error-message'

A message written in olden time prevented a branch from getting
checked out saying it is already checked out elsewhere, but these
days, we treat a branch that is being bisected or rebased just like
a branch that is checked out and protect it.  Rephrase the message
to say that the branch is in use.

* rj/branch-in-use-error-message:
  branch: error message checking out a branch in use
  branch: error message deleting a branch in use

9 months agoMerge branch 'ml/cygwin-fixes'
Pratyush Yadav [Thu, 24 Aug 2023 14:46:29 +0000 (16:46 +0200)] 
Merge branch 'ml/cygwin-fixes'

Remove some code supporting ancient Cygwin Tcl/Tk versions. Also fix
exploring working directory and making desktop shortcuts on Cygwin.

* ml/cygwin-fixes:
  git-gui - use mkshortcut on Cygwin
  git-gui - use cygstart to browse on Cygwin
  git-gui - remove obsolete Cygwin specific code
  git gui Makefile - remove Cygwin modifications

9 months agogit-gui - use mkshortcut on Cygwin
Mark Levedahl [Mon, 26 Jun 2023 16:53:05 +0000 (12:53 -0400)] 
git-gui - use mkshortcut on Cygwin

git-gui enables the "Repository->Create Desktop Icon" item on Cygwin,
offering to create a shortcut that starts git-gui on the current
repository. The code in do_cygwin_shortcut invokes function
win32_create_lnk to create the shortcut. This latter function is shared
between Cygwin and Git For Windows and expects Windows rather than unix
pathnames, though do_cygwin_shortcut provides unix pathnames. Also, this
function tries to invoke the Windows Script Host to run a javascript
snippet, but this fails under Cygwin's Tcl. So, win32_create_lnk just
does not support Cygwin.

However, Cygwin's default installation provides /bin/mkshortcut for
creating desktop shortcuts. This is compatible with exec under Cygwin's
Tcl, understands Cygwin's unix pathnames, and avoids the need for shell
escapes to encode troublesome paths. So, teach git-gui to use mkshortcut
on Cygwin, leaving win32_create_lnk unchanged and for exclusive use by
Git For Windows.

Notes: "CHERE_INVOKING=1" is recognized by Cygwin's /etc/profile and
prevents a "chdir $HOME", leaving the shell in the working directory
specified by the shortcut. That directory is written directly by
mkshortcut eliminating any problems with shell escapes and quoting.

The code being replaced includes the full pathname of the git-gui
creating the shortcut, but that git-gui might not be compatible with the
git found after /etc/profile sets the path, and might have a pathname
that defies encoding using shell escapes that can survive the multiple
incompatible interpreters involved in the chain of creating and using
this shortcut.  The new code uses bare "git gui" as the command to
execute, thus using the system git to launch the system git-gui, and
avoiding both issues.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
9 months agogit-gui - use cygstart to browse on Cygwin
Mark Levedahl [Mon, 26 Jun 2023 16:53:04 +0000 (12:53 -0400)] 
git-gui - use cygstart to browse on Cygwin

git-gui enables the "Repository->Explore Working Copy" menu on Cygwin,
offering to open a Windows graphical file browser at the root of the
working directory. This code, shared with Git For Windows support,
depends upon use of Windows pathnames. However, git gui on Cygwin uses
unix pathnames, so this shared code will not work on Cygwin.

A base install of Cygwin provides the /bin/cygstart utility that runs
a registered Windows application based upon the file type, after
translating unix pathnames to Windows.  Adding the --explore option
guarantees that the Windows file explorer is opened, regardless of the
supplied pathname's file type and avoiding possibility of some other
action being taken.

So, teach git-gui to use cygstart --explore on Cygwin, restoring the
pre-2012 behavior of opening a Windows file explorer for browsing. This
separates the Git For Windows and Cygwin code paths. Note that
is_Windows is never true on Cygwin, and is_Cygwin is never true on Git
for Windows, though this is not obvious by examining the code for those
independent functions.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
9 months agogit-gui - remove obsolete Cygwin specific code
Mark Levedahl [Mon, 26 Jun 2023 16:53:03 +0000 (12:53 -0400)] 
git-gui - remove obsolete Cygwin specific code

In the current git release, git-gui runs on Cygwin without enabling any
of git-gui's Cygwin specific code.  This happens as the Cygwin specific
code in git-gui was (mostly) written in 2007-2008 to work with Cygwin's
then supplied Tcl/Tk which was an incompletely ported variant of the
8.4.1 Windows Tcl/Tk code.  In March, 2012, that 8.4.1 package was
replaced with a full port based upon the upstream unix/X11 code,
since maintained up to date. The two Tcl/Tk packages are completely
incompatible, and have different signatures.

When Cygwin's Tcl/Tk signature changed in 2012, git-gui no longer
detected Cygwin, so did not enable Cygwin specific code, and the POSIX
environment provided by Cygwin since 2012 supported git-gui as a generic
unix. Thus, no-one apparently noticed the existence of incompatible
Cygwin specific code.

However, since commit c5766eae6f in the git-gui source tree
(https://github.com/prati0100/git-gui, master at a5005ded), and not yet
pulled into the git repository, the is_Cygwin function does detect
Cygwin using the unix/X11 Tcl/Tk.  The Cygwin specific code is enabled,
causing use of Windows rather than unix pathnames, and enabling
incorrect warnings about environment variables that were relevant only
to the old Tcl/Tk.  The end result is that (upstream) git-gui is now
incompatible with Cygwin.

So, delete Cygwin specific code (code protected by "if is_Cygwin") that
is not needed in any form to work with the unix/X11 Tcl/Tk.

Cygwin specific code required to enable file browsing and shortcut
creation is not addressed in this patch, does not currently work, and
invocation of those items may leave git-gui in a confused state.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
9 months agogit gui Makefile - remove Cygwin modifications
Mark Levedahl [Mon, 26 Jun 2023 16:53:02 +0000 (12:53 -0400)] 
git gui Makefile - remove Cygwin modifications

git-gui's Makefile hardcodes the absolute Windows path of git-gui's libraries
into git-gui, destroying the ability to package git-gui on one machine and
distribute to others. The intent is to do this only if a non-Cygwin Tcl/Tk is
installed, but the test for this is wrong with the unix/X11 Tcl/Tk shipped
since 2012. Also, Cygwin does not support a non-Cygwin Tcl/Tk.

The Cygwin git maintainer disables this code, so this code is definitely
not in use in the Cygwin distribution.

The simplest fix is to just delete the Cygwin specific code,
allowing the Makefile to work out of the box on Cygwin. Do so.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
10 months agoGit 2.42 v2.42.0
Junio C Hamano [Mon, 21 Aug 2023 16:34:58 +0000 (09:34 -0700)] 
Git 2.42

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'jk/function-pointer-mismatches-fix' (early part)
Junio C Hamano [Mon, 21 Aug 2023 16:27:44 +0000 (09:27 -0700)] 
Merge branch 'jk/function-pointer-mismatches-fix' (early part)

Fix a minor regression that some compiler might notice.

* 'jk/function-pointer-mismatches-fix' (early part):
  fsck: use enum object_type for fsck_walk callback

10 months agoMerge tag 'l10n-2.42.0-rnd2' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 21 Aug 2023 15:43:46 +0000 (08:43 -0700)] 
Merge tag 'l10n-2.42.0-rnd2' of https://github.com/git-l10n/git-po

l10n-2.42.0-rnd2

* tag 'l10n-2.42.0-rnd2' of https://github.com/git-l10n/git-po:
  l10n: zh_TW.po: Git 2.42
  l10n: zh_CN: 2.42.0 round 2
  l10n: zh_CN: v2.42.0 round 1
  l10n: Update German translation
  l10n: Update Catalan translation
  l10n: tr: git 2.42.0
  l10n: fr v2.42.0 rnd 2
  l10n: fr v2.42.0 rnd 1
  l10n: sv.po: Update Swedish translation 5549t0f0u
  l10n: uk: update translation (2.42.0)
  l10n: po-id for 2.42 (round 1)
  l10n: ru.po: update Russian translation

10 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sun, 20 Aug 2023 23:05:38 +0000 (07:05 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.42 (round 1)

10 months agol10n: zh_TW.po: Git 2.42
Yi-Jyun Pan [Sat, 5 Aug 2023 15:37:39 +0000 (23:37 +0800)] 
l10n: zh_TW.po: Git 2.42

Co-authored-by: Lumynous <lumynou5.tw@gmail.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
10 months agofsck: use enum object_type for fsck_walk callback
Jeff King [Sat, 19 Aug 2023 23:53:42 +0000 (19:53 -0400)] 
fsck: use enum object_type for fsck_walk callback

We switched the function interface for fsck callbacks in a1aad71601
(fsck.h: use "enum object_type" instead of "int", 2021-03-28). However,
we accidentally flipped the type back to "int" as part of 0b4e9013f1
(fsck: mark unused parameters in various fsck callbacks, 2023-07-03).
The mistake happened because that commit was written before a1aad71601
and rebased forward, and I screwed up while resolving the conflict.

Curiously, the compiler does not warn about this mismatch, at least not
when using gcc and clang on Linux (nor in any of our CI environments).
Based on 28abf260a5 (builtin/fsck.c: don't conflate "int" and "enum" in
callback, 2021-06-01), I'd guess that this would cause the AIX xlc
compiler to complain. I noticed because clang-18's UBSan now identifies
mis-matched function calls at runtime, and does complain of this case
when running the test suite.

I'm not entirely clear on whether this mismatch is a problem in
practice. Compilers are certainly free to make enums smaller than "int"
if they don't need the bits, but I suspect that they have to promote
back to int for function calls (though I didn't dig in the standard, and
I won't be surprised if I'm simply wrong and the real-world impact would
depend on the ABI).

Regardless, switching it back to enum is obviously the right thing to do
here; the switch to "int" was simply a mistake.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'l10n-de-2.42' of github.com:ralfth/git
Jiang Xin [Sat, 19 Aug 2023 13:09:31 +0000 (21:09 +0800)] 
Merge branch 'l10n-de-2.42' of github.com:ralfth/git

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

10 months agoMerge branch 'catalan' of github.com:Softcatala/git-po
Jiang Xin [Sat, 19 Aug 2023 13:08:22 +0000 (21:08 +0800)] 
Merge branch 'catalan' of github.com:Softcatala/git-po

* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

10 months agoMerge branch 'update-uk-l10n' of github.com:arkid15r/git-ukrainian-l10n
Jiang Xin [Sat, 19 Aug 2023 13:07:47 +0000 (21:07 +0800)] 
Merge branch 'update-uk-l10n' of github.com:arkid15r/git-ukrainian-l10n

* 'update-uk-l10n' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: update translation (2.42.0)

10 months agoMerge branch 'tl/zh_CN_2.42.0_rnd1' of github.com:dyrone/git
Jiang Xin [Sat, 19 Aug 2023 13:07:03 +0000 (21:07 +0800)] 
Merge branch 'tl/zh_CN_2.42.0_rnd1' of github.com:dyrone/git

* 'tl/zh_CN_2.42.0_rnd1' of github.com:dyrone/git:
  l10n: zh_CN: 2.42.0 round 2
  l10n: zh_CN: v2.42.0 round 1

10 months agoMerge branch 'master' of github.com:nafmo/git-l10n-sv
Jiang Xin [Sat, 19 Aug 2023 13:05:00 +0000 (21:05 +0800)] 
Merge branch 'master' of github.com:nafmo/git-l10n-sv

* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation 5549t0f0u

10 months agoMerge branch 'l10n-tr' of github.com:bitigchi/git-po
Jiang Xin [Sat, 19 Aug 2023 13:04:09 +0000 (21:04 +0800)] 
Merge branch 'l10n-tr' of github.com:bitigchi/git-po

* 'l10n-tr' of github.com:bitigchi/git-po:
  l10n: tr: git 2.42.0

10 months agol10n: zh_CN: 2.42.0 round 2
Teng Long [Fri, 18 Aug 2023 02:23:09 +0000 (10:23 +0800)] 
l10n: zh_CN: 2.42.0 round 2

Signed-off-by: Teng Long <dyroneteng@gmail.com>
10 months agol10n: zh_CN: v2.42.0 round 1
Teng Long [Wed, 9 Aug 2023 09:48:02 +0000 (17:48 +0800)] 
l10n: zh_CN: v2.42.0 round 1

Signed-off-by: Teng Long <dyroneteng@gmail.com>
10 months agoMerge branch 'ps/revision-stdin-with-options'
Junio C Hamano [Thu, 17 Aug 2023 22:50:05 +0000 (15:50 -0700)] 
Merge branch 'ps/revision-stdin-with-options'

Typofix to documentation added during this cycle.

* ps/revision-stdin-with-options:
  rev-list-options: fix typo in `--stdin` documentation

10 months agoMerge branch 'sa/doc-ls-remote'
Junio C Hamano [Thu, 17 Aug 2023 22:50:05 +0000 (15:50 -0700)] 
Merge branch 'sa/doc-ls-remote'

Mark-up fix to documentation added during this cycle.

* sa/doc-ls-remote:
  show-ref doc: fix carets in monospace

10 months agoMerge branch 'tl/notes-separator'
Junio C Hamano [Thu, 17 Aug 2023 22:50:05 +0000 (15:50 -0700)] 
Merge branch 'tl/notes-separator'

Typo/grammofix to documentation added during this cycle.

* tl/notes-separator:
  notes doc: tidy up `--no-stripspace` paragraph
  notes doc: split up run-on sentences

10 months agol10n: Update German translation
Ralf Thielow [Thu, 17 Aug 2023 15:00:36 +0000 (17:00 +0200)] 
l10n: Update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
10 months agorev-list-options: fix typo in `--stdin` documentation
Martin Ågren [Wed, 16 Aug 2023 14:24:36 +0000 (16:24 +0200)] 
rev-list-options: fix typo in `--stdin` documentation

With `--stdin`, we read *from* standard input, not *for*.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoshow-ref doc: fix carets in monospace
Martin Ågren [Wed, 16 Aug 2023 14:24:35 +0000 (16:24 +0200)] 
show-ref doc: fix carets in monospace

When commit 00bf685975 (show-ref doc: update for internal consistency,
2023-05-19) switched from double quotes to backticks around our {caret}
macro, we started rendering "{caret}" literally. Fix this by replacing
by a "^" character.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agonotes doc: tidy up `--no-stripspace` paragraph
Martin Ågren [Wed, 16 Aug 2023 14:24:34 +0000 (16:24 +0200)] 
notes doc: tidy up `--no-stripspace` paragraph

Where we document the `--no-stripspace` option, remove a superfluous
"For" to fix the grammar. Mark option names and command names using
`backticks` to set them in monospace.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agonotes doc: split up run-on sentences
Martin Ågren [Wed, 16 Aug 2023 14:24:33 +0000 (16:24 +0200)] 
notes doc: split up run-on sentences

When commit c4e2aa7d45 (notes.c: introduce "--[no-]stripspace" option,
2023-05-27) mentioned the new `--no-stripspace` in the documentation for
`-m` and `-F`, it created run-on sentences. It also used slightly
different language in the two sections for no apparent reason. Split the
sentences in two to improve readability, and while touching the two
sites, make them more similar.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agol10n: Update Catalan translation
Jordi Mas [Wed, 16 Aug 2023 16:25:02 +0000 (18:25 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
10 months agoupload-pack: fix exit code when denying fetch of unreachable object ID
Patrick Steinhardt [Wed, 16 Aug 2023 06:06:59 +0000 (08:06 +0200)] 
upload-pack: fix exit code when denying fetch of unreachable object ID

In 7ba7c52d76 (upload-pack: fix race condition in error messages,
2023-08-10), we have fixed a race in t5516-fetch-push.sh where sometimes
error messages got intermingled. This was done by splitting up the call
to `die()` such that we print the error message before writing to the
remote side, followed by a call to `exit(1)` afterwards.

This causes a subtle regression though as `die()` causes us to exit with
exit code 128, whereas we now call `exit(1)`. It's not really clear
whether we want to guarantee any specific error code in this case, and
neither do we document anything like that. But on the other hand, it
seems rather clear that this is an unintended side effect of the change
given that this change in behaviour was not mentioned at all.

Restore the status-quo by exiting with 128.  The test in t5703 to
ensure that "git fetch" fails by using test_must_fail, which does
not care between exiting 1 and 128, so this changes will not affect
any test.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agol10n: tr: git 2.42.0
Emir SARI [Mon, 7 Aug 2023 15:40:16 +0000 (18:40 +0300)] 
l10n: tr: git 2.42.0

Signed-off-by: Emir SARI <emir_sari@icloud.com>
10 months agol10n: fr v2.42.0 rnd 2
Jean-Noël Avila [Wed, 16 Aug 2023 09:50:23 +0000 (11:50 +0200)] 
l10n: fr v2.42.0 rnd 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
10 months agol10n: fr v2.42.0 rnd 1
Jean-Noël Avila [Sun, 6 Aug 2023 08:01:50 +0000 (10:01 +0200)] 
l10n: fr v2.42.0 rnd 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
10 months agol10n: sv.po: Update Swedish translation 5549t0f0u
Peter Krefting [Wed, 16 Aug 2023 06:42:51 +0000 (07:42 +0100)] 
l10n: sv.po: Update Swedish translation 5549t0f0u

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
10 months agol10n: uk: update translation (2.42.0)
Arkadii Yakovets [Wed, 16 Aug 2023 01:55:13 +0000 (18:55 -0700)] 
l10n: uk: update translation (2.42.0)

Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
10 months agoMerge branch 'master' of github.com:git/git
Jiang Xin [Tue, 15 Aug 2023 23:24:56 +0000 (07:24 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (34 commits)
  Git 2.42-rc2
  t4053: avoid writing to unopened pipe
  t4053: avoid race when killing background processes
  Git 2.42-rc1
  git maintenance: avoid console window in scheduled tasks on Windows
  win32: add a helper to run `git.exe` without a foreground window
  t9001: remove excessive GIT_SEND_EMAIL_NOTTY=1
  mv: handle lstat() failure correctly
  parse-options: disallow negating OPTION_SET_INT 0
  repack: free geometry struct
  send-email: avoid creating more than one Term::ReadLine object
  send-email: drop FakeTerm hack
  t0040: declare non-tab indentation to be okay in this script
  advice: handle "rebase" in error_resolve_conflict()
  A few more topics before -rc1
  mailmap: change primary address for Glen Choo
  gitignore: ignore clangd .cache directory
  docs: update when `git bisect visualize` uses `gitk`
  compat/mingw: implement a native locate_in_PATH()
  run-command: conditionally define locate_in_PATH()
  ...

10 months agoGit 2.42-rc2 v2.42.0-rc2
Junio C Hamano [Tue, 15 Aug 2023 17:20:02 +0000 (10:20 -0700)] 
Git 2.42-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'pw/diff-no-index-from-named-pipes'
Junio C Hamano [Tue, 15 Aug 2023 17:19:47 +0000 (10:19 -0700)] 
Merge branch 'pw/diff-no-index-from-named-pipes'

Test updates.

* pw/diff-no-index-from-named-pipes:
  t4053: avoid writing to unopened pipe
  t4053: avoid race when killing background processes

10 months agoMerge branch 'st/mv-lstat-fix'
Junio C Hamano [Tue, 15 Aug 2023 17:19:47 +0000 (10:19 -0700)] 
Merge branch 'st/mv-lstat-fix'

Correct use of lstat() that assumed a failing call would not
clobber the statbuf.

* st/mv-lstat-fix:
  mv: handle lstat() failure correctly

10 months agoMerge branch 'jc/send-email-pre-process-fix'
Junio C Hamano [Tue, 15 Aug 2023 17:19:47 +0000 (10:19 -0700)] 
Merge branch 'jc/send-email-pre-process-fix'

Test fix.

* jc/send-email-pre-process-fix:
  t9001: remove excessive GIT_SEND_EMAIL_NOTTY=1

10 months agoMerge branch 'ds/maintenance-on-windows-fix'
Junio C Hamano [Tue, 15 Aug 2023 17:19:47 +0000 (10:19 -0700)] 
Merge branch 'ds/maintenance-on-windows-fix'

Windows updates.

* ds/maintenance-on-windows-fix:
  git maintenance: avoid console window in scheduled tasks on Windows
  win32: add a helper to run `git.exe` without a foreground window

10 months agoMerge branch 'js/allow-t4000-to-be-indented-with-spaces'
Junio C Hamano [Mon, 14 Aug 2023 20:26:41 +0000 (13:26 -0700)] 
Merge branch 'js/allow-t4000-to-be-indented-with-spaces'

File attribute update.

* js/allow-t4000-to-be-indented-with-spaces:
  t0040: declare non-tab indentation to be okay in this script

10 months agoMerge branch 'jk/send-email-with-new-readline'
Junio C Hamano [Mon, 14 Aug 2023 20:26:41 +0000 (13:26 -0700)] 
Merge branch 'jk/send-email-with-new-readline'

Adjust to newer Term::ReadLine to prevent it from breaking
the interactive prompt code in send-email.

* jk/send-email-with-new-readline:
  send-email: avoid creating more than one Term::ReadLine object
  send-email: drop FakeTerm hack

10 months agoMerge branch 'jk/repack-leakfix'
Junio C Hamano [Mon, 14 Aug 2023 20:26:40 +0000 (13:26 -0700)] 
Merge branch 'jk/repack-leakfix'

Leakfix.

* jk/repack-leakfix:
  repack: free geometry struct

10 months agoMerge branch 'rs/parse-opt-forbid-set-int-0-without-noneg'
Junio C Hamano [Mon, 14 Aug 2023 20:26:40 +0000 (13:26 -0700)] 
Merge branch 'rs/parse-opt-forbid-set-int-0-without-noneg'

Developer support to detect meaningless combination of options.

* rs/parse-opt-forbid-set-int-0-without-noneg:
  parse-options: disallow negating OPTION_SET_INT 0

10 months agoMerge branch 'ob/rebase-conflict-advice-i18n-fix'
Junio C Hamano [Mon, 14 Aug 2023 20:26:40 +0000 (13:26 -0700)] 
Merge branch 'ob/rebase-conflict-advice-i18n-fix'

i18n coverage improvement and avoidance of sentence lego.

* ob/rebase-conflict-advice-i18n-fix:
  advice: handle "rebase" in error_resolve_conflict()

10 months agot4053: avoid writing to unopened pipe
Jeff King [Sun, 13 Aug 2023 16:24:40 +0000 (12:24 -0400)] 
t4053: avoid writing to unopened pipe

This fixes an occasional hang I see when running t4053 with
--verbose-log using dash.

Commit 1e3f26542a (diff --no-index: support reading from named pipes,
2023-07-05) added a test that "diff --no-index" will complain when
comparing a named pipe and a directory. The minimum we need to test this
is to mkfifo the pipe, and then run "git diff --no-index pipe some_dir".
But the test does one thing more: it spawns a background shell process
that opens the pipe for writing, like this:

        {
                (>pipe) &
        } &&

This extra writer _could_ be useful if Git misbehaves and tries to open
the pipe for reading. Without the writer, Git would block indefinitely
and the test would never end. But since we do not have such a bug, Git
does not open the pipe and it is the writing process which will block
indefinitely, since there are no readers. The test addresses this by
running "kill $!" in a test_when_finished block. Since the writer should
be blocking forever, this kill command will reliably find it waiting.

However, this seems to be somewhat racy, in that the writing process
sometimes hangs around even after the "kill". In a normal run of the
test script without options, this doesn't have any effect; the
main test script completes anyway. But with --verbose-log, we spawn a
"tee" process that reads the script output, and it won't end until all
descriptors pointing to its input pipe are closed. And the background
process that is hanging around still has its stderr, etc, pointed into
that pipe.

You can reproduce the situation like this:

  cd t
  ./t4053-diff-no-index.sh --verbose-log --stress

Let that run for a few minutes, and then you'll find that some of the
runs have hung. For example, at 11:53, I ran:

  $ ps xk start o pid,start,command | grep tee | head
   713459 11:48:06 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-9.out
   713527 11:48:06 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-15.out
   719434 11:48:07 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-1.out
   728117 11:48:08 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-5.out
   738738 11:48:09 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-31.out
   739457 11:48:09 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-27.out
   744432 11:48:10 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-21.out
   744471 11:48:10 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-29.out
   761961 11:48:12 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-0.out
   812299 11:48:19 tee -a /home/peff/compile/git/t/test-results/t4053-diff-no-index.stress-8.out

All of these have been hung for several minutes. We can investigate one
and see that it's waiting to get EOF on its input:

  $ strace -p 713459
  strace: Process 713459 attached
  read(0,
  ^C

Who else has that descriptor open?

  $ lsof -a -p 713459 -d 0 +E
  COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
  tee     713459 peff    0r  FIFO   0,13      0t0 3943636 pipe 719203,sh,5w 719203,sh,7w 719203,sh,12w 719203,sh,13w
  sh      719203 peff    5w  FIFO   0,13      0t0 3943636 pipe 713459,tee,0r 719203,sh,7w 719203,sh,12w 719203,sh,13w
  sh      719203 peff    7w  FIFO   0,13      0t0 3943636 pipe 713459,tee,0r 719203,sh,5w 719203,sh,12w 719203,sh,13w
  sh      719203 peff   12w  FIFO   0,13      0t0 3943636 pipe 713459,tee,0r 719203,sh,5w 719203,sh,7w 719203,sh,13w
  sh      719203 peff   13w  FIFO   0,13      0t0 3943636 pipe 713459,tee,0r 719203,sh,5w 719203,sh,7w 719203,sh,12w

It's a shell, presumably a subshell spawned by the main script. Though
it may seem odd, having the same descriptor open several times is not
unreasonable (they're all basically the original stdout/stderr of the
script that has been copied). And they should all close when the process
exits. So what's it doing? Curiously, it will exit as soon as we strace
it:

  $ strace -s 64 -p 719203
  strace: Process 719203 attached
  openat(AT_FDCWD, "pipe", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
  write(2, "./t4053-diff-no-index.sh: 7: eval: ", 35) = 35
  write(2, "cannot create pipe: Directory nonexistent", 41) = 41
  write(2, "\n", 1)                       = 1
  exit_group(2)                           = ?
  +++ exited with 2 +++

I think what happens is this:

  - it is blocking in the openat() call for the pipe, as we expect (so
    this is definitely the backgrounded subshell mentioned above)

  - strace sends signals (probably STOP/CONT); those cause the kernel to
    stop blocking, but libc will restart the system call automatically

  - by this time, the "pipe" fifo is gone, so we'll actually try to
    create a regular file. But of course the surrounding directory is
    gone, too! So we get ENOENT, and then exit as normal.

So the blocking is something we expect to happen. But what we didn't
expect is for the process to still exist at all! It should have been
killed earlier when the parent process called "kill", but it wasn't. And
we can't catch the race at this point, because it happened much earlier.

One can guess, though, that there is some race with the shell setting up
the signal handling in the backgrounded subshell, and possibly blocking
or ignoring signals at the time that the "kill" is received.  Curiously,
the race does not seem to happen if I use "bash" instead of "dash", so
presumably bash's setup here is more atomic.

One fix might be to try killing the subshell more aggressively, either
using SIGKILL, or looping on kill/wait. But that seems complex and
likely to introduce new problems/races. Instead, we can observe that the
writer is not needed at all. Git will notice the pipe via stat() before
it is ever opened. So we can simply drop the writer subshell entirely.

If we ever changed Git to open the path and fstat() it, this would
result in the test hanging. But we're not likely to do that. After all,
we have to stat() paths to see if they are openable at all (e.g., it
could be a directory), so this seems like a low risk. And anybody who
does make such a change will immediately see the issue, as Git would
hang consistently.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: update schedule before config
Derrick Stolee [Thu, 10 Aug 2023 20:39:47 +0000 (20:39 +0000)] 
maintenance: update schedule before config

When running 'git maintenance start', the current pattern is to
configure global config settings to enable maintenance on the current
repository and set 'maintenance.auto' to false and _then_ to set up the
schedule with the system scheduler.

This has a problematic error condition: if the scheduler fails to
initialize, the repository still will not use automatic maintenance due
to the 'maintenance.auto' setting.

Fix this gap by swapping the order of operations. If Git fails to
initialize maintenance, then the config changes should never happen.

Reported-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: fix systemd schedule overlaps
Derrick Stolee [Thu, 10 Aug 2023 20:39:46 +0000 (20:39 +0000)] 
maintenance: fix systemd schedule overlaps

The 'git maintenance run' command prevents concurrent runs in the same
repository using a 'maintenance.lock' file. However, when using systemd
the hourly maintenance runs the same time as the daily and weekly runs.
(Similarly, daily maintenance runs at the same time as weekly
maintenance.) These competing commands result in some maintenance not
actually being run.

This overlap was something we could not fix until we made the recent
change to not use the builting 'hourly', 'daily', and 'weekly' schedules
in systemd. We can adjust the schedules such that:

 1. Hourly runs avoid the 0th hour.
 2. Daily runs avoid Monday.

This will keep maintenance runs from colliding when using systemd.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: use random minute in systemd scheduler
Derrick Stolee [Thu, 10 Aug 2023 20:39:45 +0000 (20:39 +0000)] 
maintenance: use random minute in systemd scheduler

The get_random_minute() method was created to allow maintenance
schedules to be fixed to a random minute of the hour. This randomness is
only intended to spread out the load from a number of clients, but each
client should have an hour between each maintenance cycle.

Add this random minute to the systemd integration.

This integration is more complicated than similar changes for other
schedulers because of a neat trick that systemd allows: templating.

The previous implementation generated two template files with names
of the form 'git-maintenance@.(timer|service)'. The '.timer' or
'.service' indicates that this is a template that is picked up when we
later specify '...@<schedule>.timer' or '...@<schedule>.service'. The
'<schedule>' string is then used to insert into the template both the
'OnCalendar' schedule setting and the '--schedule' parameter of the
'git maintenance run' command.

In order to set these schedules to a given minute, we can no longer use
the 'hourly', 'daily', or 'weekly' strings for '<schedule>' and instead
need to abandon the template model for the .timer files. We can still
use templates for the .service files. For this reason, we split these
writes into two methods.

Modify the template with a custom schedule in the 'OnCalendar' setting.
This schedule has some interesting differences from cron-like patterns,
but is relatively easy to figure out from context. The one that might be
confusing is that '*-*-*' is a date-based pattern, but this must be
omitted when using 'Mon' to signal that we care about the day of the
week. Monday is used since that matches the day used for the 'weekly'
schedule used previously.

Now that the timer files are not templates, we might want to abandon the
'@' symbol in the file names. However, this would cause users with
existing schedules to get two competing schedules due to different
names. The work to remove the old schedule name is one thing that we can
avoid by keeping the '@' symbol in our unit names. Since we are locked
into this name, it makes sense that we keep the template model for the
.service files.

The rest of the change involves making sure we are writing these .timer
and .service files before initializing the schedule with 'systemctl' and
deleting the files when we are done. Some changes are also made to share
the random minute along with a single computation of the execution path
of the current Git executable.

In addition, older Git versions may have written a
'git-maintenance@.timer' template file. Be sure to remove this when
successfully enabling maintenance (or disabling maintenance).

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: swap method locations
Derrick Stolee [Thu, 10 Aug 2023 20:39:44 +0000 (20:39 +0000)] 
maintenance: swap method locations

The systemd_timer_write_unit_templates() method writes a single template
that is then used to start the hourly, daily, and weekly schedules with
systemd.

However, in order to schedule systemd maintenance on a given minute,
these templates need to be replaced with specific schedules for each of
these jobs.

Before modifying the schedules, move the writing method above the
systemd_timer_enable_unit() method, so we can write a specific schedule
for each unit.

The diff is computed smaller by showing systemd_timer_enable_unit() and
systemd_timer_delete_units()  move instead of
systemd_timer_write_unit_templates() and
systemd_timer_delete_unit_templates().

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: use random minute in cron scheduler
Derrick Stolee [Thu, 10 Aug 2023 20:39:43 +0000 (20:39 +0000)] 
maintenance: use random minute in cron scheduler

The get_random_minute() method was created to allow maintenance
schedules to be fixed to a random minute of the hour. This randomness is
only intended to spread out the load from a number of clients, but each
client should have an hour between each maintenance cycle.

Add this random minute to the cron integration.

The cron schedule specification starts with a minute indicator, which
was previously inserted as the "0" string but now takes the given minute
as an integer parameter.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: use random minute in Windows scheduler
Derrick Stolee [Thu, 10 Aug 2023 20:39:42 +0000 (20:39 +0000)] 
maintenance: use random minute in Windows scheduler

The get_random_minute() method was created to allow maintenance
schedules to be fixed to a random minute of the hour. This randomness is
only intended to spread out the load from a number of clients, but each
client should have an hour between each maintenance cycle.

Add this random minute to the Windows scheduler integration.

We need only to modify the minute value for the 'StartBoundary' tag
across the three schedules.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: use random minute in launchctl scheduler
Derrick Stolee [Thu, 10 Aug 2023 20:39:41 +0000 (20:39 +0000)] 
maintenance: use random minute in launchctl scheduler

The get_random_minute() method was created to allow maintenance
schedules to be fixed to a random minute of the hour. This randomness is
only intended to spread out the load from a number of clients, but each
client should have an hour between each maintenance cycle.

Use get_random_minute() when constructing the schedules for launchctl.

The format already includes a 'Minute' key which is modified from 0 to
the random minute.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomaintenance: add get_random_minute()
Derrick Stolee [Thu, 10 Aug 2023 20:39:40 +0000 (20:39 +0000)] 
maintenance: add get_random_minute()

When we initially created background maintenance -- with its hourly,
daily, and weekly schedules -- we considered the effects of all clients
launching fetches to the server every hour on the hour. The worry of
DDoSing server hosts was noted, but left as something we would consider
for a future update.

As background maintenance has gained more adoption over the past three
years, our worries about DDoSing the big Git hosts has been unfounded.
Those systems, especially those serving public repositories, are already
resilient to thundering herds of much smaller scale.

However, sometimes organizations spin up specific custom server
infrastructure either in addition to or on top of their Git host. Some
of these technologies are built for a different range of scale, and can
hit concurrency limits sooner. Organizations with such custom
infrastructures are more likely to recommend tools like `scalar` which
furthers their adoption of background maintenance.

To help solve for this, create get_random_minute() as a method to help
Git select a random minute when creating schedules in the future. The
integrations with this method do not yet exist, but will follow in
future changes.

To avoid multiple sources of randomness in the Git codebase, create a
new helper function, git_rand(), that returns a random uint32_t. This is
similar to how rand() returns a random nonnegative value, except it is
based on csprng_bytes() which is cryptographic and will return values
larger than RAND_MAX.

One thing that is important for testability is that we notice when we
are under a test scenario and return a predictable result. The schedules
themselves are not checked for this value, but at least one launchctl
test checks that we do not unnecessarily reboot the schedule if it has
not changed from a previous version.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorebase: allow overriding the maximal length of the generated labels
Johannes Schindelin [Thu, 10 Aug 2023 16:35:00 +0000 (16:35 +0000)] 
rebase: allow overriding the maximal length of the generated labels

With this change, users can override the compiled-in default for the
maximal length of the label names generated by `git rebase
--rebase-merges`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Mark Ruvald Pedersen <mped@demant.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosequencer: truncate labels to accommodate loose refs
Mark Ruvald Pedersen [Thu, 10 Aug 2023 16:34:59 +0000 (16:34 +0000)] 
sequencer: truncate labels to accommodate loose refs

Some commits may have unusually long subject lines. When those subject
lines are used as labels in the `--rebase-merges` mode of `git rebase`,
they can cause errors when writing the corresponding loose refs because
most file systems have a maximal file name length of 255 (`NAME_MAX`).
The symptom looks like this:

$ git rebase --continue
error: cannot lock ref 'refs/rewritten/SANITIZED-SUBJECT': Unable to create '.git/refs/rewritten/SANITIZED-SUBJECT.lock': File name too long - where SANITIZED-SUBJECT is very long

Let's accommodate this situation by truncating the labels.

Care must be taken in case the subject line contains multi-byte
characters so as not to truncate in the middle of a character.

Signed-off-by: Mark Ruvald Pedersen <mped@demant.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot/lib-rebase: improve documentation of set_fake_editor()
Oswald Buddenhagen [Wed, 9 Aug 2023 17:15:31 +0000 (19:15 +0200)] 
t/lib-rebase: improve documentation of set_fake_editor()

Firstly, make it reflect better what actually happens. Not omitting some
possibilities makes it easier to fully exploit them, and not
contradicting the implementation makes it easier to grok and thus modify
the code.

Secondly, improve the overall structure, putting more general info
further up.

Thirdly, document `merge`, `fakesha`, and `break`, which were previously
omitted entirely.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot4053: avoid race when killing background processes
Phillip Wood [Thu, 10 Aug 2023 14:33:13 +0000 (14:33 +0000)] 
t4053: avoid race when killing background processes

The test 'diff --no-index reads from pipes' starts a couple of
background processes that write to the pipes that are passed to "diff
--no-index". If the test passes then we expect these processes to exit
as all their output will have been read. However if the test fails
then we want to make sure they do not hang about on the users machine
and the test remembers they should be killed by calling

      test_when_finished  "! kill $!"

after each background process is created. Unfortunately there is a
race where test_when_finished may run before the background process
exits even when all its output has been read resulting in the kill
command succeeding which causes the test to fail. Fix this by ignoring
the exit status of the kill command. If the diff is successful we
could instead wait for the background process to exit and check their
status but that feels like it is testing the platform's printf
implementation rather than git's code.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoupload-pack: fix race condition in error messages
Derrick Stolee [Thu, 10 Aug 2023 14:40:50 +0000 (14:40 +0000)] 
upload-pack: fix race condition in error messages

Test t5516-fetch-push.sh has a test 'deny fetch unreachable SHA1,
allowtipsha1inwant=true' that checks stderr for a specific error
string from the remote. In some build environments the error sent
over the remote connection gets mingled with the error from the
die() statement. Since both signals are being output to the same
file descriptor (but from parent and child processes), the output
we are matching with grep gets split.

To reduce the risk of this failure, follow this process instead:

1. Write an error message to stderr.
2. Write an error message across the connection.
3. exit(1).

This reorders the events so the error is written entirely before
the client receives a message from the remote, removing the race
condition.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agogit-push.txt: fix grammar
Wesley Schwengle [Thu, 10 Aug 2023 01:21:05 +0000 (21:21 -0400)] 
git-push.txt: fix grammar

While working on a blog post and using grammarly it suggested this
change.

Signed-off-by: Wesley Schwengle <wesleys@opperschaap.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoGit 2.42-rc1 v2.42.0-rc1
Junio C Hamano [Wed, 9 Aug 2023 23:17:27 +0000 (16:17 -0700)] 
Git 2.42-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'pw/rebase-skip-commit-message-fix'
Junio C Hamano [Wed, 9 Aug 2023 23:18:16 +0000 (16:18 -0700)] 
Merge branch 'pw/rebase-skip-commit-message-fix'

"git rebase -i" with a series of squash/fixup, when one of the
steps stopped in conflicts and ended up getting skipped, did not
handle the accumulated commit log messages, which has been
corrected.

* pw/rebase-skip-commit-message-fix:
  rebase --skip: fix commit message clean up when skipping squash

10 months agoMerge branch 'ma/locate-in-path-for-windows'
Junio C Hamano [Wed, 9 Aug 2023 23:18:15 +0000 (16:18 -0700)] 
Merge branch 'ma/locate-in-path-for-windows'

"git bisect visualize" stopped running "gitk" on Git for Windows
when the command was reimplemented in C around Git 2.34 timeframe.
This has been corrected.

* ma/locate-in-path-for-windows:
  docs: update when `git bisect visualize` uses `gitk`
  compat/mingw: implement a native locate_in_PATH()
  run-command: conditionally define locate_in_PATH()

10 months agoMerge branch 'bc/ignore-clangd-cache'
Junio C Hamano [Wed, 9 Aug 2023 23:18:15 +0000 (16:18 -0700)] 
Merge branch 'bc/ignore-clangd-cache'

.gitignore update.

* bc/ignore-clangd-cache:
  gitignore: ignore clangd .cache directory

10 months agoMerge branch 'bc/ident-dot-is-no-longer-crud-letter'
Junio C Hamano [Wed, 9 Aug 2023 23:18:15 +0000 (16:18 -0700)] 
Merge branch 'bc/ident-dot-is-no-longer-crud-letter'

Exclude "." from the set of characters to be removed from the
beginning and the end of the human-readable name.

* bc/ident-dot-is-no-longer-crud-letter:
  ident: don't consider '.' a crud

10 months agoMerge branch 'ew/hash-with-openssl-evp'
Junio C Hamano [Wed, 9 Aug 2023 23:18:15 +0000 (16:18 -0700)] 
Merge branch 'ew/hash-with-openssl-evp'

Adjust to OpenSSL 3+, which deprecates its SHA-1 functions based on
its traditional API, by using its EVP API instead.

* ew/hash-with-openssl-evp:
  avoid SHA-1 functions deprecated in OpenSSL 3+
  sha256: avoid functions deprecated in OpenSSL 3+

10 months agorepack: move `pack_geometry` struct to the stack
Taylor Blau [Wed, 9 Aug 2023 20:32:42 +0000 (16:32 -0400)] 
repack: move `pack_geometry` struct to the stack

The `pack_geometry` struct is used to maintain and partition a list of
packfiles into a "frozen" set (to be left alone), and a non-frozen set
(to be combined into a single new pack). In the previous commit, we
removed a leak caused by neglecting to free() the heap allocated space
used to store the structure itself.

But there is no need for this structure to live on the heap anyway.
Instead, let's move it to be stack allocated, eliminating the
possibility of a direct leak like the one addressed in the previous
patch.

The one minor hitch is that we use the NULL-ness of the pack_geometry's
struct pointer to determine whether or not we are performing a geometric
repack with `--geometric=<d>`. But since we only initialize the
pack_geometry structure when the `geometric_factor` is non-zero, we can
use that variable (based on whether or not it is equal to zero) to
determine whether or not we are performing a geometric repack.

There are a couple of spots that have access to a pointer to the
pack_geometry struct, but not the geometric_factor itself. Instead of
passing in an additional variable, let's make the geometric_factor a
field of the pack_geometry struct.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agogit maintenance: avoid console window in scheduled tasks on Windows
Johannes Schindelin [Wed, 9 Aug 2023 16:54:47 +0000 (16:54 +0000)] 
git maintenance: avoid console window in scheduled tasks on Windows

We just introduced a helper to avoid showing a console window when the
scheduled task runs `git.exe`. Let's actually use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agowin32: add a helper to run `git.exe` without a foreground window
Johannes Schindelin [Wed, 9 Aug 2023 16:54:46 +0000 (16:54 +0000)] 
win32: add a helper to run `git.exe` without a foreground window

On Windows, there are two kinds of executables, console ones and
non-console ones. Git's executables are all console ones.

When launching the former e.g. in a scheduled task, a CMD window pops
up. This is not what we want for the tasks installed via the `git
maintenance` command.

To work around this, let's introduce `headless-git.exe`, which is a
non-console program that does _not_ pop up any window. All it does is to
re-launch `git.exe`, suppressing that console window, passing through
all command-line arguments as-are.

Helped-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Helped-by: Yuyi Wang <Strawberry_Str@hotmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosequencer: simplify allocation of result array in todo_list_rearrange_squash()
Oswald Buddenhagen [Wed, 9 Aug 2023 17:15:32 +0000 (19:15 +0200)] 
sequencer: simplify allocation of result array in todo_list_rearrange_squash()

The operation doesn't change the number of elements in the array, so we do
not need to allocate the result piecewise.

This moves the re-assignment of todo_list->alloc at the end slighly up,
so it's right after the newly added assert which also refers to `nr`
(and which indeed should come first). Also, the value is more likely to
be still in a register at that point.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot9001: remove excessive GIT_SEND_EMAIL_NOTTY=1
Oswald Buddenhagen [Wed, 9 Aug 2023 17:15:31 +0000 (19:15 +0200)] 
t9001: remove excessive GIT_SEND_EMAIL_NOTTY=1

This was added by 3ece9bf0f9 (send-email: clear the $message_id after
validation, 2023-05-17) for no apparent reason, as this is required only
in cases when git's stdin is (must be) redirected, which isn't the case
here.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomv: handle lstat() failure correctly
Sebastian Thiel [Wed, 9 Aug 2023 07:47:41 +0000 (07:47 +0000)] 
mv: handle lstat() failure correctly

When moving a directory onto another with `git mv` various checks are
performed. One of of these validates that the destination is not existing.

When calling `lstat` on the destination path and it fails as the path
doesn't exist, some environments seem to overwrite the passed  in
`stat` memory nonetheless (I observed this issue on debian 12 of x86_64,
running on OrbStack on ARM, emulated with Rosetta).

This would affect the code that followed as it would still acccess a now
modified `st` structure, which now seems to contain uninitialized memory.
`S_ISDIR(st_dir_mode)` would then typically return false causing the code
to run into a bad case.

The fix avoids overwriting the existing `st` structure, providing an
alternative that exists only for that purpose.

Note that this patch minimizes complexity instead of stack-frame size.

Signed-off-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agobranch: error message checking out a branch in use
Rubén Justo [Mon, 7 Aug 2023 20:42:40 +0000 (22:42 +0200)] 
branch: error message checking out a branch in use

Let's update the error message we show when the user tries to check out
a branch which is being used in another worktree, following the
guideline reasoned in 4970bedef2 (branch: update the message to refuse
touching a branch in-use, 2023-07-21).

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoparse-options: disallow negating OPTION_SET_INT 0
René Scharfe [Tue, 8 Aug 2023 20:05:57 +0000 (22:05 +0200)] 
parse-options: disallow negating OPTION_SET_INT 0

An option of type OPTION_SET_INT can be defined to set its variable to
zero.  It's negated variant will do the same, though, which is
confusing.  Several such options were fixed by disabling negation,
changing the value to set or using a different option type:

991c552916 (ls-tree: fix --no-full-name, 2023-07-18)
e12cb98e1e (branch: reject "--no-all" and "--no-remotes" early, 2023-07-18)
68cbb20e73 (show-branch: reject --[no-](topo|date)-order, 2023-07-19)
3821eb6c3d (reset: reject --no-(mixed|soft|hard|merge|keep) option, 2023-07-19)
36f76d2a25 (pack-objects: fix --no-quiet, 2023-07-21)
3a5f308741 (pack-objects: fix --no-keep-true-parents, 2023-07-21)
c95ae3ff9c (describe: fix --no-exact-match, 2023-07-21)
d089a06421 (bundle: use OPT_PASSTHRU_ARGV, 2023-07-29)

Check for such options that allow negation in parse_options_check() and
report them to find future cases quicker.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorepack: free geometry struct
Jeff King [Tue, 8 Aug 2023 18:50:23 +0000 (14:50 -0400)] 
repack: free geometry struct

When the program is ending, we call clear_pack_geometry() to free any
resources in the pack_geometry struct. But the struct itself is
allocated on the heap, and leak-checkers will complain about the
resulting small leak.

This one was marked by Coverity as a "new" leak, though it has existed
since 0fabafd0b9 (builtin/repack.c: add '--geometric' option,
2021-02-22). This might be because recent unrelated changes in the file
confused it about what is new and what is not. But regardless, it is
worth addressing.

We can fix it easily by free-ing the struct. We'll convert our "clear"
function to "free", since the allocation happens in the matching init()
function (though since there is only one call to each, and the struct is
local to this file, it's mostly academic).

Another option would be to put the struct on the stack rather than the
heap. However, this gets tricky, as we check the pointer against NULL in
several places to decide whether we're in geometric mode.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosend-email: avoid creating more than one Term::ReadLine object
Jeff King [Tue, 8 Aug 2023 18:15:31 +0000 (14:15 -0400)] 
send-email: avoid creating more than one Term::ReadLine object

Every time git-send-email calls its ask() function to prompt the user,
we call term(), which instantiates a new Term::ReadLine object. But in
v1.46 of Term::ReadLine::Gnu (which provides the Term::ReadLine
interface on some platforms), its constructor refuses to create a second
instance[1]. So on systems with that version of the module, most
git-send-email instances will fail (as we usually prompt for both "to"
and "in-reply-to" unless the user provided them on the command line).

We can fix this by keeping a single instance variable and returning it
for each call to term(). In perl 5.10 and up, we could do that with a
"state" variable. But since we only require 5.008, we'll do it the
old-fashioned way, with a lexical "my" in its own scope.

Note that the tests in t9001 detect this problem as-is, since the
failure mode is for the program to die. But let's also beef up the
"Prompting works" test to check that it correctly handles multiple
inputs (if we had chosen to keep our FakeTerm hack in the previous
commit, then the failure mode would be incorrectly ignoring prompts
after the first).

[1] For discussion of why multiple instances are forbidden, see:
    https://github.com/hirooih/perl-trg/issues/16

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosend-email: drop FakeTerm hack
Jeff King [Tue, 8 Aug 2023 18:14:36 +0000 (14:14 -0400)] 
send-email: drop FakeTerm hack

Back in 280242d1cc (send-email: do not barf when Term::ReadLine does not
like your terminal, 2006-07-02), we added a fallback for when
Term::ReadLine's constructor failed: we'd have a FakeTerm object
instead, which would then die if anybody actually tried to call
readline() on it. Since we instantiated the $term variable at program
startup, we needed this workaround to let the program run in modes when
we did not prompt the user.

But later, in f4dc9432fd (send-email: lazily load modules for a big
speedup, 2021-05-28), we started loading Term::ReadLine lazily only when
ask() is called. So at that point we know we're trying to prompt the
user, and we can just die if ReadLine instantiation fails, rather than
making this fake object to lazily delay showing the error.

This should be OK even if there is no tty (e.g., we're in a cron job),
because Term::ReadLine will return a stub object in that case whose "IN"
and "OUT" functions return undef. And since 5906f54e47 (send-email:
don't attempt to prompt if tty is closed, 2009-03-31), we check for that
case and skip prompting.

And we can be sure that FakeTerm was not kicking in for such a
situation, because it has actually been broken since that commit! It
does not define "IN" or "OUT" methods, so perl would barf with an error.
If FakeTerm was in use, we were neither honoring what 5906f54e47 tried
to do, nor producing the readable message that 280242d1cc intended.

So we're better off just dropping FakeTerm entirely, and letting the
error reported by constructing Term::ReadLine through.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot0040: declare non-tab indentation to be okay in this script
Johannes Schindelin [Tue, 8 Aug 2023 10:37:34 +0000 (10:37 +0000)] 
t0040: declare non-tab indentation to be okay in this script

By necessity, this script needs to verify that certain Git output
matches expectations, including text indented with spaces instead of
tabs.

Most recently, such a check was introduced in 448abbba6347 (short help:
allow multi-line opthelp, 2023-07-18) which is reported by `git diff
--check 448abbba6347^!` as having whitespace issues.

Let's not complain about this because it is intentional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agobranch: error message deleting a branch in use
Rubén Justo [Mon, 7 Aug 2023 20:42:36 +0000 (22:42 +0200)] 
branch: error message deleting a branch in use

Let's update the error message we show when the user tries to delete a
branch which is being used in another worktree, following the guideline
reasoned in 4970bedef2 (branch: update the message to refuse touching a
branch in-use, 2023-07-21).

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoadvice: handle "rebase" in error_resolve_conflict()
Oswald Buddenhagen [Mon, 7 Aug 2023 17:09:35 +0000 (19:09 +0200)] 
advice: handle "rebase" in error_resolve_conflict()

This makes sure that we get a properly translated message rather than
inserting the command (which we failed to translate) into a generic
fallback message.

The function is called indirectly via die_resolve_conflict() with fixed
strings, and directly with the string obtained via action_name(), which
in turn returns a string from a fixed set. Hence we know that the now
covered set of strings is exhausitive, and will therefore BUG() out when
encountering an unexpected string. We also know that all covered strings
are actually used.

Arguably, the above suggests that it would be cleaner to pass the
command as an enum in the first place, but that's left for another time.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently
Oswald Buddenhagen [Mon, 7 Aug 2023 17:09:34 +0000 (19:09 +0200)] 
t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently

Default next action after 'fakesha' to preserving the command instead
of forcing 'pick', consistently with other "instant-effect" keywords.
There is no reason why one would want that inconsistency, so this was
clearly just an oversight in commit 5dcdd740 ("t/lib-rebase: prepare
for testing `git rebase --rebase-merges`"). Rectifying it makes the
behavior easier to reason about and document.

This would affect hypothetical "fakesha <n>" sequences where line <n>
already isn't a pick, which currently don't appear.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot/lib-rebase: set_fake_editor(): fix recognition of reset's short command
Oswald Buddenhagen [Mon, 7 Aug 2023 17:09:33 +0000 (19:09 +0200)] 
t/lib-rebase: set_fake_editor(): fix recognition of reset's short command

... in FAKE_LINES.

This has been broken ever since it was introduced in 5dcdd7409a
(t/lib-rebase: prepare for testing `git rebase --rebase-merges`,
2019-07-31), but it's not actually used, so it's a cosmetic defect
only.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoA few more topics before -rc1
Junio C Hamano [Mon, 7 Aug 2023 17:18:48 +0000 (10:18 -0700)] 
A few more topics before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agomailmap: change primary address for Glen Choo
Glen Choo [Mon, 7 Aug 2023 18:41:50 +0000 (18:41 +0000)] 
mailmap: change primary address for Glen Choo

Glen will lose access to his work email soon.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'ew/sha256-gcrypt-leak-fixes'
Junio C Hamano [Mon, 7 Aug 2023 18:57:18 +0000 (11:57 -0700)] 
Merge branch 'ew/sha256-gcrypt-leak-fixes'

Leakfixes.

* ew/sha256-gcrypt-leak-fixes:
  sha256/gcrypt: die on gcry_md_open failures
  sha256/gcrypt: fix memory leak with SHA-256 repos
  sha256/gcrypt: fix build with SANITIZE=leak

10 months agoMerge branch 'rs/bundle-parseopt-cleanup'
Junio C Hamano [Mon, 7 Aug 2023 18:57:18 +0000 (11:57 -0700)] 
Merge branch 'rs/bundle-parseopt-cleanup'

Code clean-up.

* rs/bundle-parseopt-cleanup:
  bundle: use OPT_PASSTHRU_ARGV

10 months agoMerge branch 'am/doc-sha256'
Junio C Hamano [Mon, 7 Aug 2023 18:57:18 +0000 (11:57 -0700)] 
Merge branch 'am/doc-sha256'

Tone down the warning on SHA-256 repositories being an experimental
curiosity.  We do not have support for them to interoperate with
traditional SHA-1 repositories, but at this point, we do not plan
to make breaking changes to SHA-256 repositories and there is no
longer need for such a strongly phrased warning.

* am/doc-sha256:
  doc: sha256 is no longer experimental

10 months agoMerge branch 'tb/commit-graph-tests'
Junio C Hamano [Mon, 7 Aug 2023 18:57:18 +0000 (11:57 -0700)] 
Merge branch 'tb/commit-graph-tests'

Test updates.

* tb/commit-graph-tests:
  t/lib-commit-graph.sh: avoid sub-shell in `graph_git_behavior()`
  t5328: avoid top-level directory changes
  t5318: avoid top-level directory changes
  t/lib-commit-graph.sh: avoid directory change in `graph_git_behavior()`
  t/lib-commit-graph.sh: allow `graph_read_expect()` in sub-directories

10 months agol10n: po-id for 2.42 (round 1)
Bagas Sanjaya [Sun, 6 Aug 2023 11:19:52 +0000 (18:19 +0700)] 
l10n: po-id for 2.42 (round 1)

Update following components:

* commit-graph.c
* diff-no-index.c
* builtin/notes.c
* builtin/pack-refs.c
* builtin/worktree.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
10 months agoMerge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru
Jiang Xin [Sat, 5 Aug 2023 15:26:39 +0000 (23:26 +0800)] 
Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru

* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
  l10n: ru.po: update Russian translation