Skip to content

Commit 64aef92

Browse files
committed
Merge branch 'ps/meson-with-breaking-changes'
Update meson based build procedure for breaking changes support. * ps/meson-with-breaking-changes: meson: don't install git-pack-redundant(1) docs with breaking changes meson: don't compile git-pack-redundant(1) with breaking changes meson: define WITH_BREAKING_CHANGES when enabling breaking changes
2 parents 650b2e2 + bbd831c commit 64aef92

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ lint-docs-meson:
509509
awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \
510510
grep -v -e '#' -e '^$$' | \
511511
sort >tmp-meson-diff/meson.adoc && \
512-
ls git*.adoc scalar.adoc | grep -v -e git-bisect-lk2009.adoc -e git-tools.adoc >tmp-meson-diff/actual.adoc && \
512+
ls git*.adoc scalar.adoc | grep -v -e git-bisect-lk2009.adoc -e git-pack-redundant.adoc -e git-tools.adoc >tmp-meson-diff/actual.adoc && \
513513
if ! cmp tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; then \
514514
echo "Meson man pages differ from actual man pages:"; \
515515
diff -u tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; \

Documentation/meson.build

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ manpages = {
9797
'git-notes.adoc' : 1,
9898
'git-p4.adoc' : 1,
9999
'git-pack-objects.adoc' : 1,
100-
'git-pack-redundant.adoc' : 1,
101100
'git-pack-refs.adoc' : 1,
102101
'git-patch-id.adoc' : 1,
103102
'git-prune-packed.adoc' : 1,
@@ -206,6 +205,14 @@ manpages = {
206205
'gitworkflows.adoc' : 7,
207206
}
208207

208+
manpages_breaking_changes = {
209+
'git-pack-redundant.adoc' : 1,
210+
}
211+
212+
if not get_option('breaking_changes')
213+
manpages += manpages_breaking_changes
214+
endif
215+
209216
docs_backend = get_option('docs_backend')
210217
if docs_backend == 'auto'
211218
if find_program('asciidoc', dirs: program_path, required: false).found()
@@ -480,7 +487,9 @@ endif
480487
# Sanity check that we are not missing any tests present in 't/'. This check
481488
# only runs once at configure time and is thus best-effort, only. Furthermore,
482489
# it only verifies man pages for the sake of simplicity.
483-
configured_manpages = manpages.keys() + [ 'git-bisect-lk2009.adoc', 'git-tools.adoc' ]
490+
configured_manpages = manpages.keys()
491+
configured_manpages += manpages_breaking_changes.keys()
492+
configured_manpages += [ 'git-bisect-lk2009.adoc', 'git-tools.adoc' ]
484493
actual_manpages = run_command(shell, '-c', 'ls git*.adoc scalar.adoc',
485494
check: true,
486495
env: script_environment,

meson.build

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,6 @@ builtin_sources = [
582582
'builtin/name-rev.c',
583583
'builtin/notes.c',
584584
'builtin/pack-objects.c',
585-
'builtin/pack-redundant.c',
586585
'builtin/pack-refs.c',
587586
'builtin/patch-id.c',
588587
'builtin/prune-packed.c',
@@ -633,6 +632,10 @@ builtin_sources = [
633632
'builtin/write-tree.c',
634633
]
635634

635+
if not get_option('breaking_changes')
636+
builtin_sources += 'builtin/pack-redundant.c'
637+
endif
638+
636639
builtin_sources += custom_target(
637640
output: 'config-list.h',
638641
command: [
@@ -673,12 +676,6 @@ build_options_config.set_quoted('GIT_TEST_UTF8_LOCALE', get_option('test_utf8_lo
673676
build_options_config.set_quoted('LOCALEDIR', fs.as_posix(get_option('prefix') / get_option('localedir')))
674677
build_options_config.set('GITWEBDIR', fs.as_posix(get_option('prefix') / get_option('datadir') / 'gitweb'))
675678

676-
if get_option('breaking_changes')
677-
build_options_config.set('WITH_BREAKING_CHANGES', 'YesPlease')
678-
else
679-
build_options_config.set('WITH_BREAKING_CHANGES', '')
680-
endif
681-
682679
if get_option('sane_tool_path').length() != 0
683680
sane_tool_path = (host_machine.system() == 'windows' ? ';' : ':').join(get_option('sane_tool_path'))
684681
build_options_config.set_quoted('BROKEN_PATH_FIX', 's|^\# @BROKEN_PATH_FIX@$|git_broken_path_fix "' + sane_tool_path + '"|')
@@ -740,6 +737,13 @@ if get_option('warning_level') in ['2','3', 'everything'] and compiler.get_argum
740737
endforeach
741738
endif
742739

740+
if get_option('breaking_changes')
741+
build_options_config.set('WITH_BREAKING_CHANGES', 'YesPlease')
742+
libgit_c_args += '-DWITH_BREAKING_CHANGES'
743+
else
744+
build_options_config.set('WITH_BREAKING_CHANGES', '')
745+
endif
746+
743747
if get_option('b_sanitize').contains('address')
744748
build_options_config.set('SANITIZE_ADDRESS', 'YesCompiledWithIt')
745749
else

0 commit comments

Comments
 (0)