meson: don't install git-pack-redundant(1) docs with breaking changes
When breaking changes are enabled we continue to install documentation of the git-pack-redundant(1) command even though it is completely disabled and thus inaccessible. Improve this by only installing the documentation in case breaking changes aren't enabled. Based-on-patch-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Mar 12, 2025 at 14:17 UTC
bbd831ce54ac0e414328a27bbadbb42708c21c5f
2 files changed
+12
-3
Documentation/Makefile
+1
-1
@@ -509,7 +509,7 @@ lint-docs-meson:
509
awk "/^manpages = {$$/ {flag=1 ; next } /^}$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047 : [157],\$$/, \"\"); print }" meson.build | \
510
grep -v -e '#' -e '^$$' | \
511
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 && \
513
if ! cmp tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; then \
514
echo "Meson man pages differ from actual man pages:"; \
515
diff -u tmp-meson-diff/meson.adoc tmp-meson-diff/actual.adoc; \
Documentation/meson.build
+11
-2
@@ -96,7 +96,6 @@ manpages = {
96
'git-notes.adoc' : 1,
97
'git-p4.adoc' : 1,
98
'git-pack-objects.adoc' : 1,
99
- 'git-pack-redundant.adoc' : 1,
99
'git-pack-refs.adoc' : 1,
100
'git-patch-id.adoc' : 1,
101
'git-prune-packed.adoc' : 1,
@@ -205,6 +204,14 @@ manpages = {
204
'gitworkflows.adoc' : 7,
205
}
206
207
+manpages_breaking_changes = {
208
+ 'git-pack-redundant.adoc' : 1,
209
+}
210
+
211
+if not get_option('breaking_changes')
212
+ manpages += manpages_breaking_changes
213
+endif
214
+
215
docs_backend = get_option('docs_backend')
216
if docs_backend == 'auto'
217
if find_program('asciidoc', dirs: program_path, required: false).found()
@@ -479,7 +486,9 @@ endif
486
# Sanity check that we are not missing any tests present in 't/'. This check
487
# only runs once at configure time and is thus best-effort, only. Furthermore,
488
# it only verifies man pages for the sake of simplicity.
482
-configured_manpages = manpages.keys() + [ 'git-bisect-lk2009.adoc', 'git-tools.adoc' ]
489
+configured_manpages = manpages.keys()
490
+configured_manpages += manpages_breaking_changes.keys()
491
+configured_manpages += [ 'git-bisect-lk2009.adoc', 'git-tools.adoc' ]
492
actual_manpages = run_command(shell, '-c', 'ls git*.adoc scalar.adoc',
493
check: true,
494
env: script_environment,