Skip to content

Commit 85d107d

Browse files
committed
Merge branch 'ps/build' into seen
Build procedure update plus introduction of Mason based builds * ps/build: meson: fix conflicts with in-flight topics Introduce support for the Meson build system Documentation: add comparison of build systems t: allow overriding build dir t: better support for out-of-tree builds Documentation: extract script to generate a list of mergetools Documentation: teach "cmd-list.perl" about out-of-tree builds Documentation: allow sourcing generated includes from separate dir Makefile: simplify building of templates Makefile: allow "bin-wrappers/" directory to exist Makefile: refactor generators to be PWD-independent Makefile: refactor GIT-VERSION-GEN to be reusable Makefile: extract script to generate gitweb.cgi Makefile: extract script to massage Shell scripts Makefile: use "generate-perl.sh" to massage Perl library Makefile: extract script to massage Perl scripts Makefile: consistently use PERL_PATH Makefile: consistently use @Placeholder@ to substitute Makefile: use common template for GIT-BUILD-OPTIONS
2 parents 38f8d68 + 7afbcb6 commit 85d107d

File tree

88 files changed

+4428
-447
lines changed

Some content is hidden

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

88 files changed

+4428
-447
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/GIT-TEST-SUITES
1313
/GIT-USER-AGENT
1414
/GIT-VERSION-FILE
15-
/bin-wrappers/
1615
/git
1716
/git-add
1817
/git-am

