Skip to content

Commit 468d356

Browse files
committed
Merge tag 'v2.24.0-rc1' of github.com:git/git into master
Git 2.24-rc1 * tag 'v2.24.0-rc1' of github.com:git/git: Git 2.24-rc1 repo-settings: read an int for index.version ci: fix GCC install in the Travis CI GCC OSX job Eleventh batch ci(osx): use new location of the `perforce` cask t7419: change test_must_fail to ! for grep t4014: make output-directory tests self-contained ci(visual-studio): actually run the tests in parallel ci(visual-studio): use strict compile flags, and optimization userdiff: fix some corner cases in dts regex test-progress: fix test failures on big-endian systems completion: clarify installation instruction for zsh grep: avoid leak of chartables in PCRE2 grep: make PCRE2 aware of custom allocator grep: make PCRE1 aware of custom allocator remote-curl: pass on atomic capability to remote side diff-highlight: fix a whitespace nit fsmonitor: don't fill bitmap with entries to be removed
2 parents 370784e + 566a143 commit 468d356

27 files changed

+247
-29
lines changed

Documentation/RelNotes/2.24.0.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ UI, Workflows & Features
7575
submodules, but this did not apply to "git fetch --multiple" that
7676
fetches from multiple remote repositories. It now does.
7777

78+
* The installation instruction for zsh completion script (in
79+
contrib/) has been a bit improved.
80+
7881

7982
Performance, Internal Implementation, Development Support etc.
8083

@@ -337,6 +340,10 @@ Fixes since v2.23
337340
corrected.
338341
(merge 556895d0c8 jj/stash-reset-only-toplevel later to maint).
339342

343+
* The atomic push over smart HTTP transport did not work, which has
344+
been corrected.
345+
(merge 6f1194246a bc/smart-http-atomic-push later to maint).
346+
340347
* Other code cleanup, docfix, build fix, etc.
341348
(merge d1387d3895 en/fast-import-merge-doc later to maint).
342349
(merge 1c24a54ea4 bm/repository-layout-typofix later to maint).
@@ -385,3 +392,6 @@ Fixes since v2.23
385392
(merge 5cc6a4be11 rs/http-push-simplify later to maint).
386393
(merge a81e42d235 rs/column-use-utf8-strnwidth later to maint).
387394
(merge 062a309d36 rs/remote-curl-use-argv-array later to maint).
395+
(merge 3b3c79f6c9 nr/diff-highlight-indent-fix later to maint).
396+
(merge 3444ec2eb2 wb/fsmonitor-bitmap-fix later to maint).
397+
(merge 10da030ab7 cb/pcre2-chartables-leakfix later to maint).

Documentation/gitremote-helpers.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,11 @@ set by Git if the remote helper has the 'option' capability.
509509
Indicate that only the objects wanted need to be fetched, not
510510
their dependents.
511511

512+
'option atomic' {'true'|'false'}::
513+
When pushing, request the remote server to update refs in a single atomic
514+
transaction. If successful, all refs will be updated, or none will. If the
515+
remote side does not support this capability, the push will fail.
516+
512517
SEE ALSO
513518
--------
514519
linkgit:git-remote[1]

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.24.0-rc0
4+
DEF_VER=v2.24.0-rc1
55

