Skip to content

Commit

Permalink
Merge branch 'master' of github.com:git/git
Browse files Browse the repository at this point in the history
* '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()
  ...
  • Loading branch information
jiangxin committed Aug 15, 2023
2 parents 450f2c9 + f1ed9d7 commit 62a26b3
Show file tree
Hide file tree
Showing 42 changed files with 728 additions and 369 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
/TAGS
/cscope*
/compile_commands.json
/.cache/
*.hcc
*.obj
*.lib
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Frank Lichtenheld <frank@lichtenheld.de> <flichtenheld@astaro.com>
Fredrik Kuivinen <frekui@gmail.com> <freku045@student.liu.se>
Frédéric Heitzmann <frederic.heitzmann@gmail.com>
Garry Dolley <gdolley@ucla.edu> <gdolley@arpnetworks.com>
Glen Choo <glencbz@gmail.com> <chooglen@google.com>
Greg Price <price@mit.edu> <price@MIT.EDU>
Greg Price <price@mit.edu> <price@ksplice.com>
Heiko Voigt <hvoigt@hvoigt.net> <git-list@hvoigt.net>
Expand Down
41 changes: 41 additions & 0 deletions Documentation/RelNotes/2.42.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ UI, Workflows & Features
being bisected or rebased. The message was reworded to say the
branch was "in use".

* 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.


Performance, Internal Implementation, Development Support etc.

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

* Adjust to OpenSSL 3+, which deprecates its SHA-1 functions based on
its traditional API, by using its EVP API instead.
(merge bda9c12073 ew/hash-with-openssl-evp later to maint).

* Exclude "." from the set of characters to be removed from the
beginning and the end of the human-readable name.
(merge 1c04cb0744 bc/ident-dot-is-no-longer-crud-letter later to maint).

* "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.
(merge fff1594fa7 ma/locate-in-path-for-windows later to maint).

* "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.
(merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).

* Adjust to newer Term::ReadLine to prevent it from breaking
the interactive prompt code in send-email.
(merge c016726c2d jk/send-email-with-new-readline later to maint).

* Windows updates.
(merge 0050f8e401 ds/maintenance-on-windows-fix later to maint).

