summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format2
-rw-r--r--Documentation/BreakingChanges.adoc2
-rw-r--r--Documentation/MyFirstContribution.adoc11
-rw-r--r--Documentation/config/alias.adoc3
-rw-r--r--Documentation/config/extensions.adoc4
-rw-r--r--Documentation/config/mergetool.adoc2
-rw-r--r--Documentation/git-count-objects.adoc2
-rw-r--r--Documentation/git-fast-import.adoc8
-rw-r--r--Documentation/git-interpret-trailers.adoc8
-rw-r--r--Documentation/git-whatchanged.adoc8
-rw-r--r--Documentation/git.adoc5
-rw-r--r--Documentation/gitk.adoc8
-rw-r--r--Documentation/pretty-formats.adoc4
-rw-r--r--Makefile13
-rw-r--r--builtin/log.c8
-rw-r--r--builtin/pack-redundant.c2
-rw-r--r--git-compat-util.h2
-rw-r--r--git-curl-compat.h7
-rw-r--r--git.c91
-rw-r--r--http-push.c3
-rw-r--r--http.c8
-rw-r--r--http.h10
-rw-r--r--imap-send.c2
-rw-r--r--progress.c12
-rw-r--r--remote-curl.c14
-rw-r--r--t/Makefile14
-rwxr-xr-xt/t0014-alias.sh57
-rwxr-xr-xt/t5564-http-proxy.sh4
-rw-r--r--usage.c33
29 files changed, 245 insertions, 102 deletions
diff --git a/.clang-format b/.clang-format
index dcfd0aad60..86b4fe33e5 100644
--- a/.clang-format
+++ b/.clang-format
@@ -149,7 +149,7 @@ SpaceBeforeCaseColon: false
# f();
# }
# }
-SpaceBeforeParens: ControlStatements
+SpaceBeforeParens: ControlStatementsExceptControlMacros
# Don't insert spaces inside empty '()'
SpaceInEmptyParentheses: false
diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc
index f8d2eba061..c4985163c3 100644
--- a/Documentation/BreakingChanges.adoc
+++ b/Documentation/BreakingChanges.adoc
@@ -235,7 +235,7 @@ These features will be removed.
equivalent `git log --raw`. We have nominated the command for
removal, have changed the command to refuse to work unless the
`--i-still-use-this` option is given, and asked the users to report
- when they do so. So far there hasn't been a single complaint.
+ when they do so.
+
The command will be removed.
diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc
index aca7212cfe..bbb7b45bd4 100644
--- a/Documentation/MyFirstContribution.adoc
+++ b/Documentation/MyFirstContribution.adoc
@@ -908,10 +908,13 @@ Now you should be able to go and check out your newly created branch on GitHub.
=== Sending a PR to GitGitGadget
In order to have your code tested and formatted for review, you need to start by
-opening a Pull Request against `gitgitgadget/git`. Head to
-https://github.com/gitgitgadget/git and open a PR either with the "New pull
-request" button or the convenient "Compare & pull request" button that may
-appear with the name of your newly pushed branch.
+opening a Pull Request against either `gitgitgadget/git` or `git/git`. Head to
+https://github.com/gitgitgadget/git or https://github.com/git/git and open a PR
+either with the "New pull request" button or the convenient "Compare & pull
+request" button that may appear with the name of your newly pushed branch.
+
+The differences between using `gitgitgadget/git` and `git/git` as your base can
+be found [here](https://gitgitgadget.github.io/#should-i-use-gitgitgadget-on-gitgitgadgets-git-fork-or-on-gits-github-mirror)
Review the PR's title and description, as they're used by GitGitGadget
respectively as the subject and body of the cover letter for your change. Refer
diff --git a/Documentation/config/alias.adoc b/Documentation/config/alias.adoc
index 2c5db0ad84..3c8fab3a95 100644
--- a/Documentation/config/alias.adoc
+++ b/Documentation/config/alias.adoc
@@ -3,7 +3,8 @@ alias.*::
after defining `alias.last = cat-file commit HEAD`, the invocation
`git last` is equivalent to `git cat-file commit HEAD`. To avoid
confusion and troubles with script usage, aliases that
- hide existing Git commands are ignored. Arguments are split by
+ hide existing Git commands are ignored except for deprecated
+ commands. Arguments are split by
spaces, the usual shell quoting and escaping are supported.
A quote pair or a backslash can be used to quote them.
+
diff --git a/Documentation/config/extensions.adoc b/Documentation/config/extensions.adoc
index 9e2f321a6d..829f2523fc 100644
--- a/Documentation/config/extensions.adoc
+++ b/Documentation/config/extensions.adoc
@@ -14,6 +14,10 @@ compatObjectFormat::
compatObjectFormat. As well as being able to use oids encoded in
compatObjectFormat in addition to oids encoded with objectFormat to
locally specify objects.
++
+Note that the functionality enabled by this extension is incomplete and subject
+to change. It currently exists only to allow development and testing of
+the underlying feature and is not designed to be enabled by end users.
noop::
This extension does not change git's behavior at all. It is useful only
diff --git a/Documentation/config/mergetool.adoc b/Documentation/config/mergetool.adoc
index 6be506145c..7064f5a462 100644
--- a/Documentation/config/mergetool.adoc
+++ b/Documentation/config/mergetool.adoc
@@ -65,7 +65,7 @@ endif::[]
During a merge, Git will automatically resolve as many conflicts as
possible and write the `$MERGED` file containing conflict markers around
any conflicts that it cannot resolve; `$LOCAL` and `$REMOTE` normally
- are the versions of the file from before Git`s conflict
+ are the versions of the file from before Git's conflict
resolution. This flag causes `$LOCAL` and `$REMOTE` to be overwritten so
that only the unresolved conflicts are presented to the merge tool. Can
be configured per-tool via the `mergetool.<tool>.hideResolved`
diff --git a/Documentation/git-count-objects.adoc b/Documentation/git-count-objects.adoc
index 97f9f12610..eeee6b9f7f 100644
--- a/Documentation/git-count-objects.adoc
+++ b/Documentation/git-count-objects.adoc
@@ -28,6 +28,8 @@ size: disk space consumed by loose objects, in KiB (unless -H is specified)
+
in-pack: the number of in-pack objects
+
+packs: the number of pack files
++
size-pack: disk space consumed by the packs, in KiB (unless -H is specified)
+
prune-packable: the number of loose objects that are also present in
diff --git a/Documentation/git-fast-import.adoc b/Documentation/git-fast-import.adoc
index 6f9763c11b..ecaa8b87bd 100644
--- a/Documentation/git-fast-import.adoc
+++ b/Documentation/git-fast-import.adoc
@@ -61,10 +61,10 @@ OPTIONS
currently impacts only the `export-marks`, `import-marks`, and
`import-marks-if-exists` feature commands.
+
- Only enable this option if you trust the program generating the
- fast-import stream! This option is enabled automatically for
- remote-helpers that use the `import` capability, as they are
- already trusted to run their own code.
+Only enable this option if you trust the program generating the
+fast-import stream! This option is enabled automatically for
+remote-helpers that use the `import` capability, as they are
+already trusted to run their own code.
Options for Frontends
~~~~~~~~~~~~~~~~~~~~~
diff --git a/Documentation/git-interpret-trailers.adoc b/Documentation/git-interpret-trailers.adoc
index 82c8780d93..fd335fe772 100644
--- a/Documentation/git-interpret-trailers.adoc
+++ b/Documentation/git-interpret-trailers.adoc
@@ -142,8 +142,8 @@ OPTIONS
provided with '--if-exists' overrides the `trailer.ifExists` and any
applicable `trailer.<keyAlias>.ifExists` configuration variables
and applies to all '--trailer' options until the next occurrence of
- '--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists, clear the
- effect of any previous use of '--if-exists, such that the relevant configuration
+ '--if-exists' or '--no-if-exists'. Upon encountering '--no-if-exists', clear the
+ effect of any previous use of '--if-exists', such that the relevant configuration
variables are no longer overridden. Possible actions are `addIfDifferent`,
`addIfDifferentNeighbor`, `add`, `replace` and `doNothing`.
@@ -154,8 +154,8 @@ OPTIONS
provided with '--if-missing' overrides the `trailer.ifMissing` and any
applicable `trailer.<keyAlias>.ifMissing` configuration variables
and applies to all '--trailer' options until the next occurrence of
- '--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing,
- clear the effect of any previous use of '--if-missing, such that the relevant
+ '--if-missing' or '--no-if-missing'. Upon encountering '--no-if-missing',
+ clear the effect of any previous use of '--if-missing', such that the relevant
configuration variables are no longer overridden. Possible actions are `doNothing`
or `add`.
diff --git a/Documentation/git-whatchanged.adoc b/Documentation/git-whatchanged.adoc
index d21484026f..436e219b7d 100644
--- a/Documentation/git-whatchanged.adoc
+++ b/Documentation/git-whatchanged.adoc
@@ -15,7 +15,7 @@ WARNING
-------
`git whatchanged` has been deprecated and is scheduled for removal in
a future version of Git, as it is merely `git log` with different
-default; `whatchanged` is not even shorter to type than `log --raw`.
+defaults.
DESCRIPTION
-----------
@@ -24,7 +24,11 @@ Shows commit logs and diff output each commit introduces.
New users are encouraged to use linkgit:git-log[1] instead. The
`whatchanged` command is essentially the same as linkgit:git-log[1]
-but defaults to showing the raw format diff output and skipping merges.
+but defaults to showing the raw format diff output and skipping merges:
+
+----
+git log --raw --no-merges
+----
The command is primarily kept for historical reasons; fingers of
many people who learned Git long before `git log` was invented by
diff --git a/Documentation/git.adoc b/Documentation/git.adoc
index 743b7b00e4..ce099e78b8 100644
--- a/Documentation/git.adoc
+++ b/Documentation/git.adoc
@@ -219,7 +219,8 @@ If you just want to run git as if it was started in `<path>` then use
List commands by group. This is an internal/experimental
option and may change or be removed in the future. Supported
groups are: builtins, parseopt (builtin commands that use
- parse-options), main (all commands in libexec directory),
+ parse-options), deprecated (deprecated builtins),
+ main (all commands in libexec directory),
others (all other commands in `$PATH` that have git- prefix),
list-<category> (see categories in command-list.txt),
nohelpers (exclude helper commands), alias and config
@@ -684,7 +685,7 @@ other
`GIT_PROGRESS_DELAY`::
A number controlling how many seconds to delay before showing
- optional progress indicators. Defaults to 2.
+ optional progress indicators. Defaults to 1.
`GIT_EDITOR`::
This environment variable overrides `$EDITOR` and `$VISUAL`.
diff --git a/Documentation/gitk.adoc b/Documentation/gitk.adoc
index 58ce40ddb1..5b34dcd077 100644
--- a/Documentation/gitk.adoc
+++ b/Documentation/gitk.adoc
@@ -163,16 +163,16 @@ used by default. If '$XDG_CONFIG_HOME' is not set it defaults to
History
-------
-Gitk was the first graphical repository browser. It's written in
-tcl/tk.
+Gitk was the first graphical repository browser, written by
+Paul Mackerras in Tcl/Tk.
'gitk' is actually maintained as an independent project, but stable
versions are distributed as part of the Git suite for the convenience
of end users.
-gitk-git/ comes from Paul Mackerras's gitk project:
+`gitk-git/` comes from Johannes Sixt's gitk project:
- git://ozlabs.org/~paulus/gitk
+ https://github.com/j6t/gitk
SEE ALSO
--------
diff --git a/Documentation/pretty-formats.adoc b/Documentation/pretty-formats.adoc
index 9ed0417fc8..618ddc4a0c 100644
--- a/Documentation/pretty-formats.adoc
+++ b/Documentation/pretty-formats.adoc
@@ -233,11 +233,11 @@ colon and zero or more comma-separated options. Option values may contain
literal formatting codes. These must be used for commas (`%x2C`) and closing
parentheses (`%x29`), due to their role in the option syntax.
+
-** `prefix=<value>`: Shown before the list of ref names. Defaults to "{nbsp}+(+".
+** `prefix=<value>`: Shown before the list of ref names. Defaults to "{nbsp}++(++".
** `suffix=<value>`: Shown after the list of ref names. Defaults to "+)+".
** `separator=<value>`: Shown between ref names. Defaults to "+,+{nbsp}".
** `pointer=<value>`: Shown between HEAD and the branch it points to, if any.
- Defaults to "{nbsp}+->+{nbsp}".
+ Defaults to "{nbsp}++->++{nbsp}".
** `tag=<value>`: Shown before tag names. Defaults to "`tag:`{nbsp}".
+
diff --git a/Makefile b/Makefile
index e11340c1ae..1f444eec3c 100644
--- a/Makefile
+++ b/Makefile
@@ -883,7 +883,9 @@ BUILT_INS += git-stage$X
BUILT_INS += git-status$X
BUILT_INS += git-switch$X
BUILT_INS += git-version$X
+ifndef WITH_BREAKING_CHANGES
BUILT_INS += git-whatchanged$X
+endif
# what 'all' will build but not install in gitexecdir
OTHER_PROGRAMS += git$X
@@ -3943,13 +3945,12 @@ unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) t/helper/test-tool$X
$(MAKE) -C t/ unit-tests
.PHONY: libgit-sys libgit-rs
-libgit-sys libgit-rs:
- $(QUIET)(\
- cd contrib/$@ && \
- cargo build \
- )
+libgit-sys:
+ $(QUIET)cargo build --manifest-path contrib/libgit-sys/Cargo.toml
+libgit-rs: libgit-sys
+ $(QUIET)cargo build --manifest-path contrib/libgit-rs/Cargo.toml
ifdef INCLUDE_LIBGIT_RS
-all:: libgit-sys libgit-rs
+all:: libgit-rs
endif
LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o
diff --git a/builtin/log.c b/builtin/log.c
index c2f8bbf863..1d1e6e9130 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -543,7 +543,13 @@ int cmd_whatchanged(int argc,
cmd_log_init(argc, argv, prefix, &rev, &opt, &cfg);
if (!cfg.i_still_use_this)
- you_still_use_that("git whatchanged");
+ you_still_use_that("git whatchanged",
+ _("\n"
+ "hint: You can replace 'git whatchanged <opts>' with:\n"
+ "hint:\tgit log <opts> --raw --no-merges\n"
+ "hint: Or make an alias:\n"
+ "hint:\tgit config set --global alias.whatchanged 'log --raw --no-merges'\n"
+ "\n"));
if (!rev.diffopt.output_format)
rev.diffopt.output_format = DIFF_FORMAT_RAW;
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index fe81c293e3..5d5ae4afa2 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -626,7 +626,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, s
}
if (!i_still_use_this)
- you_still_use_that("git pack-redundant");
+ you_still_use_that("git pack-redundant", NULL);
if (load_all_packs)
load_all();
diff --git a/git-compat-util.h b/git-compat-util.h
index 9408f463e3..398e0fac4f 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -460,7 +460,7 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
void show_usage_if_asked(int ac, const char **av, const char *err);
-NORETURN void you_still_use_that(const char *command_name);
+NORETURN void you_still_use_that(const char *command_name, const char *hint);
#ifndef NO_OPENSSL
#ifdef APPLE_COMMON_CRYPTO
diff --git a/git-curl-compat.h b/git-curl-compat.h
index aa8eed7ed2..659e5a3875 100644
--- a/git-curl-compat.h
+++ b/git-curl-compat.h
@@ -46,6 +46,13 @@
#endif
/**
+ * curl_global_trace() was added in 8.3.0, released September 2023.
+ */
+#if LIBCURL_VERSION_NUM >= 0x080300
+#define GIT_CURL_HAVE_GLOBAL_TRACE 1
+#endif
+
+/**
* CURLOPT_TCP_KEEPCNT was added in 8.9.0, released in July, 2024.
*/
#if LIBCURL_VERSION_NUM >= 0x080900
diff --git a/git.c b/git.c
index 83eac0aeab..8c85da84c3 100644
--- a/git.c
+++ b/git.c
@@ -28,6 +28,7 @@
#define NEED_WORK_TREE (1<<3)
#define DELAY_PAGER_CONFIG (1<<4)
#define NO_PARSEOPT (1<<5) /* parse-options is not used */
+#define DEPRECATED (1<<6)
struct cmd_struct {
const char *cmd;
@@ -51,7 +52,9 @@ const char git_more_info_string[] =
static int use_pager = -1;
-static void list_builtins(struct string_list *list, unsigned int exclude_option);
+static void list_builtins(struct string_list *list,
+ unsigned int include_option,
+ unsigned int exclude_option);
static void exclude_helpers_from_list(struct string_list *list)
{
@@ -88,7 +91,7 @@ static int list_cmds(const char *spec)
int len = sep - spec;
if (match_token(spec, len, "builtins"))
- list_builtins(&list, 0);
+ list_builtins(&list, 0, 0);
else if (match_token(spec, len, "main"))
list_all_main_cmds(&list);
else if (match_token(spec, len, "others"))
@@ -99,6 +102,8 @@ static int list_cmds(const char *spec)
list_aliases(&list);
else if (match_token(spec, len, "config"))
list_cmds_by_config(&list);
+ else if (match_token(spec, len, "deprecated"))
+ list_builtins(&list, DEPRECATED, 0);
else if (len > 5 && !strncmp(spec, "list-", 5)) {
struct strbuf sb = STRBUF_INIT;
@@ -322,7 +327,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
if (!strcmp(cmd, "parseopt")) {
struct string_list list = STRING_LIST_INIT_DUP;
- list_builtins(&list, NO_PARSEOPT);
+ list_builtins(&list, 0, NO_PARSEOPT);
for (size_t i = 0; i < list.nr; i++)
printf("%s ", list.items[i].string);
string_list_clear(&list, 0);
@@ -360,7 +365,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
return (*argv) - orig_argv;
}
-static int handle_alias(struct strvec *args)
+static int handle_alias(struct strvec *args, struct string_list *expanded_aliases)
{
int envchanged = 0, ret = 0, saved_errno = errno;
int count, option_count;
@@ -371,6 +376,8 @@ static int handle_alias(struct strvec *args)
alias_command = args->v[0];
alias_string = alias_lookup(alias_command);
if (alias_string) {
+ struct string_list_item *seen;
+
if (args->nr == 2 && !strcmp(args->v[1], "-h"))
fprintf_ln(stderr, _("'%s' is aliased to '%s'"),
alias_command, alias_string);
@@ -418,6 +425,25 @@ static int handle_alias(struct strvec *args)
if (!strcmp(alias_command, new_argv[0]))
die(_("recursive alias: %s"), alias_command);
+ string_list_append(expanded_aliases, alias_command);
+ seen = unsorted_string_list_lookup(expanded_aliases,
+ new_argv[0]);
+
+ if (seen) {
+ struct strbuf sb = STRBUF_INIT;
+ for (size_t i = 0; i < expanded_aliases->nr; i++) {
+ struct string_list_item *item = &expanded_aliases->items[i];
+
+ strbuf_addf(&sb, "\n %s", item->string);
+ if (item == seen)
+ strbuf_addstr(&sb, " <==");
+ else if (i == expanded_aliases->nr - 1)
+ strbuf_addstr(&sb, " ==>");
+ }
+ die(_("alias loop detected: expansion of '%s' does"
+ " not terminate:%s"), expanded_aliases->items[0].string, sb.buf);
+ }
+
trace_argv_printf(new_argv,
"trace: alias expansion: %s =>",
alias_command);
@@ -590,7 +616,7 @@ static struct cmd_struct commands[] = {
{ "notes", cmd_notes, RUN_SETUP },
{ "pack-objects", cmd_pack_objects, RUN_SETUP },
#ifndef WITH_BREAKING_CHANGES
- { "pack-redundant", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT },
+ { "pack-redundant", cmd_pack_redundant, RUN_SETUP | NO_PARSEOPT | DEPRECATED },
#endif
{ "pack-refs", cmd_pack_refs, RUN_SETUP },
{ "patch-id", cmd_patch_id, RUN_SETUP_GENTLY | NO_PARSEOPT },
@@ -647,7 +673,7 @@ static struct cmd_struct commands[] = {
{ "verify-tag", cmd_verify_tag, RUN_SETUP },
{ "version", cmd_version },
#ifndef WITH_BREAKING_CHANGES
- { "whatchanged", cmd_whatchanged, RUN_SETUP },
+ { "whatchanged", cmd_whatchanged, RUN_SETUP | DEPRECATED },
#endif
{ "worktree", cmd_worktree, RUN_SETUP },
{ "write-tree", cmd_write_tree, RUN_SETUP },
@@ -668,11 +694,16 @@ int is_builtin(const char *s)
return !!get_builtin(s);
}
-static void list_builtins(struct string_list *out, unsigned int exclude_option)
+static void list_builtins(struct string_list *out,
+ unsigned int include_option,
+ unsigned int exclude_option)
{
+ if (include_option && exclude_option)
+ BUG("'include_option' and 'exclude_option' are mutually exclusive");
for (size_t i = 0; i < ARRAY_SIZE(commands); i++) {
- if (exclude_option &&
- (commands[i].option & exclude_option))
+ if (include_option && !(commands[i].option & include_option))
+ continue;
+ if (exclude_option && (commands[i].option & exclude_option))
continue;
string_list_append(out, commands[i].cmd);
}
@@ -793,14 +824,30 @@ static void execv_dashed_external(const char **argv)
exit(128);
}
+static int is_deprecated_command(const char *cmd)
+{
+ struct cmd_struct *builtin = get_builtin(cmd);
+ return builtin && (builtin->option & DEPRECATED);
+}
+
static int run_argv(struct strvec *args)
{
int done_alias = 0;
- struct string_list cmd_list = STRING_LIST_INIT_DUP;
- struct string_list_item *seen;
+ struct string_list expanded_aliases = STRING_LIST_INIT_DUP;
while (1) {
/*
+ * Allow deprecated commands to be overridden by aliases. This
+ * creates a seamless path forward for people who want to keep
+ * using the name after it is gone, but want to skip the
+ * deprecation complaint in the meantime.
+ */
+ if (is_deprecated_command(args->v[0]) &&
+ handle_alias(args, &expanded_aliases)) {
+ done_alias = 1;
+ continue;
+ }
+ /*
* If we tried alias and futzed with our environment,
* it no longer is safe to invoke builtins directly in
* general. We have to spawn them as dashed externals.
@@ -849,35 +896,17 @@ static int run_argv(struct strvec *args)
/* .. then try the external ones */
execv_dashed_external(args->v);
- seen = unsorted_string_list_lookup(&cmd_list, args->v[0]);
- if (seen) {
- struct strbuf sb = STRBUF_INIT;
- for (size_t i = 0; i < cmd_list.nr; i++) {
- struct string_list_item *item = &cmd_list.items[i];
-
- strbuf_addf(&sb, "\n %s", item->string);
- if (item == seen)
- strbuf_addstr(&sb, " <==");
- else if (i == cmd_list.nr - 1)
- strbuf_addstr(&sb, " ==>");
- }
- die(_("alias loop detected: expansion of '%s' does"
- " not terminate:%s"), cmd_list.items[0].string, sb.buf);
- }
-
- string_list_append(&cmd_list, args->v[0]);
-
/*
* It could be an alias -- this works around the insanity
* of overriding "git log" with "git show" by having
* alias.log = show
*/
- if (!handle_alias(args))
+ if (!handle_alias(args, &expanded_aliases))
break;
done_alias = 1;
}
- string_list_clear(&cmd_list, 0);
+ string_list_clear(&expanded_aliases, 0);
return done_alias;
}
diff --git a/http-push.c b/http-push.c
index 91a5465afb..7a9b96a6d0 100644
--- a/http-push.c
+++ b/http-push.c
@@ -208,7 +208,8 @@ static void curl_setup_http(CURL *curl, const char *url,
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_INFILE, buffer);
- curl_easy_setopt(curl, CURLOPT_INFILESIZE, buffer->buf.len);
+ curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
+ cast_size_t_to_curl_off_t(buffer->buf.len));
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
curl_easy_setopt(curl, CURLOPT_SEEKFUNCTION, seek_buffer);
curl_easy_setopt(curl, CURLOPT_SEEKDATA, buffer);
diff --git a/http.c b/http.c
index 98853d6483..a7d55dcbba 100644
--- a/http.c
+++ b/http.c
@@ -1348,6 +1348,14 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK)
die("curl_global_init failed");
+#ifdef GIT_CURL_HAVE_GLOBAL_TRACE
+ {
+ const char *comp = getenv("GIT_TRACE_CURL_COMPONENTS");
+ if (comp)
+ curl_global_trace(comp);
+ }
+#endif
+
if (proactive_auth && http_proactive_auth == PROACTIVE_AUTH_NONE)
http_proactive_auth = PROACTIVE_AUTH_IF_CREDENTIALS;
diff --git a/http.h b/http.h
index 36202139f4..0a36dbd294 100644
--- a/http.h
+++ b/http.h
@@ -8,6 +8,7 @@ struct packed_git;
#include <curl/curl.h>
#include <curl/easy.h>
+#include "gettext.h"
#include "strbuf.h"
#include "remote.h"
@@ -95,6 +96,15 @@ static inline int missing__target(int code, int result)
#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
+static inline curl_off_t cast_size_t_to_curl_off_t(size_t a)
+{
+ uintmax_t size = a;
+ if (size > maximum_signed_value_of_type(curl_off_t))
+ die(_("number too large to represent as curl_off_t "
+ "on this platform: %"PRIuMAX), (uintmax_t)a);
+ return (curl_off_t)a;
+}
+
/*
* Normalize curl results to handle CURL_FAILONERROR (or lack thereof). Failing
* http codes have their "result" converted to CURLE_HTTP_RETURNED_ERROR, and
diff --git a/imap-send.c b/imap-send.c
index 254ec83ab7..1de4dd2053 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1711,7 +1711,7 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
lf_to_crlf(&msgbuf.buf);
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
- (curl_off_t)(msgbuf.buf.len-prev_len));
+ cast_size_t_to_curl_off_t(msgbuf.buf.len-prev_len));
res = curl_easy_perform(curl);
diff --git a/progress.c b/progress.c
index 8d5ae70f3a..8315bdc3d4 100644
--- a/progress.c
+++ b/progress.c
@@ -114,16 +114,19 @@ static void display(struct progress *progress, uint64_t n, const char *done)
const char *tp;
struct strbuf *counters_sb = &progress->counters_sb;
int show_update = 0;
+ int update = !!progress_update;
int last_count_len = counters_sb->len;
- if (progress->delay && (!progress_update || --progress->delay))
+ progress_update = 0;
+
+ if (progress->delay && (!update || --progress->delay))
return;
progress->last_value = n;
tp = (progress->throughput) ? progress->throughput->display.buf : "";
if (progress->total) {
unsigned percent = n * 100 / progress->total;
- if (percent != progress->last_percent || progress_update) {
+ if (percent != progress->last_percent || update) {
progress->last_percent = percent;
strbuf_reset(counters_sb);
@@ -133,7 +136,7 @@ static void display(struct progress *progress, uint64_t n, const char *done)
tp);
show_update = 1;
}
- } else if (progress_update) {
+ } else if (update) {
strbuf_reset(counters_sb);
strbuf_addf(counters_sb, "%"PRIuMAX"%s", (uintmax_t)n, tp);
show_update = 1;
@@ -166,7 +169,6 @@ static void display(struct progress *progress, uint64_t n, const char *done)
}
fflush(stderr);
}
- progress_update = 0;
}
}
@@ -281,7 +283,7 @@ static int get_default_delay(void)
static int delay_in_secs = -1;
if (delay_in_secs < 0)
- delay_in_secs = git_env_ulong("GIT_PROGRESS_DELAY", 2);
+ delay_in_secs = git_env_ulong("GIT_PROGRESS_DELAY", 1);
return delay_in_secs;
}
diff --git a/remote-curl.c b/remote-curl.c
index 84f4694780..69f919454a 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -894,14 +894,6 @@ static int probe_rpc(struct rpc_state *rpc, struct slot_results *results)
return err;
}
-static curl_off_t xcurl_off_t(size_t len)
-{
- uintmax_t size = len;
- if (size > maximum_signed_value_of_type(curl_off_t))
- die(_("cannot handle pushes this big"));
- return (curl_off_t)size;
-}
-
/*
* If flush_received is true, do not attempt to read any more; just use what's
* in rpc->buf.
@@ -999,7 +991,7 @@ retry:
* and we just need to send it.
*/
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, gzip_body);
- curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, xcurl_off_t(gzip_size));
+ curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, cast_size_t_to_curl_off_t(gzip_size));
} else if (use_gzip && 1024 < rpc->len) {
/* The client backend isn't giving us compressed data so
@@ -1030,7 +1022,7 @@ retry:
headers = curl_slist_append(headers, "Content-Encoding: gzip");
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, gzip_body);
- curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, xcurl_off_t(gzip_size));
+ curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, cast_size_t_to_curl_off_t(gzip_size));
if (options.verbosity > 1) {
fprintf(stderr, "POST %s (gzip %lu to %lu bytes)\n",
@@ -1043,7 +1035,7 @@ retry:
* more normal Content-Length approach.
*/
curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, rpc->buf);
- curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, xcurl_off_t(rpc->len));
+ curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE_LARGE, cast_size_t_to_curl_off_t(rpc->len));
if (options.verbosity > 1) {
fprintf(stderr, "POST %s (%lu bytes)\n",
rpc->service_name, (unsigned long)rpc->len);
diff --git a/t/Makefile b/t/Makefile
index 757674e727..ab8a5b54aa 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -189,15 +189,9 @@ perf:
.PHONY: libgit-sys-test libgit-rs-test
libgit-sys-test:
- $(QUIET)(\
- cd ../contrib/libgit-sys && \
- cargo test \
- )
-libgit-rs-test:
- $(QUIET)(\
- cd ../contrib/libgit-rs && \
- cargo test \
- )
+ $(QUIET)cargo test --manifest-path ../contrib/libgit-sys/Cargo.toml
+libgit-rs-test: libgit-sys-test
+ $(QUIET)cargo test --manifest-path ../contrib/libgit-rs/Cargo.toml
ifdef INCLUDE_LIBGIT_RS
-all:: libgit-sys-test libgit-rs-test
+all:: libgit-rs-test
endif
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
index 854d59ec58..07a53e7366 100755
--- a/t/t0014-alias.sh
+++ b/t/t0014-alias.sh
@@ -27,6 +27,20 @@ test_expect_success 'looping aliases - internal execution' '
test_grep "^fatal: alias loop detected: expansion of" output
'
+test_expect_success 'looping aliases - deprecated builtins' '
+ test_config alias.whatchanged pack-redundant &&
+ test_config alias.pack-redundant whatchanged &&
+ cat >expect <<-EOF &&
+ ${SQ}whatchanged${SQ} is aliased to ${SQ}pack-redundant${SQ}
+ ${SQ}pack-redundant${SQ} is aliased to ${SQ}whatchanged${SQ}
+ fatal: alias loop detected: expansion of ${SQ}whatchanged${SQ} does not terminate:
+ whatchanged <==
+ pack-redundant ==>
+ EOF
+ test_must_fail git whatchanged -h 2>actual &&
+ test_cmp expect actual
+'
+
# This test is disabled until external loops are fixed, because would block
# the test suite for a full minute.
#
@@ -55,4 +69,47 @@ test_expect_success 'tracing a shell alias with arguments shows trace of prepare
test_cmp expect actual
'
+can_alias_deprecated_builtin () {
+ cmd="$1" &&
+ # some git(1) commands will fail for `-h` (the case for
+ # git-status as of 2025-09-07)
+ test_might_fail git status -h >expect &&
+ test_file_not_empty expect &&
+ test_might_fail git -c alias."$cmd"=status "$cmd" -h >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success 'can alias-shadow deprecated builtins' '
+ for cmd in $(git --list-cmds=deprecated)
+ do
+ can_alias_deprecated_builtin "$cmd" || return 1
+ done
+'
+
+test_expect_success 'can alias-shadow via two deprecated builtins' '
+ # some git(1) commands will fail... (see above)
+ test_might_fail git status -h >expect &&
+ test_file_not_empty expect &&
+ test_might_fail git -c alias.whatchanged=pack-redundant \
+ -c alias.pack-redundant=status whatchanged -h >actual &&
+ test_cmp expect actual
+'
+
+cannot_alias_regular_builtin () {
+ cmd="$1" &&
+ # some git(1) commands will fail... (see above)
+ test_might_fail git "$cmd" -h >expect &&
+ test_file_not_empty expect &&
+ test_might_fail git -c alias."$cmd"=status "$cmd" -h >actual &&
+ test_cmp expect actual
+}
+
+test_expect_success 'cannot alias-shadow a sample of regular builtins' '
+ for cmd in grep check-ref-format interpret-trailers \
+ checkout-index fast-import diagnose rev-list prune
+ do
+ cannot_alias_regular_builtin "$cmd" || return 1
+ done
+'
+
test_done
diff --git a/t/t5564-http-proxy.sh b/t/t5564-http-proxy.sh
index b27e481f95..c3903faf2d 100755
--- a/t/t5564-http-proxy.sh
+++ b/t/t5564-http-proxy.sh
@@ -72,7 +72,9 @@ test_expect_success SOCKS_PROXY 'clone via Unix socket' '
test_when_finished "rm -rf clone" &&
test_config_global http.proxy "socks4://localhost$PWD/%2530.sock" && {
{
- GIT_TRACE_CURL=$PWD/trace git clone "$HTTPD_URL/smart/repo.git" clone 2>err &&
+ GIT_TRACE_CURL=$PWD/trace \
+ GIT_TRACE_CURL_COMPONENTS=socks \
+ git clone "$HTTPD_URL/smart/repo.git" clone 2>err &&
grep -i "SOCKS4 request granted" trace
} ||
old_libcurl_error err
diff --git a/usage.c b/usage.c
index 81913236a4..7545a61645 100644
--- a/usage.c
+++ b/usage.c
@@ -7,6 +7,7 @@
#include "git-compat-util.h"
#include "gettext.h"
#include "trace2.h"
+#include "strbuf.h"
static void vfreportf(FILE *f, const char *prefix, const char *err, va_list params)
{
@@ -375,14 +376,32 @@ void bug_fl(const char *file, int line, const char *fmt, ...)
va_end(ap);
}
-NORETURN void you_still_use_that(const char *command_name)
+
+NORETURN void you_still_use_that(const char *command_name, const char *hint)
{
+ struct strbuf percent_encoded = STRBUF_INIT;
+ strbuf_add_percentencode(&percent_encoded,
+ command_name,
+ STRBUF_ENCODE_SLASH);
+
+ fprintf(stderr,
+ _("'%s' is nominated for removal.\n"), command_name);
+
+ if (hint)
+ fputs(hint, stderr);
+
fprintf(stderr,
- _("'%s' is nominated for removal.\n"
- "If you still use this command, please add an extra\n"
- "option, '--i-still-use-this', on the command line\n"
- "and let us know you still use it by sending an e-mail\n"
- "to <git@vger.kernel.org>. Thanks.\n"),
- command_name);
+ _("If you still use this command, here's what you can do:\n"
+ "\n"
+ "- read https://git-scm.com/docs/BreakingChanges.html\n"
+ "- check if anyone has discussed this on the mailing\n"
+ " list and if they came up with something that can\n"
+ " help you: https://lore.kernel.org/git/?q=%s\n"
+ "- send an email to <git@vger.kernel.org> to let us\n"
+ " know that you still use this command and were unable\n"
+ " to determine a suitable replacement\n"
+ "\n"),
+ percent_encoded.buf);
+ strbuf_release(&percent_encoded);
die(_("refusing to run without --i-still-use-this"));
}