Skip to content

Commit 22b7e73

Browse files
committed
scalar: move it out of contrib/
With this patch, `scalar` becomes a fully-supported top-level Git command. The Scalar executable is installed by default as well as its documentation, and its (minimal) regression test is run as part of the full test suite. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent c69c30c commit 22b7e73

File tree

18 files changed

+21
-207
lines changed

18 files changed

+21
-207
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ jobs:
9191
HOME: ${{runner.workspace}}
9292
NO_PERL: 1
9393
run: . /etc/profile && ci/make-test-artifacts.sh artifacts
94-
- name: build Scalar
95-
shell: bash
96-
run: |
97-
make -C contrib/scalar &&
98-
mkdir -p artifacts/bin-wrappers artifacts/contrib/scalar &&
99-
cp contrib/scalar/scalar.exe artifacts/contrib/scalar/ &&
100-
cp bin-wrappers/scalar artifacts/bin-wrappers/
10194
- name: zip up tracked files
10295
run: git archive -o artifacts/tracked.tar.gz HEAD
10396
- name: upload tracked files and build artifacts
@@ -167,8 +160,6 @@ jobs:
167160
run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
168161
- name: generate Visual Studio solution
169162
shell: bash
170-
env:
171-
INCLUDE_SCALAR: YesPlease
172163
run: |
173164
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
174165
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
@@ -182,12 +173,6 @@ jobs:
182173
run: |
183174
mkdir -p artifacts &&
184175
eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts NO_GETTEXT=YesPlease 2>&1 | grep ^tar)"
185-
- name: copy Scalar
186-
shell: bash
187-
run: |
188-
mkdir -p artifacts/bin-wrappers artifacts/contrib/scalar &&
189-
cp contrib/scalar/scalar.exe artifacts/contrib/scalar/ &&
190-
cp bin-wrappers/scalar artifacts/bin-wrappers/
191176
- name: zip up tracked files
192177
run: git archive -o artifacts/tracked.tar.gz HEAD
193178
- name: upload tracked files and build artifacts

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
/config-list.h
195195
/command-list.h
196196
/hook-list.h
197+
/scalar
197198
*.tar.gz
198199
*.dsc
199200
*.deb

Documentation/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ MAN1_TXT += git.txt
2222
MAN1_TXT += gitk.txt
2323
MAN1_TXT += gitweb.txt
2424

25+
MAN1_TXT += scalar.txt
26+
2527
# man5 / man7 guides (note: new guides should also be added to command-list.txt)
2628
MAN5_TXT += gitattributes.txt
2729
MAN5_TXT += gitformat-bundle.txt

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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ all:: $(FUZZ_OBJS)
697697

698698
FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
699699

700+
SCALAR_OBJS := scalar.o
701+
702+
PROGRAMS += scalar$(X)
703+
BINDIR_PROGRAMS_NEED_X += scalar
704+
700705
# Empty...
701706
EXTRA_PROGRAMS =
702707

@@ -2583,17 +2588,14 @@ OBJECTS += $(GIT_OBJS)
25832588
OBJECTS += $(PROGRAM_OBJS)
25842589
OBJECTS += $(TEST_OBJS)
25852590
OBJECTS += $(XDIFF_OBJS)
2591+
OBJECTS += $(SCALAR_OBJS)
25862592
OBJECTS += $(FUZZ_OBJS)
25872593
OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
25882594

25892595
ifndef NO_CURL
25902596
OBJECTS += http.o http-walker.o remote-curl.o
25912597
endif
25922598

2593-
SCALAR_SOURCES := contrib/scalar/scalar.c
2594-
SCALAR_OBJECTS := $(SCALAR_SOURCES:c=o)
2595-
OBJECTS += $(SCALAR_OBJECTS)
2596-
25972599
.PHONY: objects
25982600
objects: $(OBJECTS)
25992601

@@ -2726,9 +2728,8 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS
27262728
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
27272729
$(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
27282730

2729-
contrib/scalar/scalar$X: $(SCALAR_OBJECTS) GIT-LDFLAGS $(GITLIBS)
2730-
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
2731-
$(filter %.o,$^) $(LIBS)
2731+
scalar$X: $(SCALAR_OBJS) GIT-LDFLAGS $(GITLIBS)
2732+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
27322733

27332734
$(LIB_FILE): $(LIB_OBJS)
27342735
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
@@ -3097,7 +3098,7 @@ bin-wrappers/%: wrap-for-bin.sh
30973098
$(call mkdir_p_parent_template)
30983099
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
30993100
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
3100-
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
3101+
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst scalar,$(X),$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X))))|' < $< > $@ && \
31013102
chmod +x $@
31023103

31033104
# GNU make supports exporting all variables by "export" without parameters.

0 commit comments

Comments
 (0)