Skip to content

Commit fa3fb26

Browse files
committed
Merge branch 'backports'
These topics already made it into git/git's main branch, and are backported for Git for Windows' benefit. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 6989800 + 2cda7cd commit fa3fb26

Some content is hidden

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

117 files changed

+2812
-1751
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ jobs:
145145
## Unzip and remove the artifact
146146
unzip artifacts.zip
147147
rm artifacts.zip
148-
- name: generate Visual Studio solution
149-
shell: powershell
150-
run: |
151-
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
152-
make NDEBUG=1 DEVELOPER=1 vcxproj
153-
"@
154-
if (!$?) { exit(1) }
155148
- name: download vcpkg artifacts
156149
shell: powershell
157150
run: |
@@ -163,6 +156,17 @@ jobs:
163156
Remove-Item compat.zip
164157
- name: add msbuild to PATH
165158
uses: microsoft/[email protected]
159+
- name: copy dlls to root
160+
shell: powershell
161+
run: |
162+
& compat\vcbuild\vcpkg_copy_dlls.bat release
163+
if (!$?) { exit(1) }
164+
- name: generate Visual Studio solution
165+
shell: bash
166+
run: |
167+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
168+
-DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
169+
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
166170
- name: MSBuild
167171
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
168172
- name: bundle artifact tar
@@ -171,8 +175,6 @@ jobs:
171175
MSVC: 1
172176
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
173177
run: |
174-
& compat\vcbuild\vcpkg_copy_dlls.bat release
175-
if (!$?) { exit(1) }
176178
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
177179
mkdir -p artifacts &&
178180
eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
@@ -203,7 +205,7 @@ jobs:
203205
- name: extract build artifacts
204206
shell: bash
205207
run: tar xf artifacts.tar.gz
206-
- name: test (parallel)
208+
- name: test
207209
shell: powershell
208210
env:
209211
MSYSTEM: MINGW64
@@ -214,12 +216,19 @@ jobs:
214216
# Let Git ignore the SDK and the test-cache
215217
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
216218
217-
cd t &&
218-
PATH=\"`$PWD/helper:`$PATH\" &&
219-
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
220-
`$(test-tool.exe path-utils slice-tests \
221-
${{matrix.nr}} 10 t[0-9]*.sh)
219+
ci/run-test-slice.sh ${{matrix.nr}} 10
222220
"@
221+
- name: ci/print-test-failures.sh
222+
if: failure()
223+
shell: powershell
224+
run: |
225+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
226+
- name: Upload failed tests' directories
227+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
228+
uses: actions/upload-artifact@v1
229+
with:
230+
name: failed-tests-windows
231+
path: ${{env.FAILED_TEST_ARTIFACTS}}
223232
regular:
224233
needs: ci-config
225234
if: needs.ci-config.outputs.enabled == 'yes'

Documentation/technical/api-parse-options.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ There are some macros to easily define options:
232232
will be overwritten, so this should only be used for options where
233233
the last one specified on the command line wins.
234234

235-
`OPT_PASSTHRU_ARGV(short, long, &argv_array_var, arg_str, description, flags)`::
235+
`OPT_PASSTHRU_ARGV(short, long, &strvec_var, arg_str, description, flags)`::
236236
Introduce an option where all instances of it on the command-line will
237-
be reconstructed into an argv_array. This is useful when you need to
237+
be reconstructed into a strvec. This is useful when you need to
238238
pass the command-line option, which can be specified multiple times,
239239
to another command.
240240

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,6 @@ LIB_OBJS += apply.o
828828
LIB_OBJS += archive-tar.o
829829
LIB_OBJS += archive-zip.o
830830
LIB_OBJS += archive.o
831-
LIB_OBJS += argv-array.o
832831
LIB_OBJS += attr.o
833832
LIB_OBJS += base85.o
834833
LIB_OBJS += bisect.o
@@ -986,6 +985,7 @@ LIB_OBJS += sigchain.o
986985
LIB_OBJS += split-index.o
987986
LIB_OBJS += stable-qsort.o
988987
LIB_OBJS += strbuf.o
988+
LIB_OBJS += strvec.o
989989
LIB_OBJS += streaming.o
990990
LIB_OBJS += string-list.o
991991
LIB_OBJS += sub-process.o

add-interactive.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -935,18 +935,18 @@ static int run_patch(struct add_i_state *s, const struct pathspec *ps,
935935
opts->prompt = N_("Patch update");
936936
count = list_and_choose(s, files, opts);
937937
if (count > 0) {
938-
struct argv_array args = ARGV_ARRAY_INIT;
938+
struct strvec args = STRVEC_INIT;
939939
struct pathspec ps_selected = { 0 };
940940

941941
for (i = 0; i < files->items.nr; i++)
942942
if (files->selected[i])
943-
argv_array_push(&args,
944-
files->items.items[i].string);
943+
strvec_push(&args,
944+
files->items.items[i].string);
945945
parse_pathspec(&ps_selected,
946946
PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,
947-
PATHSPEC_LITERAL_PATH, "", args.argv);
947+
PATHSPEC_LITERAL_PATH, "", args.v);
948948
res = run_add_p(s->r, ADD_P_ADD, NULL, &ps_selected);
949-
argv_array_clear(&args);
949+
strvec_clear(&args);
950950
clear_pathspec(&ps_selected);
951951
}
952952

@@ -976,18 +976,18 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,
976976
count = list_and_choose(s, files, opts);
977977
opts->flags = 0;
978978
if (count > 0) {
979-
struct argv_array args = ARGV_ARRAY_INIT;
979+
struct strvec args = STRVEC_INIT;
980980

981-
argv_array_pushl(&args, "git", "diff", "-p", "--cached",
982-
oid_to_hex(!is_initial ? &oid :
983-
s->r->hash_algo->empty_tree),
984-
"--", NULL);
981+
strvec_pushl(&args, "git", "diff", "-p", "--cached",
982+
oid_to_hex(!is_initial ? &oid :
983+
s->r->hash_algo->empty_tree),
984+
"--", NULL);
985985
for (i = 0; i < files->items.nr; i++)
986986
if (files->selected[i])
987-
argv_array_push(&args,
988-
files->items.items[i].string);
989-
res = run_command_v_opt(args.argv, 0);
990-
argv_array_clear(&args);
987+
strvec_push(&args,
988+
files->items.items[i].string);
989+
res = run_command_v_opt(args.v, 0);
990+
strvec_clear(&args);
991991
}
992992

993993
putchar('\n');

add-patch.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "add-interactive.h"
33
#include "strbuf.h"
44
#include "run-command.h"
5-
#include "argv-array.h"
5+
#include "strvec.h"
66
#include "pathspec.h"
77
#include "color.h"
88
#include "diff.h"
@@ -286,12 +286,12 @@ static void setup_child_process(struct add_p_state *s,
286286

287287
va_start(ap, cp);
288288
while ((arg = va_arg(ap, const char *)))
289-
argv_array_push(&cp->args, arg);
289+
strvec_push(&cp->args, arg);
290290
va_end(ap);
291291

292292
cp->git_cmd = 1;
293-
argv_array_pushf(&cp->env_array,
294-
INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
293+
strvec_pushf(&cp->env_array,
294+
INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
295295
}
296296

297297
static int parse_range(const char **p,
@@ -370,7 +370,7 @@ static int is_octal(const char *p, size_t len)
370370

371371
static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
372372
{
373-
struct argv_array args = ARGV_ARRAY_INIT;
373+
struct strvec args = STRVEC_INIT;
374374
const char *diff_algorithm = s->s.interactive_diff_algorithm;
375375
struct strbuf *plain = &s->plain, *colored = NULL;
376376
struct child_process cp = CHILD_PROCESS_INIT;
@@ -380,32 +380,32 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
380380
struct hunk *hunk = NULL;
381381
int res;
382382

383-
argv_array_pushv(&args, s->mode->diff_cmd);
383+
strvec_pushv(&args, s->mode->diff_cmd);
384384
if (diff_algorithm)
385-
argv_array_pushf(&args, "--diff-algorithm=%s", diff_algorithm);
385+
strvec_pushf(&args, "--diff-algorithm=%s", diff_algorithm);
386386
if (s->revision) {
387387
struct object_id oid;
388-
argv_array_push(&args,
389-
/* could be on an unborn branch */
390-
!strcmp("HEAD", s->revision) &&
391-
get_oid("HEAD", &oid) ?
392-
empty_tree_oid_hex() : s->revision);
388+
strvec_push(&args,
389+
/* could be on an unborn branch */
390+
!strcmp("HEAD", s->revision) &&
391+
get_oid("HEAD", &oid) ?
392+
empty_tree_oid_hex() : s->revision);
393393
}
394-
color_arg_index = args.argc;
394+
color_arg_index = args.nr;
395395
/* Use `--no-color` explicitly, just in case `diff.color = always`. */
396-
argv_array_pushl(&args, "--no-color", "-p", "--", NULL);
396+
strvec_pushl(&args, "--no-color", "-p", "--", NULL);
397397
for (i = 0; i < ps->nr; i++)
398-
argv_array_push(&args, ps->items[i].original);
398+
strvec_push(&args, ps->items[i].original);
399399

400400
setup_child_process(s, &cp, NULL);
401-
cp.argv = args.argv;
401+
cp.argv = args.v;
402402
res = capture_command(&cp, plain, 0);
403403
if (res) {
404-
argv_array_clear(&args);
404+
strvec_clear(&args);
405405
return error(_("could not parse diff"));
406406
}
407407
if (!plain->len) {
408-
argv_array_clear(&args);
408+
strvec_clear(&args);
409409
return 0;
410410
}
411411
strbuf_complete_line(plain);
@@ -415,11 +415,11 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
415415
const char *diff_filter = s->s.interactive_diff_filter;
416416

417417
setup_child_process(s, &colored_cp, NULL);
418-
xsnprintf((char *)args.argv[color_arg_index], 8, "--color");
419-
colored_cp.argv = args.argv;
418+
xsnprintf((char *)args.v[color_arg_index], 8, "--color");
419+
colored_cp.argv = args.v;
420420
colored = &s->colored;
421421
res = capture_command(&colored_cp, colored, 0);
422-
argv_array_clear(&args);
422+
strvec_clear(&args);
423423
if (res)
424424
return error(_("could not parse colored diff"));
425425

@@ -444,7 +444,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
444444
colored_p = colored->buf;
445445
colored_pend = colored_p + colored->len;
446446
}
447-
argv_array_clear(&args);
447+
strvec_clear(&args);
448448

449449
/* parse files and hunks */
450450
p = plain->buf;
@@ -1158,7 +1158,7 @@ static int run_apply_check(struct add_p_state *s,
11581158

11591159
setup_child_process(s, &cp,
11601160
"apply", "--check", NULL);
1161-
argv_array_pushv(&cp.args, s->mode->apply_check_args);
1161+
strvec_pushv(&cp.args, s->mode->apply_check_args);
11621162
if (pipe_command(&cp, s->buf.buf, s->buf.len, NULL, 0, NULL, 0))
11631163
return error(_("'git apply --cached' failed"));
11641164

@@ -1619,7 +1619,7 @@ static int patch_update_file(struct add_p_state *s,
16191619
s->mode->is_reverse);
16201620
else {
16211621
setup_child_process(s, &cp, "apply", NULL);
1622-
argv_array_pushv(&cp.args, s->mode->apply_args);
1622+
strvec_pushv(&cp.args, s->mode->apply_args);
16231623
if (pipe_command(&cp, s->buf.buf, s->buf.len,
16241624
NULL, 0, NULL, 0))
16251625
error(_("'git apply' failed"));

argv-array.c

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)