66
LF='
77
'

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
displayName: 'Download git-sdk-64-minimal'
158158
- powershell: |
159159
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
160-
make vcxproj
160+
make NDEBUG=1 DEVELOPER=1 vcxproj
161161
"@
162162
if (!$?) { exit(1) }
163163
displayName: Generate Visual Studio Solution
@@ -255,7 +255,7 @@ jobs:
255255
256256
cd t &&
257257
PATH=\"`$PWD/helper:`$PATH\" &&
258-
test-tool.exe run-command testsuite -V -x --write-junit-xml \
258+
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
259259
`$(test-tool.exe path-utils slice-tests \
260260
`$SYSTEM_JOBPOSITIONINPHASE `$SYSTEM_TOTALJOBSINPHASE t[0-9]*.sh)
261261
"@

builtin/grep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,5 +1147,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
11471147
run_pager(&opt, prefix);
11481148
clear_pathspec(&pathspec);
11491149
free_grep_patterns(&opt);
1150+
grep_destroy();
11501151
return !hit;
11511152
}

ci/install-dependencies.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ osx-clang|osx-gcc)
4040
test -z "$BREW_INSTALL_PACKAGES" ||
4141
brew install $BREW_INSTALL_PACKAGES
4242
brew link --force gettext
43+
brew cask install perforce || {
44+
# Update the definitions and try again
45+
git -C "$(brew --repository)"/Library/Taps/homebrew/homebrew-cask pull &&
46+
brew cask install perforce
47+
} ||
4348
brew install caskroom/cask/perforce
4449
case "$jobname" in
4550
osx-gcc)
51+
brew link gcc ||
4652
brew link gcc@8
4753
;;
4854
esac

contrib/completion/git-completion.zsh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#
1212
# zstyle ':completion:*:*:git:*' script ~/.git-completion.zsh
1313
#
14-
# The recommended way to install this script is to copy to '~/.zsh/_git', and
15-
# then add the following to your ~/.zshrc file:
14+
# The recommended way to install this script is to make a copy of it in
15+
# ~/.zsh/ directory as ~/.zsh/git-completion.zsh and then add the following
16+
# to your ~/.zshrc file:
1617
#
1718
# fpath=(~/.zsh $fpath)
1819

contrib/diff-highlight/DiffHighlight.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ sub handle_line {
7272
(?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|"
7373
[ ]* # trailing whitespace for merges
7474
/x) {
75-
my $graph_prefix = $&;
75+
my $graph_prefix = $&;
7676

7777
# We must flush before setting graph indent, since the
7878
# new commit may be indented differently from what we

fsmonitor.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ struct trace_key trace_fsmonitor = TRACE_KEY_INIT(FSMONITOR);
1414
static void fsmonitor_ewah_callback(size_t pos, void *is)
1515
{
1616
struct index_state *istate = (struct index_state *)is;
17-
struct cache_entry *ce = istate->cache[pos];
17+
struct cache_entry *ce;
1818

19+
if (pos >= istate->cache_nr)
20+
BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" >= %u)",
21+
(uintmax_t)pos, istate->cache_nr);
22+
23+
ce = istate->cache[pos];
1924
ce->ce_flags &= ~CE_FSMONITOR_VALID;
2025
}
2126

@@ -50,17 +55,24 @@ int read_fsmonitor_extension(struct index_state *istate, const void *data,
5055
}
5156
istate->fsmonitor_dirty = fsmonitor_dirty;
5257

58+
if (istate->fsmonitor_dirty->bit_size > istate->cache_nr)
59+
BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > %u)",
60+
(uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
61+
5362
trace_printf_key(&trace_fsmonitor, "read fsmonitor extension successful");
5463
return 0;
5564
}
5665

5766
void fill_fsmonitor_bitmap(struct index_state *istate)
5867
{
59-
unsigned int i;
68+
unsigned int i, skipped = 0;
6069
istate->fsmonitor_dirty = ewah_new();
61-
for (i = 0; i < istate->cache_nr; i++)
62-
if (!(istate->cache[i]->ce_flags & CE_FSMONITOR_VALID))
63-
ewah_set(istate->fsmonitor_dirty, i);
70+
for (i = 0; i < istate->cache_nr; i++) {
71+
if (istate->cache[i]->ce_flags & CE_REMOVE)
72+
skipped++;
73+
else if (!(istate->cache[i]->ce_flags & CE_FSMONITOR_VALID))
74+
ewah_set(istate->fsmonitor_dirty, i - skipped);
75+
}
6476
}
6577

6678
void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate)
@@ -71,6 +83,10 @@ void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate)
7183
uint32_t ewah_size = 0;
7284
int fixup = 0;
7385

86+
if (istate->fsmonitor_dirty->bit_size > istate->cache_nr)
87+
BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > %u)",
88+
(uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
89+
7490
put_be32(&hdr_version, INDEX_EXTENSION_VERSION);
7591
strbuf_add(sb, &hdr_version, sizeof(uint32_t));
7692

@@ -236,6 +252,9 @@ void tweak_fsmonitor(struct index_state *istate)
236252
}
237253

238254
/* Mark all previously saved entries as dirty */
255+
if (istate->fsmonitor_dirty->bit_size > istate->cache_nr)
256+
BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > %u)",
257+
(uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
239258
ewah_each_bit(istate->fsmonitor_dirty, fsmonitor_ewah_callback, istate);
240259

241260
/* Now mark the untracked cache for fsmonitor usage */

grep.c

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ static int grep_source_is_binary(struct grep_source *gs,
1616

1717
static struct grep_opt grep_defaults;
1818

19+
#ifdef USE_LIBPCRE2
20+
static pcre2_general_context *pcre2_global_context;
21+
22+
static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
23+
{
24+
return malloc(size);
25+
}
26+
27+
static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)
28+
{
29+
return free(pointer);
30+
}
31+
#endif
32+
1933
static const char *color_grep_slots[] = {
2034
[GREP_COLOR_CONTEXT] = "context",
2135
[GREP_COLOR_FILENAME] = "filename",
@@ -150,12 +164,28 @@ int grep_config(const char *var, const char *value, void *cb)
150164
* Initialize one instance of grep_opt and copy the
151165
* default values from the template we read the configuration
152166
* information in an earlier call to git_config(grep_config).
167+
*
168+
* If using PCRE, make sure that the library is configured
169+
* to use the same allocator as Git (e.g. nedmalloc on Windows).
170+
*
171+
* Any allocated memory needs to be released in grep_destroy().
153172
*/
154173
void grep_init(struct grep_opt *opt, struct repository *repo, const char *prefix)
155174
{
156175
struct grep_opt *def = &grep_defaults;
157176
int i;
158177

178+
#if defined(USE_LIBPCRE2)
179+
if (!pcre2_global_context)
180+
pcre2_global_context = pcre2_general_context_create(
181+
pcre2_malloc, pcre2_free, NULL);
182+
#endif
183+
184+
#ifdef USE_LIBPCRE1
185+
pcre_malloc = malloc;
186+
pcre_free = free;
187+
#endif
188+
159189
memset(opt, 0, sizeof(*opt));
160190
opt->repo = repo;
161191
opt->prefix = prefix;
@@ -178,6 +208,13 @@ void grep_init(struct grep_opt *opt, struct repository *repo, const char *prefix
178208
color_set(opt->colors[i], def->colors[i]);
179209
}
180210

211+
void grep_destroy(void)
212+
{
213+
#ifdef USE_LIBPCRE2
214+
pcre2_general_context_free(pcre2_global_context);
215+
#endif
216+
}
217+
181218
static void grep_set_pattern_type_option(enum grep_pattern_type pattern_type, struct grep_opt *opt)
182219
{
183220
/*
@@ -461,7 +498,6 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
461498
PCRE2_UCHAR errbuf[256];
462499
PCRE2_SIZE erroffset;
463500
int options = PCRE2_MULTILINE;
464-
const uint8_t *character_tables = NULL;
465501
int jitret;
466502
int patinforet;
467503
size_t jitsizearg;
@@ -470,11 +506,15 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
470506

471507
p->pcre2_compile_context = NULL;
472508

509+
/* pcre2_global_context is initialized in append_grep_pattern */
473510
if (opt->ignore_case) {
474511
if (!opt->ignore_locale && has_non_ascii(p->pattern)) {
475-
character_tables = pcre2_maketables(NULL);
512+
if (!pcre2_global_context)
513+
BUG("pcre2_global_context uninitialized");
514+
p->pcre2_tables = pcre2_maketables(pcre2_global_context);
476515
p->pcre2_compile_context = pcre2_compile_context_create(NULL);
477-
pcre2_set_character_tables(p->pcre2_compile_context, character_tables);
516+
pcre2_set_character_tables(p->pcre2_compile_context,
517+
p->pcre2_tables);
478518
}
479519
options |= PCRE2_CASELESS;
480520
}
@@ -571,6 +611,7 @@ static void free_pcre2_pattern(struct grep_pat *p)
571611
pcre2_compile_context_free(p->pcre2_compile_context);
572612
pcre2_code_free(p->pcre2_pattern);
573613
pcre2_match_data_free(p->pcre2_match_data);
614+
free((void *)p->pcre2_tables);
574615
}
575616
#else /* !USE_LIBPCRE2 */
576617
static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)

grep.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct grep_pat {
7878
pcre2_code *pcre2_pattern;
7979
pcre2_match_data *pcre2_match_data;
8080
pcre2_compile_context *pcre2_compile_context;
81+
const uint8_t *pcre2_tables;
8182
uint32_t pcre2_jit_on;
8283
unsigned fixed:1;
8384
unsigned is_fixed:1;
@@ -172,6 +173,7 @@ struct grep_opt {
172173
void init_grep_defaults(struct repository *);
173174
int grep_config(const char *var, const char *value, void *);
174175
void grep_init(struct grep_opt *, struct repository *repo, const char *prefix);
176+
void grep_destroy(void);
175177
void grep_commit_pattern_type(enum grep_pattern_type, struct grep_opt *opt);
176178

177179
void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t);

remote-curl.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct options {
4040
push_cert : 2,
4141
deepen_relative : 1,
4242
from_promisor : 1,
43-
no_dependents : 1;
43+
no_dependents : 1,
44+
atomic : 1;
4445
};
4546
static struct options options;
4647
static struct string_list cas_options = STRING_LIST_INIT_DUP;
@@ -148,6 +149,14 @@ static int set_option(const char *name, const char *value)
148149
else
149150
return -1;
150151
return 0;
152+
} else if (!strcmp(name, "atomic")) {
153+
if (!strcmp(value, "true"))
154+
options.atomic = 1;
155+
else if (!strcmp(value, "false"))
156+
options.atomic = 0;
157+
else
158+
return -1;
159+
return 0;
151160
} else if (!strcmp(name, "push-option")) {
152161
if (*value != '"')
153162
string_list_append(&options.push_options, value);
@@ -1196,6 +1205,8 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
11961205
argv_array_push(&args, "--signed=yes");
11971206
else if (options.push_cert == SEND_PACK_PUSH_CERT_IF_ASKED)
11981207
argv_array_push(&args, "--signed=if-asked");
1208+
if (options.atomic)
1209+
argv_array_push(&args, "--atomic");
11991210
if (options.verbosity == 0)
12001211
argv_array_push(&args, "--quiet");
12011212
else if (options.verbosity > 1)

repo-settings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void prepare_repo_settings(struct repository *r)
2222
UPDATE_DEFAULT_BOOL(r->settings.core_commit_graph, 1);
2323
UPDATE_DEFAULT_BOOL(r->settings.gc_write_commit_graph, 1);
2424

25-
if (!repo_config_get_bool(r, "index.version", &value))
25+
if (!repo_config_get_int(r, "index.version", &value))
2626
r->settings.index_version = value;
2727
if (!repo_config_get_maybe_bool(r, "core.untrackedcache", &value)) {
2828
if (value == 0)

t/helper/test-progress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void progress_test_force_update(void);
2929

3030
int cmd__progress(int argc, const char **argv)
3131
{
32-
uint64_t total = 0;
32+
int total = 0;
3333
const char *title;
3434
struct strbuf line = STRBUF_INIT;
3535
struct progress *progress;

t/t1600-index.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ test_index_version () {
8787
}
8888

8989
test_expect_success 'index version config precedence' '
90+
test_index_version 0 false 0 2 &&
91+
test_index_version 2 false 0 2 &&
92+
test_index_version 3 false 0 2 &&
93+
test_index_version 4 false 0 4 &&
9094
test_index_version 2 false 4 4 &&
9195
test_index_version 2 true 0 2 &&
9296
test_index_version 0 true 0 4 &&

t/t4014-format-patch.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,17 +1615,20 @@ test_expect_success 'format-patch -o with no leading directories' '
16151615
'
16161616

16171617
test_expect_success 'format-patch -o with leading existing directories' '
1618-
git format-patch -o patches/side master..side &&
1618+
rm -rf existing-dir &&
1619+
mkdir existing-dir &&
1620+
git format-patch -o existing-dir/patches master..side &&
16191621
count=$(git rev-list --count master..side) &&
1620-
ls patches/side >list &&
1622+
ls existing-dir/patches >list &&
16211623
test_line_count = $count list
16221624
'
16231625

16241626
test_expect_success 'format-patch -o with leading non-existing directories' '
1625-
rm -fr patches &&
1626-
git format-patch -o patches/side master..side &&
1627+
rm -rf non-existing-dir &&
1628+
git format-patch -o non-existing-dir/patches master..side &&
16271629
count=$(git rev-list --count master..side) &&
1628-
ls patches/side >list &&
1630+
test_path_is_dir non-existing-dir &&
1631+
ls non-existing-dir/patches >list &&
16291632
test_line_count = $count list
16301633
'
16311634

t/t4018/dts-nodes-boolean-prop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/ {
2+
label_1: node1@ff00 {
3+
RIGHT@deadf00,4000 {
4+
boolean-prop1;
5+
6+
ChangeMe;
7+
};
8+
};
9+
};

0 commit comments

Comments
 (0)