Skip to content

Commit 2e2f4dd

Browse files
committed
Merge branch 'main' of github.com:git/git
* 'main' of github.com:git/git: (45 commits) A bit more of remaining topics before -rc1 t1800: correct test to handle Cygwin chainlint: colorize problem annotations and test delimiters ls-files: fix black space in error message list-objects-filter: convert filter_spec to a strbuf list-objects-filter: add and use initializers list-objects-filter: handle null default filter spec list-objects-filter: don't memset after releasing filter struct builtin/mv.c: fix possible segfault in add_slash() Documentation/technical: include Scalar technical doc t/perf: add 'GIT_PERF_USE_SCALAR' run option t/perf: add Scalar performance tests scalar-clone: add test coverage scalar: add to 'git help -a' command list scalar: implement the `help` subcommand git help: special-case `scalar` scalar: include in standard Git build & installation scalar: fix command documentation section header t: retire unused chainlint.sed t/Makefile: teach `make test` and `make prove` to run chainlint.pl ...
2 parents a275db6 + dda7228 commit 2e2f4dd

File tree

109 files changed

+2188
-749
lines changed

Some content is hidden

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

109 files changed

+2188
-749
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
/git-whatchanged
186186
/git-worktree
187187
/git-write-tree
188+
/scalar
188189
/git-core-*/?*
189190
/git.res
190191
/gitweb/GITWEB-BUILD-OPTIONS

