Skip to content

Commit 62a26b3

Browse files
committed
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() ...
2 parents 450f2c9 + f1ed9d7 commit 62a26b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+728
-369
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
/TAGS
223223
/cscope*
224224
/compile_commands.json
225+
/.cache/
225226
*.hcc
226227
*.obj
227228
*.lib

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Frank Lichtenheld <[email protected]> <[email protected]>
8080
8181
Frédéric Heitzmann <[email protected]>
8282
83+
8384
8485
8586

Documentation/RelNotes/2.42.0.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ UI, Workflows & Features
3838
being bisected or rebased. The message was reworded to say the
3939
branch was "in use".
4040

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

4248
Performance, Internal Implementation, Development Support etc.
4349

@@ -252,6 +258,36 @@ Fixes since v2.41
252258
submodule.<name>.update configuration variable.
253259
(merge 7cebc5bd78 pv/doc-submodule-update-settings later to maint).
254260

261+
* Adjust to OpenSSL 3+, which deprecates its SHA-1 functions based on
262+
its traditional API, by using its EVP API instead.
263+
(merge bda9c12073 ew/hash-with-openssl-evp later to maint).
264+
265+
* Exclude "." from the set of characters to be removed from the
266+
beginning and the end of the human-readable name.
267+
(merge 1c04cb0744 bc/ident-dot-is-no-longer-crud-letter later to maint).
268+
269+
* "git bisect visualize" stopped running "gitk" on Git for Windows
270+
when the command was reimplemented in C around Git 2.34 timeframe.
271+
This has been corrected.
272+
(merge fff1594fa7 ma/locate-in-path-for-windows later to maint).
273+
274+
* "git rebase -i" with a series of squash/fixup, when one of the
275+
steps stopped in conflicts and ended up getting skipped, did not
276+
handle the accumulated commit log messages, which has been
277+
corrected.
278+
(merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).
279+
280+
* Adjust to newer Term::ReadLine to prevent it from breaking
281+
the interactive prompt code in send-email.
282+
(merge c016726c2d jk/send-email-with-new-readline later to maint).
283+
284+
* Windows updates.
285+
(merge 0050f8e401 ds/maintenance-on-windows-fix later to maint).
286+
287+
* Correct use of lstat() that assumed a failing call would not
288+
clobber the statbuf.
289+
(merge 72695d8214 st/mv-lstat-fix later to maint).
290+
255291
* Other code cleanup, docfix, build fix, etc.
256292
(merge 51f9d2e563 sa/doc-ls-remote later to maint).
257293
(merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
@@ -286,3 +322,8 @@ Fixes since v2.41
286322
(merge c95ae3ff9c rs/describe-parseopt-fix later to maint).
287323
(merge 36f76d2a25 rs/pack-objects-parseopt-fix later to maint).
288324
(merge 30c8c55cbf jc/tree-walk-drop-base-offset later to maint).
325+
(merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
326+
(merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
327+
(merge a5c01603b3 bc/ignore-clangd-cache later to maint).
328+
(merge 12009a182b js/allow-t4000-to-be-indented-with-spaces later to maint).
329+
(merge b3dcd24b8a jc/send-email-pre-process-fix later to maint).

Documentation/git-bisect.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@ as an alternative to `visualize`):
204204
$ git bisect visualize
205205
------------
206206

207-
If the `DISPLAY` environment variable is not set, 'git log' is used
208-
instead. You can also give command-line options such as `-p` and
209-
`--stat`.
207+
Git detects a graphical environment through various environment variables:
208+
`DISPLAY`, which is set in X Window System environments on Unix systems.
209+
`SESSIONNAME`, which is set under Cygwin in interactive desktop sessions.
210+
`MSYSTEM`, which is set under Msys2 and Git for Windows.
211+
`SECURITYSESSIONID`, which may be set on macOS in interactive desktop sessions.
212+
213+
If none of these environment variables is set, 'git log' is used instead.
214+
You can also give command-line options such as `-p` and `--stat`.
210215

211216
------------
212217
$ git bisect visualize --stat

Documentation/git.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ double-quotes and respecting backslash escapes. E.g., the value
553553
If this variable is set, the default hash algorithm for new
554554
repositories will be set to this value. This value is
555555
ignored when cloning and the setting of the remote repository
556-
is always used. The default is "sha1". THIS VARIABLE IS
557-
EXPERIMENTAL! See `--object-format` in linkgit:git-init[1].
556+
is always used. The default is "sha1".
557+
See `--object-format` in linkgit:git-init[1].
558558

559559
Git Commits
560560
~~~~~~~~~~~
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and still
2-
in an early stage. A SHA-256 repository will in general not be able to
3-
share work with "regular" SHA-1 repositories. It should be assumed
4-
that, e.g., Git internal file formats in relation to SHA-256
5-
repositories may change in backwards-incompatible ways. Only use
6-
`--object-format=sha256` for testing purposes.
1+
Note: At present, there is no interoperability between SHA-256
2+
repositories and SHA-1 repositories.
3+
4+
Historically, we warned that SHA-256 repositories may later need
5+
backward incompatible changes when we introduce such interoperability
6+
features. Today, we only expect compatible changes. Furthermore, if such
7+
changes prove to be necessary, it can be expected that SHA-256 repositories
8+
created with today's Git will be usable by future versions of Git
9+
without data loss.

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
GVF=GIT-VERSION-FILE
4-
DEF_VER=v2.42.0-rc0
4+
DEF_VER=v2.42.0-rc2
55

66
LF='
77
'

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
27792779
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
27802780
endif
27812781

2782+
headless-git.o: compat/win32/headless.c GIT-CFLAGS
2783+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
2784+
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
2785+
2786+
headless-git$X: headless-git.o git.res GIT-LDFLAGS
2787+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
2788+
27822789
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
27832790
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
27842791

@@ -3216,6 +3223,12 @@ $(SP_OBJ): %.sp: %.c %.o
32163223
sparse: $(SP_OBJ)
32173224

32183225
EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
3226+
ifndef OPENSSL_SHA1
3227+
EXCEPT_HDRS += sha1/openssl.h
3228+
endif
3229+
ifndef OPENSSL_SHA256
3230+
EXCEPT_HDRS += sha256/openssl.h
3231+
endif
32193232
ifndef NETTLE_SHA256
32203233
EXCEPT_HDRS += sha256/nettle.h
32213234
endif
@@ -3652,6 +3665,7 @@ clean: profile-clean coverage-clean cocciclean
36523665
$(RM) po/git.pot po/git-core.pot
36533666
$(RM) git.res
36543667
$(RM) $(OBJECTS)
3668+
$(RM) headless-git.o
36553669
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
36563670
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
36573671
$(RM) $(TEST_PROGRAMS)
@@ -3680,6 +3694,7 @@ endif
36803694
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
36813695
ifdef MSVC
36823696
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3697+
$(RM) headless-git.o.pdb
36833698
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
36843699
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
36853700
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))