* Correct use of lstat() that assumed a failing call would not
clobber the statbuf.
(merge 72695d8214 st/mv-lstat-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 51f9d2e563 sa/doc-ls-remote later to maint).
(merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
Expand Down Expand Up @@ -286,3 +322,8 @@ Fixes since v2.41
(merge c95ae3ff9c rs/describe-parseopt-fix later to maint).
(merge 36f76d2a25 rs/pack-objects-parseopt-fix later to maint).
(merge 30c8c55cbf jc/tree-walk-drop-base-offset later to maint).
(merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
(merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
(merge a5c01603b3 bc/ignore-clangd-cache later to maint).
(merge 12009a182b js/allow-t4000-to-be-indented-with-spaces later to maint).
(merge b3dcd24b8a jc/send-email-pre-process-fix later to maint).
11 changes: 8 additions & 3 deletions Documentation/git-bisect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,14 @@ as an alternative to `visualize`):
$ git bisect visualize
------------

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

If none of these environment variables is set, 'git log' is used instead.
You can also give command-line options such as `-p` and `--stat`.

------------
$ git bisect visualize --stat
Expand Down
4 changes: 2 additions & 2 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ double-quotes and respecting backslash escapes. E.g., the value
If this variable is set, the default hash algorithm for new
repositories will be set to this value. This value is
ignored when cloning and the setting of the remote repository
is always used. The default is "sha1". THIS VARIABLE IS
EXPERIMENTAL! See `--object-format` in linkgit:git-init[1].
is always used. The default is "sha1".
See `--object-format` in linkgit:git-init[1].

Git Commits
~~~~~~~~~~~
Expand Down
15 changes: 9 additions & 6 deletions Documentation/object-format-disclaimer.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
THIS OPTION IS EXPERIMENTAL! SHA-256 support is experimental and still
in an early stage. A SHA-256 repository will in general not be able to
share work with "regular" SHA-1 repositories. It should be assumed
that, e.g., Git internal file formats in relation to SHA-256
repositories may change in backwards-incompatible ways. Only use
`--object-format=sha256` for testing purposes.
Note: At present, there is no interoperability between SHA-256
repositories and SHA-1 repositories.

Historically, we warned that SHA-256 repositories may later need
backward incompatible changes when we introduce such interoperability
features. Today, we only expect compatible changes. Furthermore, if such
changes prove to be necessary, it can be expected that SHA-256 repositories
created with today's Git will be usable by future versions of Git
without data loss.
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

GVF=GIT-VERSION-FILE
DEF_VER=v2.42.0-rc0
DEF_VER=v2.42.0-rc2

LF='
'
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
endif

headless-git.o: compat/win32/headless.c GIT-CFLAGS
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<

headless-git$X: headless-git.o git.res GIT-LDFLAGS
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res

git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)

Expand Down Expand Up @@ -3216,6 +3223,12 @@ $(SP_OBJ): %.sp: %.c %.o
sparse: $(SP_OBJ)

EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
ifndef OPENSSL_SHA1
EXCEPT_HDRS += sha1/openssl.h
endif
ifndef OPENSSL_SHA256
EXCEPT_HDRS += sha256/openssl.h
endif
ifndef NETTLE_SHA256
EXCEPT_HDRS += sha256/nettle.h
endif
Expand Down Expand Up @@ -3652,6 +3665,7 @@ clean: profile-clean coverage-clean cocciclean
$(RM) po/git.pot po/git-core.pot
$(RM) git.res
$(RM) $(OBJECTS)
$(RM) headless-git.o
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
$(RM) $(TEST_PROGRAMS)
Expand Down Expand Up @@ -3680,6 +3694,7 @@ endif
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
ifdef MSVC
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
$(RM) headless-git.o.pdb
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
Expand Down
5 changes: 3 additions & 2 deletions advice.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ int error_resolve_conflict(const char *me)
error(_("Pulling is not possible because you have unmerged files."));
else if (!strcmp(me, "revert"))
error(_("Reverting is not possible because you have unmerged files."));
else if (!strcmp(me, "rebase"))
error(_("Rebasing is not possible because you have unmerged files."));
else
error(_("It is not possible to %s because you have unmerged files."),
me);
BUG("Unhandled conflict reason '%s'", me);

if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
/*
Expand Down
40 changes: 17 additions & 23 deletions builtin/bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,42 +68,36 @@ static int parse_options_cmd_bundle(int argc,
}

static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
int all_progress_implied = 1;
int progress = isatty(STDERR_FILENO);
struct strvec pack_opts;
struct strvec pack_opts = STRVEC_INIT;
int version = -1;
int ret;
struct option options[] = {
OPT_SET_INT('q', "quiet", &progress,
N_("do not show progress meter"), 0),
OPT_SET_INT(0, "progress", &progress,
N_("show progress meter"), 1),
OPT_SET_INT_F(0, "all-progress", &progress,
N_("historical; same as --progress"), 2,
PARSE_OPT_HIDDEN),
OPT_HIDDEN_BOOL(0, "all-progress-implied",
&all_progress_implied,
N_("historical; does nothing")),
OPT_PASSTHRU_ARGV('q', "quiet", &pack_opts, NULL,
N_("do not show progress meter"),
PARSE_OPT_NOARG),
OPT_PASSTHRU_ARGV(0, "progress", &pack_opts, NULL,
N_("show progress meter"),
PARSE_OPT_NOARG),
OPT_PASSTHRU_ARGV(0, "all-progress", &pack_opts, NULL,
N_("historical; same as --progress"),
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
OPT_PASSTHRU_ARGV(0, "all-progress-implied", &pack_opts, NULL,
N_("historical; does nothing"),
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN),
OPT_INTEGER(0, "version", &version,
N_("specify bundle format version")),
OPT_END()
};
char *bundle_file;

if (isatty(STDERR_FILENO))
strvec_push(&pack_opts, "--progress");
strvec_push(&pack_opts, "--all-progress-implied");

argc = parse_options_cmd_bundle(argc, argv, prefix,
builtin_bundle_create_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */

strvec_init(&pack_opts);
if (progress == 0)
strvec_push(&pack_opts, "--quiet");
else if (progress == 1)
strvec_push(&pack_opts, "--progress");
else if (progress == 2)
strvec_push(&pack_opts, "--all-progress");
if (progress && all_progress_implied)
strvec_push(&pack_opts, "--all-progress-implied");

if (!startup_info->have_repository)
die(_("Need a repository to create a bundle."));
ret = !!create_bundle(the_repository, bundle_file, argc, argv, &pack_opts, version);
Expand Down
2 changes: 1 addition & 1 deletion builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
"</Settings>\n"
"<Actions Context=\"Author\">\n"
"<Exec>\n"
"<Command>\"%s\\git.exe\"</Command>\n"
"<Command>\"%s\\headless-git.exe\"</Command>\n"
"<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
"</Exec>\n"
"</Actions>\n"
Expand Down
4 changes: 2 additions & 2 deletions builtin/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
int src_dir_nr = 0, src_dir_alloc = 0;
struct strbuf a_src_dir = STRBUF_INIT;
enum update_mode *modes, dst_mode = 0;
struct stat st;
struct stat st, dest_st;
struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
struct lock_file lock_file = LOCK_INIT;
struct cache_entry *ce;
Expand Down Expand Up @@ -304,7 +304,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
goto act_on_entry;
}
if (S_ISDIR(st.st_mode)
&& lstat(dst, &st) == 0) {
&& lstat(dst, &dest_st) == 0) {
bad = _("cannot move directory over file");
goto act_on_entry;
}
Expand Down
8 changes: 3 additions & 5 deletions builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,13 @@ static struct packed_git *get_preferred_pack(struct pack_geometry *geometry)
return NULL;
}

static void clear_pack_geometry(struct pack_geometry *geometry)
static void free_pack_geometry(struct pack_geometry *geometry)
{
if (!geometry)
return;

free(geometry->pack);
geometry->pack_nr = 0;
geometry->pack_alloc = 0;
geometry->split = 0;
free(geometry);
}

struct midx_snapshot_ref_data {
Expand Down Expand Up @@ -1228,7 +1226,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
string_list_clear(&names, 1);
string_list_clear(&existing_nonkept_packs, 0);
string_list_clear(&existing_kept_packs, 0);
clear_pack_geometry(geometry);
free_pack_geometry(geometry);

return ret;
}
5 changes: 5 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,11 @@ static char *path_lookup(const char *cmd, int exe_only)
return prog;
}

char *mingw_locate_in_PATH(const char *cmd)
{
return path_lookup(cmd, 0);
}

static const wchar_t *wcschrnul(const wchar_t *s, wchar_t c)
{
while (*s && *s != c)
Expand Down
3 changes: 3 additions & 0 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ pid_t waitpid(pid_t pid, int *status, int options);
#define kill mingw_kill
int mingw_kill(pid_t pid, int sig);

#define locate_in_PATH mingw_locate_in_PATH
char *mingw_locate_in_PATH(const char *cmd);

#ifndef NO_OPENSSL
#include <openssl/ssl.h>
static inline int mingw_SSL_set_fd(SSL *ssl, int fd)
Expand Down
Loading

0 comments on commit 62a26b3

Please sign in to comment.