Documentation/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ MAN1_TXT += $(filter-out \
2121
MAN1_TXT += git.txt
2222
MAN1_TXT += gitk.txt
2323
MAN1_TXT += gitweb.txt
24+
MAN1_TXT += scalar.txt
2425

2526
# man5 / man7 guides (note: new guides should also be added to command-list.txt)
2627
MAN5_TXT += gitattributes.txt
@@ -116,6 +117,7 @@ TECH_DOCS += technical/parallel-checkout
116117
TECH_DOCS += technical/partial-clone
117118
TECH_DOCS += technical/racy-git
118119
TECH_DOCS += technical/reftable
120+
TECH_DOCS += technical/scalar
119121
TECH_DOCS += technical/send-pack-pipeline
120122
TECH_DOCS += technical/shallow
121123
TECH_DOCS += technical/trivial-merge

Documentation/RelNotes/2.38.0.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ UI, Workflows & Features
66
* "git remote show [-n] frotz" now pays attention to negative
77
pathspec.
88

9-
* "git push" sometimes perform poorly when reachability bitmaps are
9+
* "git push" sometimes performs poorly when reachability bitmaps are
1010
used, even in a repository where other operations are helped by
1111
bitmaps. The push.useBitmaps configuration variable is introduced
1212
to allow disabling use of reachability bitmaps only for "git push".
@@ -27,7 +27,7 @@ UI, Workflows & Features
2727
what locale they are in by sending Accept-Language HTTP header, but
2828
this was done only for some requests but not others.
2929

30-
* Introduce a discovery.barerepository configuration variable that
30+
* Introduce a safe.barerepository configuration variable that
3131
allows users to forbid discovery of bare repositories.
3232

3333
* Various messages that come from the pack-bitmap codepaths have been
@@ -79,12 +79,15 @@ UI, Workflows & Features
7979

8080
* "git format-patch --from=<ident>" can be told to add an in-body
8181
"From:" line even for commits that are authored by the given
82-
<ident> with "--force-in-body-from"option.
82+
<ident> with "--force-in-body-from" option.
8383

8484
* The built-in fsmonitor refuses to work on a network mounted
8585
repositories; a configuration knob for users to override this has
8686
been introduced.
8787

88+
* The "scalar" addition from Microsoft is now part of the core Git
89+
installation.
90+
8891

8992
Performance, Internal Implementation, Development Support etc.
9093

@@ -127,7 +130,7 @@ Performance, Internal Implementation, Development Support etc.
127130

128131
* The way "git multi-pack" uses parse-options API has been improved.
129132

130-
* A coccinelle rule (in contrib/) to encourage use of COPY_ARRAY
133+
* A Coccinelle rule (in contrib/) to encourage use of COPY_ARRAY
131134
macro has been improved.
132135

133136
* API tweak to make it easier to run fuzz testing on commit-graph parser.
@@ -172,6 +175,12 @@ Performance, Internal Implementation, Development Support etc.
172175
* Share the text used to explain configuration variables used by "git
173176
<subcmd>" in "git help <subcmd>" with the text from "git help config".
174177

178+
* "git mv A B" in a sparsely populated working tree can be asked to
179+
move a path from a directory that is "in cone" to another directory
180+
that is "out of cone". Handling of such a case has been improved.
181+
182+
* The chainlint script for our tests has been revamped.
183+
175184

176185
Fixes since v2.37
177186
-----------------
@@ -297,7 +306,7 @@ Fixes since v2.37
297306
* "git fsck" reads mode from tree objects but canonicalizes the mode
298307
before passing it to the logic to check object sanity, which has
299308
hid broken tree objects from the checking logic. This has been
300-
corrected, but to help exiting projects with broken tree objects
309+
corrected, but to help existing projects with broken tree objects
301310
that they cannot fix retroactively, the severity of anomalies this
302311
code detects has been demoted to "info" for now.
303312

@@ -306,33 +315,27 @@ Fixes since v2.37
306315

307316
* An earlier optimization discarded a tree-object buffer that is
308317
still in use, which has been corrected.
309-
(merge 1490d7d82d jk/is-promisor-object-keep-tree-in-use later to maint).
310318

311319
* Fix deadlocks between main Git process and subprocess spawned via
312320
the pipe_command() API, that can kill "git add -p" that was
313321
reimplemented in C recently.
314-
(merge 716c1f649e jk/pipe-command-nonblock later to maint).
315322

316323
* The sequencer machinery translated messages left in the reflog by
317324
mistake, which has been corrected.
318325

319326
* xcalloc(), imitating calloc(), takes "number of elements of the
320327
array", and "size of a single element", in this order. A call that
321328
does not follow this ordering has been corrected.
322-
(merge c4bbd9bb8f sg/xcalloc-cocci-fix later to maint).
323329

324330
* The preload-index codepath made copies of pathspec to give to
325331
multiple threads, which were left leaked.
326-
(merge 23578904da ad/preload-plug-memleak later to maint).
327332

328333
* Update the version of Ubuntu used for GitHub Actions CI from 18.04
329334
to 22.04.
330-
(merge ef46584831 ds/github-actions-use-newer-ubuntu later to maint).
331335

332336
* The auto-stashed local changes created by "git merge --autostash"
333337
was mixed into a conflicted state left in the working tree, which
334338
has been corrected.
335-
(merge d3a9295ada en/merge-unstash-only-on-clean-merge later to maint).
336339

337340
* Multi-pack index got corrupted when preferred pack changed from one
338341
pack to another in a certain way, which has been corrected.

Documentation/cmd-list.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sub format_one {
1010
$state = 0;
1111
open I, '<', "$name.txt" or die "No such file $name.txt";
1212
while (<I>) {
13-
if (/^git[a-z0-9-]*\(([0-9])\)$/) {
13+
if (/^(git|scalar)[a-z0-9-]*\(([0-9])\)$/) {
1414
$mansection = $1;
1515
next;
1616
}

contrib/scalar/scalar.txt renamed to Documentation/scalar.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ SEE ALSO
161161
--------
162162
linkgit:git-clone[1], linkgit:git-maintenance[1].
163163

164-
Scalar
164+
GIT
165165
---
166-
Associated with the linkgit:git[1] suite
166+
Part of the linkgit:git[1] suite

Documentation/technical/scalar.txt

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -64,64 +64,3 @@ some "global" `git` options (e.g., `-c` and `-C`).
6464
Because `scalar` is not invoked as a Git subcommand (like `git scalar`), it is
6565
built and installed as its own executable in the `bin/` directory, alongside
6666
`git`, `git-gui`, etc.
67-
68-
Roadmap
69-
-------
70-
71-
NOTE: this section will be removed once the remaining tasks outlined in this
72-
roadmap are complete.
73-
74-
Scalar is a large enough project that it is being upstreamed incrementally,
75-
living in `contrib/` until it is feature-complete. So far, the following patch
76-
series have been accepted:
77-
78-
- `scalar-the-beginning`: The initial patch series which sets up
79-
`contrib/scalar/` and populates it with a minimal `scalar` command that
80-
demonstrates the fundamental ideas.
81-
82-
- `scalar-c-and-C`: The `scalar` command learns about two options that can be
83-
specified before the command, `-c <key>=<value>` and `-C <directory>`.
84-
85-
- `scalar-diagnose`: The `scalar` command is taught the `diagnose` subcommand.
86-
87-
- `scalar-generalize-diagnose`: Move the functionality of `scalar diagnose`
88-
into `git diagnose` and `git bugreport --diagnose`.
89-
90-
- 'scalar-add-fsmonitor: Enable the built-in FSMonitor in Scalar
91-
enlistments. At the end of this series, Scalar should be feature-complete
92-
from the perspective of a user.
93-
94-
Roughly speaking (and subject to change), the following series are needed to
95-
"finish" this initial version of Scalar:
96-
97-
- Move Scalar to toplevel: Move Scalar out of `contrib/` and into the root of
98-
`git`. This includes a variety of related updates, including:
99-
- building & installing Scalar in the Git root-level 'make [install]'.
100-
- builing & testing Scalar as part of CI.
101-
- moving and expanding test coverage of Scalar (including perf tests).
102-
- implementing 'scalar help'/'git help scalar' to display scalar
103-
documentation.
104-
105-
Finally, there are two additional patch series that exist in Microsoft's fork of
106-
Git, but there is no current plan to upstream them. There are some interesting
107-
ideas there, but the implementation is too specific to Azure Repos and/or VFS
108-
for Git to be of much help in general.
109-
110-
These still exist mainly because the GVFS protocol is what Azure Repos has
111-
instead of partial clone, while Git is focused on improving partial clone:
112-
113-
- `scalar-with-gvfs`: The primary purpose of this patch series is to support
114-
existing Scalar users whose repositories are hosted in Azure Repos (which does
115-
not support Git's partial clones, but supports its predecessor, the GVFS
116-
protocol, which is used by Scalar to emulate the partial clone).
117-
118-
Since the GVFS protocol will never be supported by core Git, this patch series
119-
will remain in Microsoft's fork of Git.
120-
121-
- `run-scalar-functional-tests`: The Scalar project developed a quite
122-
comprehensive set of integration tests (or, "Functional Tests"). They are the
123-
sole remaining part of the original C#-based Scalar project, and this patch
124-
adds a GitHub workflow that runs them all.
125-
126-
Since the tests partially depend on features that are only provided in the
127-
`scalar-with-gvfs` patch series, this patch cannot be upstreamed.

Makefile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ FUZZ_OBJS =
605605
FUZZ_PROGRAMS =
606606
GIT_OBJS =
607607
LIB_OBJS =
608+
SCALAR_OBJS =
608609
OBJECTS =
610+
OTHER_PROGRAMS =
609611
PROGRAM_OBJS =
610612
PROGRAMS =
611613
EXCLUDED_PROGRAMS =
@@ -819,10 +821,12 @@ BUILT_INS += git-switch$X
819821
BUILT_INS += git-whatchanged$X
820822

821823
# what 'all' will build but not install in gitexecdir
822-
OTHER_PROGRAMS = git$X
824+
OTHER_PROGRAMS += git$X
825+
OTHER_PROGRAMS += scalar$X
823826

824827
# what test wrappers are needed and 'install' will install, in bindir
825828
BINDIR_PROGRAMS_NEED_X += git
829+
BINDIR_PROGRAMS_NEED_X += scalar
826830
BINDIR_PROGRAMS_NEED_X += git-receive-pack
827831
BINDIR_PROGRAMS_NEED_X += git-shell
828832
BINDIR_PROGRAMS_NEED_X += git-upload-archive
@@ -2220,7 +2224,7 @@ profile-fast: profile-clean
22202224

22212225
all:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
22222226
ifneq (,$X)
2223-
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
2227+
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
22242228
endif
22252229

22262230
all::
@@ -2543,7 +2547,12 @@ GIT_OBJS += git.o
25432547
.PHONY: git-objs
25442548
git-objs: $(GIT_OBJS)
25452549

2550+
SCALAR_OBJS += scalar.o
2551+
.PHONY: scalar-objs
2552+
scalar-objs: $(SCALAR_OBJS)
2553+
25462554
OBJECTS += $(GIT_OBJS)
2555+
OBJECTS += $(SCALAR_OBJS)
25472556
OBJECTS += $(PROGRAM_OBJS)
25482557
OBJECTS += $(TEST_OBJS)
25492558
OBJECTS += $(XDIFF_OBJS)
@@ -2554,10 +2563,6 @@ ifndef NO_CURL
25542563
OBJECTS += http.o http-walker.o remote-curl.o
25552564
endif
25562565

2557-
SCALAR_SOURCES := contrib/scalar/scalar.c
2558-
SCALAR_OBJECTS := $(SCALAR_SOURCES:c=o)
2559-
OBJECTS += $(SCALAR_OBJECTS)
2560-
25612566
.PHONY: objects
25622567
objects: $(OBJECTS)
25632568

@@ -2683,7 +2688,7 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS
26832688
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
26842689
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
26852690

2686-
contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS)
2691+
scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)
26872692
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
26882693
$(filter %.o,$^) $(LIBS)
26892694

@@ -2739,8 +2744,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
27392744
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
27402745
--keyword=__ --keyword=N__ --keyword="__n:1,2"
27412746
MSGMERGE_FLAGS = --add-location --backup=off --update
2742-
LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(SCALAR_SOURCES) \
2743-
$(GENERATED_H))
2747+
LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(GENERATED_H))
27442748
LOCALIZED_SH = $(sort $(SCRIPT_SH) git-sh-setup.sh)
27452749
LOCALIZED_PERL = $(sort $(SCRIPT_PERL))
27462750