Documentation/CodingGuidelines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ For C programs:
583583
Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or
584584
run `GIT_DEBUGGER="<debugger> <debugger-args>" ./bin-wrappers/git foo` to
585585
use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb"
586-
./bin-wrappers/git log` (See `wrap-for-bin.sh`.)
586+
./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.)
587587

588588
- The primary data structure that a subsystem 'S' deals with is called
589589
`struct S`. Functions that operate on `struct S` are named

Documentation/Makefile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ TECH_DOCS += MyFirstObjectWalk
111111
TECH_DOCS += SubmittingPatches
112112
TECH_DOCS += ToolsForGit
113113
TECH_DOCS += technical/bitmap-format
114+
TECH_DOCS += technical/build-systems
114115
TECH_DOCS += technical/bundle-uri
115116
TECH_DOCS += technical/hash-function-transition
116117
TECH_DOCS += technical/long-running-process-protocol
@@ -218,6 +219,7 @@ SHELL_PATH ?= $(SHELL)
218219
# Shell quote;
219220
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
220221

222+
ASCIIDOC_EXTRA += -abuild_dir='$(shell pwd)'
221223
ifdef DEFAULT_PAGER
222224
DEFAULT_PAGER_SQ = $(subst ','\'',$(DEFAULT_PAGER))
223225
ASCIIDOC_EXTRA += -a 'git-default-pager=$(DEFAULT_PAGER_SQ)'
@@ -275,15 +277,17 @@ ifneq ($(filter-out lint-docs clean,$(MAKECMDGOALS)),)
275277
-include ../GIT-VERSION-FILE
276278
endif
277279

280+
mergetools_txt = mergetools-diff.txt mergetools-merge.txt
281+
278282
#
279283
# Determine "include::" file references in asciidoc files.
280284
#
281285
docdep_prereqs = \
282-
mergetools-list.made $(mergetools_txt) \
286+
$(mergetools_txt) \
283287
cmd-list.made $(cmds_txt)
284288

285289
doc.dep : $(docdep_prereqs) $(DOC_DEP_TXT) build-docdep.perl
286-
$(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl >$@ $(QUIET_STDERR)
290+
$(QUIET_GEN)$(PERL_PATH) ./build-docdep.perl "$(shell pwd)" >$@ $(QUIET_STDERR)
287291

288292
ifneq ($(MAKECMDGOALS),clean)
289293
-include doc.dep
@@ -305,22 +309,14 @@ cmds_txt = cmds-ancillaryinterrogators.txt \
305309
$(cmds_txt): cmd-list.made
306310

307311
cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
308-
$(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl ../command-list.txt $(cmds_txt) $(QUIET_STDERR) && \
312+
$(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl .. . $(cmds_txt) && \
309313
date >$@
310314

311-
mergetools_txt = mergetools-diff.txt mergetools-merge.txt
312-
313-
$(mergetools_txt): mergetools-list.made
314-
315-
mergetools-list.made: ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
316-
$(QUIET_GEN) \
317-
$(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=diff && \
318-
. ../git-mergetool--lib.sh && \
319-
show_tool_names can_diff' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-diff.txt && \
320-
$(SHELL_PATH) -c 'MERGE_TOOLS_DIR=../mergetools && TOOL_MODE=merge && \
321-
. ../git-mergetool--lib.sh && \
322-
show_tool_names can_merge' | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >mergetools-merge.txt && \
323-
date >$@
315+
mergetools-%.txt: generate-mergetool-list.sh ../git-mergetool--lib.sh $(wildcard ../mergetools/*)
316+
mergetools-diff.txt:
317+
$(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. diff $@
318+
mergetools-merge.txt:
319+
$(QUIET_GEN)$(SHELL_PATH) ./generate-mergetool-list.sh .. merge $@
324320

325321
TRACK_ASCIIDOCFLAGS = $(subst ','\'',$(ASCIIDOC_COMMON):$(ASCIIDOC_HTML):$(ASCIIDOC_DOCBOOK))
326322

Documentation/build-docdep.perl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/perl
22

3+
my ($build_dir) = @ARGV;
34
my %include = ();
45
my %included = ();
56

@@ -10,6 +11,7 @@
1011
chomp;
1112
s/^include::\s*//;
1213
s/\[\]//;
14+
s/{build_dir}/${build_dir}/;
1315
$include{$text}{$_} = 1;
1416
$included{$_} = 1;
1517
}

Documentation/cmd-list.perl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
use File::Compare qw(compare);
44

55
sub format_one {
6-
my ($out, $nameattr) = @_;
6+
my ($source_dir, $out, $nameattr) = @_;
77
my ($name, $attr) = @$nameattr;
8+
my ($path) = "$source_dir/Documentation/$name.txt";
89
my ($state, $description);
910
my $mansection;
1011
$state = 0;
11-
open I, '<', "$name.txt" or die "No such file $name.txt";
12+
open I, '<', "$path" or die "No such file $path.txt";
1213
while (<I>) {
1314
if (/^(?:git|scalar)[a-z0-9-]*\(([0-9])\)$/) {
1415
$mansection = $1;
@@ -29,7 +30,7 @@ sub format_one {
2930
}
3031
close I;
3132
if (!defined $description) {
32-
die "No description found in $name.txt";
33+
die "No description found in $path.txt";
3334
}
3435
if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {
3536
print $out "linkgit:$name\[$mansection\]::\n\t";
@@ -43,9 +44,9 @@ sub format_one {
4344
}
4445
}
4546

46-
my ($input, @categories) = @ARGV;
47+
my ($source_dir, $build_dir, @categories) = @ARGV;
4748

48-
open IN, "<$input";
49+
open IN, "<$source_dir/command-list.txt";
4950
while (<IN>) {
5051
last if /^### command list/;
5152
}
@@ -63,17 +64,17 @@ sub format_one {
6364

6465
for my $out (@categories) {
6566
my ($cat) = $out =~ /^cmds-(.*)\.txt$/;
66-
open O, '>', "$out+" or die "Cannot open output file $out+";
67+
my ($path) = "$build_dir/$out";
68+
open O, '>', "$path+" or die "Cannot open output file $out+";
6769
for (@{$cmds{$cat}}) {
68-
format_one(\*O, $_);
70+
format_one($source_dir, \*O, $_);
6971
}
7072
close O;
7173

72-
if (-f "$out" && compare("$out", "$out+") == 0) {
73-
unlink "$out+";
74+
if (-f "$path" && compare("$path", "$path+") == 0) {
75+
unlink "$path+";
7476
}
7577
else {
76-
print STDERR "$out\n";
77-
rename "$out+", "$out";
78+
rename "$path+", "$path";
7879
}
7980
}

Documentation/config/diff.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ diff.<driver>.cachetextconv::
206206
Set this option to true to make the diff driver cache the text
207207
conversion outputs. See linkgit:gitattributes[5] for details.
208208

209-
include::../mergetools-diff.txt[]
209+
include::{build_dir}/mergetools-diff.txt[]
210210

211211
diff.indentHeuristic::
212212
Set this option to `false` to disable the default heuristics

Documentation/config/merge.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ merge.guitool::
101101
Any other value is treated as a custom merge tool and requires that a
102102
corresponding mergetool.<guitool>.cmd variable is defined.
103103

104-
include::../mergetools-merge.txt[]
104+
include::{build_dir}/mergetools-merge.txt[]
105105

106106
merge.verbosity::
107107
Controls the amount of output shown by the recursive merge
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
if test "$#" -ne 3
4+
then
5+
echo "USAGE: $0 <SOURCE_DIR> <MODE> <OUTPUT>" >&2
6+
exit 1
7+
fi
8+
9+
SOURCE_DIR="$1"
10+
TOOL_MODE="$2"
11+
OUTPUT="$3"
12+
MERGE_TOOLS_DIR="$SOURCE_DIR/mergetools"
13+
14+
(
15+
. "$SOURCE_DIR"/git-mergetool--lib.sh &&
16+
show_tool_names can_$TOOL_MODE
17+
) | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >"$OUTPUT"

Documentation/git.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,17 @@ ancillary user utilities.
245245
Main porcelain commands
246246
~~~~~~~~~~~~~~~~~~~~~~~
247247

248-
include::cmds-mainporcelain.txt[]
248+
include::{build_dir}/cmds-mainporcelain.txt[]
249249

250250
Ancillary Commands
251251
~~~~~~~~~~~~~~~~~~
252252
Manipulators:
253253

254-
include::cmds-ancillarymanipulators.txt[]
254+
include::{build_dir}/cmds-ancillarymanipulators.txt[]
255255

256256
Interrogators:
257257

258-
include::cmds-ancillaryinterrogators.txt[]
258+
include::{build_dir}/cmds-ancillaryinterrogators.txt[]
259259

260260

261261
Interacting with Others
@@ -264,7 +264,7 @@ Interacting with Others
264264
These commands are to interact with foreign SCM and with other
265265
people via patch over e-mail.
266266

267-
include::cmds-foreignscminterface.txt[]
267+
include::{build_dir}/cmds-foreignscminterface.txt[]
268268

269269
Reset, restore and revert
270270
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -313,13 +313,13 @@ repositories.
313313
Manipulation commands
314314
~~~~~~~~~~~~~~~~~~~~~
315315

316-
include::cmds-plumbingmanipulators.txt[]
316+
include::{build_dir}/cmds-plumbingmanipulators.txt[]
317317

318318

319319
Interrogation commands
320320
~~~~~~~~~~~~~~~~~~~~~~
321321

322-
include::cmds-plumbinginterrogators.txt[]
322+
include::{build_dir}/cmds-plumbinginterrogators.txt[]
323323

324324
In general, the interrogate commands do not touch the files in
325325
the working tree.
@@ -328,12 +328,12 @@ the working tree.
328328
Syncing repositories
329329
~~~~~~~~~~~~~~~~~~~~
330330

331-
include::cmds-synchingrepositories.txt[]
331+
include::{build_dir}/cmds-synchingrepositories.txt[]
332332

333333
The following are helper commands used by the above; end users
334334
typically do not use them directly.
335335

336-
include::cmds-synchelpers.txt[]
336+
include::{build_dir}/cmds-synchelpers.txt[]
337337

338338

339339
Internal helper commands
@@ -342,14 +342,14 @@ Internal helper commands
342342
These are internal helper commands used by other commands; end
343343
users typically do not use them directly.
344344

345-
include::cmds-purehelpers.txt[]
345+
include::{build_dir}/cmds-purehelpers.txt[]
346346

347347
Guides
348348
------
349349

350350
The following documentation pages are guides about Git concepts.
351351

352-
include::cmds-guide.txt[]
352+
include::{build_dir}/cmds-guide.txt[]
353353

354354
Repository, command and file interfaces
355355
---------------------------------------
@@ -358,7 +358,7 @@ This documentation discusses repository and command interfaces which
358358
users are expected to interact with directly. See `--user-formats` in
359359
linkgit:git-help[1] for more details on the criteria.
360360

361-
include::cmds-userinterfaces.txt[]
361+
include::{build_dir}/cmds-userinterfaces.txt[]
362362

363363
File formats, protocols and other developer interfaces
364364
------------------------------------------------------
@@ -367,7 +367,7 @@ This documentation discusses file formats, over-the-wire protocols and
367367
other git developer interfaces. See `--developer-interfaces` in
368368
linkgit:git-help[1].
369369

370-
include::cmds-developerinterfaces.txt[]
370+
include::{build_dir}/cmds-developerinterfaces.txt[]
371371

372372
Configuration Mechanism
373373
-----------------------

0 commit comments

Comments
 (0)