advice.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ int error_resolve_conflict(const char *me)
191191
error(_("Pulling is not possible because you have unmerged files."));
192192
else if (!strcmp(me, "revert"))
193193
error(_("Reverting is not possible because you have unmerged files."));
194+
else if (!strcmp(me, "rebase"))
195+
error(_("Rebasing is not possible because you have unmerged files."));
194196
else
195-
error(_("It is not possible to %s because you have unmerged files."),
196-
me);
197+
BUG("Unhandled conflict reason '%s'", me);
197198

198199
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
199200
/*

builtin/bundle.c

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,36 @@ static int parse_options_cmd_bundle(int argc,
6868
}
6969

7070
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
71-
int all_progress_implied = 1;
72-
int progress = isatty(STDERR_FILENO);
73-
struct strvec pack_opts;
71+
struct strvec pack_opts = STRVEC_INIT;
7472
int version = -1;
7573
int ret;
7674
struct option options[] = {
77-
OPT_SET_INT('q', "quiet", &progress,
78-
N_("do not show progress meter"), 0),
79-
OPT_SET_INT(0, "progress", &progress,
80-
N_("show progress meter"), 1),
81-
OPT_SET_INT_F(0, "all-progress", &progress,
82-
N_("historical; same as --progress"), 2,
83-
PARSE_OPT_HIDDEN),
84-
OPT_HIDDEN_BOOL(0, "all-progress-implied",
85-
&all_progress_implied,
86-
N_("historical; does nothing")),
75+
OPT_PASSTHRU_ARGV('q', "quiet", &pack_opts, NULL,
76+
N_("do not show progress meter"),
77+
PARSE_OPT_NOARG),
78+
OPT_PASSTHRU_ARGV(0, "progress", &pack_opts, NULL,
79+
N_("show progress meter"),
80+
PARSE_OPT_NOARG),
81+
OPT_PASSTHRU_ARGV(0, "all-progress", &pack_opts, NULL,
82+
N_("historical; same as --progress"),
83+
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
84+
OPT_PASSTHRU_ARGV(0, "all-progress-implied", &pack_opts, NULL,
85+
N_("historical; does nothing"),
86+
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
8787
OPT_INTEGER(0, "version", &version,
8888
N_("specify bundle format version")),
8989
OPT_END()
9090
};
9191
char *bundle_file;
9292

93+
if (isatty(STDERR_FILENO))
94+
strvec_push(&pack_opts, "--progress");
95+
strvec_push(&pack_opts, "--all-progress-implied");
96+
9397
argc = parse_options_cmd_bundle(argc, argv, prefix,
9498
builtin_bundle_create_usage, options, &bundle_file);
9599
/* bundle internals use argv[1] as further parameters */
96100