@@ -3054,7 +3058,7 @@ bin-wrappers/%: wrap-for-bin.sh
30543058
$(call mkdir_p_parent_template)
30553059
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
30563060
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
3057-
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
3061+
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \
30583062
chmod +x $@
30593063

30603064
# GNU make supports exporting all variables by "export" without parameters.
@@ -3268,14 +3272,14 @@ ifndef NO_TCLTK
32683272
$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
32693273
endif
32703274
ifneq (,$X)
3271-
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
3275+
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
32723276
endif
32733277

32743278
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
32753279
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
32763280
destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \
32773281
{ test "$$bindir/" = "$$execdir/" || \
3278-
for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
3282+
for p in $(OTHER_PROGRAMS) $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
32793283
$(RM) "$$execdir/$$p" && \
32803284
test -n "$(INSTALL_SYMLINKS)" && \
32813285
ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \
@@ -3450,7 +3454,7 @@ clean: profile-clean coverage-clean cocciclean
34503454
$(RM) git.res
34513455
$(RM) $(OBJECTS)
34523456
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
3453-
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
3457+
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
34543458
$(RM) $(TEST_PROGRAMS)
34553459
$(RM) $(FUZZ_PROGRAMS)
34563460
$(RM) $(SP_OBJ)
@@ -3501,6 +3505,7 @@ ALL_COMMANDS += git-citool
35013505
ALL_COMMANDS += git-gui
35023506
ALL_COMMANDS += gitk
35033507
ALL_COMMANDS += gitweb
3508+
ALL_COMMANDS += scalar
35043509

35053510
.PHONY: check-docs
35063511
check-docs::

advice.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,22 @@ void detach_advice(const char *new_name)
261261

262262
fprintf(stderr, fmt, new_name);
263263
}
264+
265+
void advise_on_moving_dirty_path(struct string_list *pathspec_list)
266+
{
267+
struct string_list_item *item;
268+
269+
if (!pathspec_list->nr)
270+
return;
271+
272+
fprintf(stderr, _("The following paths have been moved outside the\n"
273+
"sparse-checkout definition but are not sparse due to local\n"
274+
"modifications.\n"));
275+
for_each_string_list_item(item, pathspec_list)
276+
fprintf(stderr, "%s\n", item->string);
277+
278+
advise_if_enabled(ADVICE_UPDATE_SPARSE_PATH,
279+
_("To correct the sparsity of these paths, do the following:\n"
280+
"* Use \"git add --sparse <paths>\" to update the index\n"
281+
"* Use \"git sparse-checkout reapply\" to apply the sparsity rules"));
282+
}

advice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@ void NORETURN die_conclude_merge(void);
7474
void NORETURN die_ff_impossible(void);
7575
void advise_on_updating_sparse_paths(struct string_list *pathspec_list);
7676
void detach_advice(const char *new_name);
77+
void advise_on_moving_dirty_path(struct string_list *pathspec_list);
7778

7879
#endif /* ADVICE_H */

builtin/clone.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static struct string_list option_optional_reference = STRING_LIST_INIT_NODUP;
7373
static int option_dissociate;
7474
static int max_jobs = -1;
7575
static struct string_list option_recurse_submodules = STRING_LIST_INIT_NODUP;
76-
static struct list_objects_filter_options filter_options;
76+
static struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
7777
static int option_filter_submodules = -1; /* unspecified */
7878
static int config_filter_submodules = -1; /* unspecified */
7979
static struct string_list server_options = STRING_LIST_INIT_NODUP;

0 commit comments

Comments
 (0)