Skip to contentSkip to conversation

doc: check-docs and WITH_BREAKING_CHANGES

RFC In review Junio C Hamano 3 participants 6 messages Sep 19, 2025 – Sep 23, 2025 Kbuild

lore
Share & tools
lore
#0 lore raw

RFC 1/1 doc: check-docs and WITH_BREAKING_CHANGES

Shouldn't we do something like this for breaking builds?

Documentation/Makefile pays attention to EXCLUDED_PROGRAMS to pretend that the git-$deprecated.adoc files do not exist

    -include GIT-EXCLUDED-PROGRAMS

    MAN1_TXT += $(filter-out \
                    $(patsubst %,%.adoc,$(EXCLUDED_PROGRAMS)) \
                    $(addsuffix .adoc, $(ARTICLES) $(SP_ARTICLES)), \
                    $(wildcard git-*.adoc))

but nobody seems to put the removed programs on the list.

The dependencies around Documentation/GIT-EXCLUDED-PROGRAMS is still screwed up, I think, but this may be a good first step to straighten it out. If "make -C Documentation" runs lint-docs by default, for example, we may want to tweak the Makefile down there to make link-docs target depend on the GIT-EXCLUDED-PROGRAMS perhaps.

Makefile +5 -1
index 893070be76..711cade8fd 100644
@@ -892,6 +892,8 @@ BUILT_INS += git-switch$X
 BUILT_INS += git-version$X
 ifndef WITH_BREAKING_CHANGES
 BUILT_INS += git-whatchanged$X
+else
+EXCLUDED_PROGRAMS += git-whatchanged
 endif
 
 # what 'all' will build but not install in gitexecdir
@@ -1363,6 +1365,8 @@ BUILTIN_OBJS += builtin/notes.o
 BUILTIN_OBJS += builtin/pack-objects.o
 ifndef WITH_BREAKING_CHANGES
 BUILTIN_OBJS += builtin/pack-redundant.o
+else
+EXCLUDED_PROGRAMS += git-pack-redundant
 endif
 BUILTIN_OBJS += builtin/pack-refs.o
 BUILTIN_OBJS += builtin/patch-id.o
@@ -3875,7 +3879,7 @@ ALL_COMMANDS += gitweb
 ALL_COMMANDS += scalar
 
 .PHONY: check-docs
-check-docs::
+check-docs:: Documentation/GIT-EXCLUDED-PROGRAMS
 	$(MAKE) -C Documentation lint-docs
 
 ### Make sure built-ins do not have dups and listed in git.c
#1 lore raw

Makefile

Quoted 24 lines · Junio C Hamano

Shouldn't we do something like this for breaking builds?

Documentation/Makefile pays attention to EXCLUDED_PROGRAMS to pretend that the git-$deprecated.adoc files do not exist

    -include GIT-EXCLUDED-PROGRAMS

    MAN1_TXT += $(filter-out \
                    $(patsubst %,%.adoc,$(EXCLUDED_PROGRAMS)) \
                    $(addsuffix .adoc, $(ARTICLES) $(SP_ARTICLES)), \
                    $(wildcard git-*.adoc))

but nobody seems to put the removed programs on the list.

The dependencies around Documentation/GIT-EXCLUDED-PROGRAMS is still screwed up, I think, but this may be a good first step to straighten it out. If "make -C Documentation" runs lint-docs by default, for example, we may want to tweak the Makefile down there to make link-docs target depend on the GIT-EXCLUDED-PROGRAMS perhaps.

Makefile +0 -0
index 893070be76..711cade8fd 100644

Curious, but what's up with the "i" and "w" prefixes here? :)

Makefile BUILT_INS += git-switch$X · line 899

Quoted 9 lines
Makefile +2 -0
@@ -892,6 +892,8 @@ BUILT_INS += git-switch$X
 BUILT_INS += git-version$X
 ifndef WITH_BREAKING_CHANGES
 BUILT_INS += git-whatchanged$X
+else
+EXCLUDED_PROGRAMS += git-whatchanged
 endif
 
 # what 'all' will build but not install in gitexecdir

I think this change makes sense indeed. It means that we stop linting the docs, which is a bit of a weird side effect that may or may not be sensible. But in any case, we should probably stop installing these man pages.

I say "probably" because this got me thinking: we could keep the man page for a while, but completely replace their its with a notice saying that the command got removed. Even better, we could even tell users what the replacement is.

Patrick

#2 lore raw
Quoted 24 lines · Patrick Steinhardt
Quoted 20 lines · Junio C Hamano

Shouldn't we do something like this for breaking builds?