97-
strvec_init(&pack_opts);
98-
if (progress == 0)
99-
strvec_push(&pack_opts, "--quiet");
100-
else if (progress == 1)
101-
strvec_push(&pack_opts, "--progress");
102-
else if (progress == 2)
103-
strvec_push(&pack_opts, "--all-progress");
104-
if (progress && all_progress_implied)
105-
strvec_push(&pack_opts, "--all-progress-implied");
106-
107101
if (!startup_info->have_repository)
108102
die(_("Need a repository to create a bundle."));
109103
ret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
20682068
"</Settings>\n"
20692069
"<Actions Context=\"Author\">\n"
20702070
"<Exec>\n"
2071-
"<Command>\"%s\\git.exe\"</Command>\n"
2071+
"<Command>\"%s\\headless-git.exe\"</Command>\n"
20722072
"<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
20732073
"</Exec>\n"
20742074
"</Actions>\n"

builtin/mv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
184184
int src_dir_nr = 0, src_dir_alloc = 0;
185185
struct strbuf a_src_dir = STRBUF_INIT;
186186
enum update_mode *modes, dst_mode = 0;
187-
struct stat st;
187+
struct stat st, dest_st;
188188
struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
189189
struct lock_file lock_file = LOCK_INIT;
190190
struct cache_entry *ce;
@@ -304,7 +304,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
304304
goto act_on_entry;
305305
}
306306
if (S_ISDIR(st.st_mode)
307-
&& lstat(dst, &st) == 0) {
307+
&& lstat(dst, &dest_st) == 0) {
308308
bad = _("cannot move directory over file");
309309
goto act_on_entry;
310310
}

builtin/repack.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,15 +492,13 @@ static struct packed_git *get_preferred_pack(struct pack_geometry *geometry)
492492
return NULL;
493493
}
494494

495-
static void clear_pack_geometry(struct pack_geometry *geometry)
495+
static void free_pack_geometry(struct pack_geometry *geometry)
496496
{
497497
if (!geometry)
498498
return;
499499

500500
free(geometry->pack);
501-
geometry->pack_nr = 0;
502-
geometry->pack_alloc = 0;
503-
geometry->split = 0;
501+
free(geometry);
504502
}
505503

506504
struct midx_snapshot_ref_data {
@@ -1228,7 +1226,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
12281226
string_list_clear(&names, 1);
12291227
string_list_clear(&existing_nonkept_packs, 0);
12301228
string_list_clear(&existing_kept_packs, 0);
1231-
clear_pack_geometry(geometry);
1229+
free_pack_geometry(geometry);
12321230

12331231
return ret;
12341232
}

compat/mingw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,11 @@ static char *path_lookup(const char *cmd, int exe_only)
13471347
return prog;
13481348
}
13491349

1350+
char *mingw_locate_in_PATH(const char *cmd)
1351+
{
1352+
return path_lookup(cmd, 0);
1353+
}
1354+
13501355
static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c)
13511356
{
13521357
while (*s && *s != c)

compat/mingw.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options);
177177
#define kill mingw_kill
178178
int mingw_kill(pid_t pid, int sig);
179179

180+
#define locate_in_PATH mingw_locate_in_PATH
181+
char *mingw_locate_in_PATH(const char *cmd);
182+
180183
#ifndef NO_OPENSSL
181184
#include <openssl/ssl.h>
182185
static inline int mingw_SSL_set_fd(SSL *ssl, int fd)

0 commit comments

Comments
 (0)