summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-12-15 13:00:25 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-12-15 13:00:25 +0900
commitb21ebb671bb7dea8d342225f0d66c41f4e54d5ca (patch)
treed5e62fb29ab9d5a80a8d391dbc5b39971dfcce51
parentPrepare for 2.21 cycle to start soonish (diff)
parentGit 2.20.1 (diff)
downloadtgif-b21ebb671bb7dea8d342225f0d66c41f4e54d5ca.tar.xz
Sync with Git 2.20.1
* maint: Git 2.20.1 .gitattributes: ensure t/oid-info/* has eol=lf t9902: 'send-email' test case requires PERL t4256: mark support files as LF-only parse-options: fix SunCC compiler warning help -a: handle aliases with long names gracefully help.h: fix coding style run-command: report exec failure
-rw-r--r--.gitattributes1
-rw-r--r--Documentation/RelNotes/2.20.1.txt20
-rw-r--r--builtin/blame.c2
-rw-r--r--builtin/shortlog.c2
-rw-r--r--builtin/update-index.c2
-rw-r--r--help.c10
-rw-r--r--help.h2
-rw-r--r--parse-options.c4
-rw-r--r--parse-options.h1
-rw-r--r--run-command.c2
-rw-r--r--t/.gitattributes1
-rwxr-xr-xt/t0061-run-command.sh9
-rwxr-xr-xt/t9902-completion.sh2
13 files changed, 51 insertions, 7 deletions
diff --git a/.gitattributes b/.gitattributes
index acf853e029..9fa72ad450 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -9,6 +9,7 @@
/command-list.txt eol=lf
/GIT-VERSION-GEN eol=lf
/mergetools/* eol=lf
+/t/oid-info/* eol=lf
/Documentation/git-merge.txt conflict-marker-size=32
/Documentation/gitk.txt conflict-marker-size=32
/Documentation/user-manual.txt conflict-marker-size=32
diff --git a/Documentation/RelNotes/2.20.1.txt b/Documentation/RelNotes/2.20.1.txt
new file mode 100644
index 0000000000..dcba888dba
--- /dev/null
+++ b/Documentation/RelNotes/2.20.1.txt
@@ -0,0 +1,20 @@
+Git v2.20.1 Release Notes
+=========================
+
+This release is primarily to fix brown-paper-bag breakages in the
+2.20.0 release.
+
+Fixes since v2.20
+-----------------
+
+ * A few newly added tests were not portable and caused minority
+ platforms to report false breakages, which have been fixed.
+
+ * Portability fix for a recent update to parse-options API.
+
+ * "git help -a" did not work well when an overly long alias is
+ defined, which has been corrected.
+
+ * A recent update accidentally squelched an error message when the
+ run_command API failed to run a missing command, which has been
+ corrected.
diff --git a/builtin/blame.c b/builtin/blame.c
index 06a7163ffe..6d798f9939 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -850,6 +850,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
exit(129);
+ case PARSE_OPT_COMPLETE:
+ exit(0);
case PARSE_OPT_DONE:
if (ctx.argv[0])
dashdash_pos = ctx.cpidx;
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 88f88e97b2..65cd41392c 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -287,6 +287,8 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
exit(129);
+ case PARSE_OPT_COMPLETE:
+ exit(0);
case PARSE_OPT_DONE:
goto parse_done;
}
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 31e7cce301..e19da77edc 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -1086,6 +1086,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
exit(129);
+ case PARSE_OPT_COMPLETE:
+ exit(0);
case PARSE_OPT_NON_OPTION:
case PARSE_OPT_DONE:
{
diff --git a/help.c b/help.c
index 4745b32299..ff05fd22df 100644
--- a/help.c
+++ b/help.c
@@ -83,8 +83,9 @@ static void print_command_list(const struct cmdname_help *cmds,
for (i = 0; cmds[i].name; i++) {
if (cmds[i].category & mask) {
+ size_t len = strlen(cmds[i].name);
printf(" %s ", cmds[i].name);
- mput_char(' ', longest - strlen(cmds[i].name));
+ mput_char(' ', longest > len ? longest - len : 1);
puts(_(cmds[i].help));
}
}
@@ -526,6 +527,13 @@ void list_all_cmds_help(void)
git_config(get_alias, &alias_list);
string_list_sort(&alias_list);
+
+ for (i = 0; i < alias_list.nr; i++) {
+ size_t len = strlen(alias_list.items[i].string);
+ if (longest < len)
+ longest = len;
+ }
+
if (alias_list.nr) {
printf("\n%s\n", _("Command aliases"));
ALLOC_ARRAY(aliases, alias_list.nr + 1);
diff --git a/help.h b/help.h
index 9eab6a3f89..a141e209ae 100644
--- a/help.h
+++ b/help.h
@@ -15,7 +15,7 @@ struct cmdnames {
static inline void mput_char(char c, unsigned int num)
{
- while(num--)
+ while (num--)
putchar(c);
}
diff --git a/parse-options.c b/parse-options.c
index 3b874a83a0..6932eaff61 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -516,7 +516,7 @@ static int show_gitcomp(struct parse_opt_ctx_t *ctx,
show_negated_gitcomp(original_opts, -1);
show_negated_gitcomp(original_opts, nr_noopts);
fputc('\n', stdout);
- exit(0);
+ return PARSE_OPT_COMPLETE;
}
static int usage_with_options_internal(struct parse_opt_ctx_t *,
@@ -638,6 +638,8 @@ int parse_options(int argc, const char **argv, const char *prefix,
case PARSE_OPT_HELP:
case PARSE_OPT_ERROR:
exit(129);
+ case PARSE_OPT_COMPLETE:
+ exit(0);
case PARSE_OPT_NON_OPTION:
case PARSE_OPT_DONE:
break;
diff --git a/parse-options.h b/parse-options.h
index 6c4fe2016d..a650a7d220 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -208,6 +208,7 @@ extern int opterror(const struct option *opt, const char *reason, int flags);
/*----- incremental advanced APIs -----*/
enum {
+ PARSE_OPT_COMPLETE = -2,
PARSE_OPT_HELP = -1,
PARSE_OPT_DONE,
PARSE_OPT_NON_OPTION,
diff --git a/run-command.c b/run-command.c
index c11ff80674..3db26b7b0e 100644
--- a/run-command.c
+++ b/run-command.c
@@ -728,6 +728,8 @@ fail_pipe:
if (prepare_cmd(&argv, cmd) < 0) {
failed_errno = errno;
cmd->pid = -1;
+ if (!cmd->silent_exec_failure)
+ error_errno("cannot run %s", cmd->argv[0]);
goto end_of_spawn;
}
diff --git a/t/.gitattributes b/t/.gitattributes
index e7acedabe1..df05434d32 100644
--- a/t/.gitattributes
+++ b/t/.gitattributes
@@ -16,6 +16,7 @@ t[0-9][0-9][0-9][0-9]/* -whitespace
/t4135/* eol=lf
/t4211/* eol=lf
/t4252/* eol=lf
+/t4256/1/* eol=lf
/t5100/* eol=lf
/t5515/* eol=lf
/t556x_common eol=lf
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index cf932c8514..96bf6d6a7d 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -13,11 +13,13 @@ cat >hello-script <<-EOF
EOF
test_expect_success 'start_command reports ENOENT (slash)' '
- test-tool run-command start-command-ENOENT ./does-not-exist
+ test-tool run-command start-command-ENOENT ./does-not-exist 2>err &&
+ test_i18ngrep "\./does-not-exist" err
'
test_expect_success 'start_command reports ENOENT (no slash)' '
- test-tool run-command start-command-ENOENT does-not-exist
+ test-tool run-command start-command-ENOENT does-not-exist 2>err &&
+ test_i18ngrep "does-not-exist" err
'
test_expect_success 'run_command can run a command' '
@@ -33,7 +35,8 @@ test_expect_success 'run_command is restricted to PATH' '
write_script should-not-run <<-\EOF &&
echo yikes
EOF
- test_must_fail test-tool run-command run-command should-not-run
+ test_must_fail test-tool run-command run-command should-not-run 2>err &&
+ test_i18ngrep "should-not-run" err
'
test_expect_success !MINGW 'run_command can run a script without a #! line' '
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index d01ad8eb25..137fdc9bd5 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1539,7 +1539,7 @@ test_expect_success 'complete tree filename with metacharacters' '
EOF
'
-test_expect_success 'send-email' '
+test_expect_success PERL 'send-email' '
test_completion "git send-email --cov" "--cover-letter " &&
test_completion "git send-email ma" "master "
'