Documentation/Makefile pays attention to EXCLUDED_PROGRAMS to pretend that the git-$deprecated.adoc files do not exist

   -include GIT-EXCLUDED-PROGRAMS

   MAN1_TXT += $(filter-out \
                   $(patsubst %,%.adoc,$(EXCLUDED_PROGRAMS)) \
                   $(addsuffix .adoc, $(ARTICLES) $(SP_ARTICLES)), \
                   $(wildcard git-*.adoc))

but nobody seems to put the removed programs on the list.

The dependencies around Documentation/GIT-EXCLUDED-PROGRAMS is still screwed up, I think, but this may be a good first step to straighten it out. If "make -C Documentation" runs lint-docs by default, for example, we may want to tweak the Makefile down there to make link-docs target depend on the GIT-EXCLUDED-PROGRAMS perhaps.

Quoted 6 lines

Makefile

Quoted 4 lines
Makefile +0 -0
index 893070be76..711cade8fd 100644

Curious, but what's up with the "i" and "w" prefixes here? :)

That’s « index » and « working tree » from diff.mnemonicPrefix

#3 lore raw
Quoted 24 lines · Ben Knoble
Quoted 24 lines · Patrick Steinhardt
Quoted 20 lines · Junio C Hamano

Shouldn't we do something like this for breaking builds?

Documentation/Makefile pays attention to EXCLUDED_PROGRAMS to pretend that the git-$deprecated.adoc files do not exist

   -include GIT-EXCLUDED-PROGRAMS

   MAN1_TXT += $(filter-out \
                   $(patsubst %,%.adoc,$(EXCLUDED_PROGRAMS)) \
                   $(addsuffix .adoc, $(ARTICLES) $(SP_ARTICLES)), \
                   $(wildcard git-*.adoc))

but nobody seems to put the removed programs on the list.

The dependencies around Documentation/GIT-EXCLUDED-PROGRAMS is still screwed up, I think, but this may be a good first step to straighten it out. If "make -C Documentation" runs lint-docs by default, for example, we may want to tweak the Makefile down there to make link-docs target depend on the GIT-EXCLUDED-PROGRAMS perhaps.

Quoted 8 lines
Quoted 6 lines

Makefile

Quoted 4 lines
Makefile +0 -0
index 893070be76..711cade8fd 100644

Curious, but what's up with the "i" and "w" prefixes here? :)

That’s « index » and « working tree » from diff.mnemonicPrefix

Interesting. It's amazing how there's always something new to learn about Git :) Thanks!

Patrick

#4 lore raw
In reply to Patrick Steinhardt
Quoted 6 lines · Patrick Steinhardt

Makefile

Quoted 4 lines
Makefile +0 -0
index 893070be76..711cade8fd 100644

Curious, but what's up with the "i" and "w" prefixes here? :)

They indicate that you are looking at uncommitted "here is what I typed in the working tree for illustration" changes ;-).

Quoted 9 lines

I think this change makes sense indeed. It means that we stop linting the docs, which is a bit of a weird side effect that may or may not be sensible. But in any case, we should probably stop installing these man pages.

I say "probably" because this got me thinking: we could keep the man page for a while, but completely replace their its with a notice saying that the command got removed. Even better, we could even tell users what the replacement is.

That is true but requires a much larger change.

There is an assumption that programs whose binaries we are not installing should not get manual pages, which is what allows us to throw git-http-fetch and git-whatchanged to EXCLUDED_PROGRAMS and cause (1) them from getting built and installed, and (2) cause their manual pages not built and not installed, and (3) tell doc-lint that it is OK to have .adoc for these programs' documentation, even though they are not listed in the command-list.txt file. You'd need to start from disentangling that.

Thanks.

#5 lore raw
Quoted 13 lines · Junio C Hamano
Quoted 9 lines · Patrick Steinhardt

I think this change makes sense indeed. It means that we stop linting the docs, which is a bit of a weird side effect that may or may not be sensible. But in any case, we should probably stop installing these man pages.

I say "probably" because this got me thinking: we could keep the man page for a while, but completely replace their its with a notice saying that the command got removed. Even better, we could even tell users what the replacement is.

That is true but requires a much larger change.

Quoted 8 lines

There is an assumption that programs whose binaries we are not installing should not get manual pages, which is what allows us to throw git-http-fetch and git-whatchanged to EXCLUDED_PROGRAMS and cause (1) them from getting built and installed, and (2) cause their manual pages not built and not installed, and (3) tell doc-lint that it is OK to have .adoc for these programs' documentation, even though they are not listed in the command-list.txt file. You'd need to start from disentangling that.

Fair. I'm completely fine with doing this one step at a time, where the first step would be to not install manpages that don't make any sense anymore. Let's see, maybe someone wants to pick up what I propose.

Patrick