<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/gitweb/Makefile, branch maint</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=maint</id>
<link rel='self' href='https://git.shady.money/git/atom?h=maint'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-04-01T09:20:44Z</updated>
<entry>
<title>gitweb: fix generation of "gitweb.js"</title>
<updated>2025-04-01T09:20:44Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-03-31T08:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0d3f90ef5da62d3518885af20d095ad4c4532c4'/>
<id>urn:sha1:c0d3f90ef5da62d3518885af20d095ad4c4532c4</id>
<content type='text'>
In 19d8fe7da65 (Makefile: extract script to generate gitweb.js,
2024-12-06) we have extracted the logic to build "gitweb.js" into a
separate script. As part of that the rules that builds the script
has gained a new dependency on that script.

This refactoring is broken though because we use "$^" to determine
the set of JavaScript files that need to be concatenated, and this
implicit variable now also contains the build script itself. As a
result, the build script ends up ni the generated "gitweb.js" file,
which is wrong.

Fix the issue by filtering out non-JavaScript files.

Based-on-patch-by: Thorsten Glaser &lt;tg@debian.org&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: extract script to generate gitweb.js</title>
<updated>2024-12-06T22:52:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T13:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19d8fe7da650970e5c18681f98d258fd924ecf9b'/>
<id>urn:sha1:19d8fe7da650970e5c18681f98d258fd924ecf9b</id>
<content type='text'>
Similar to the preceding commit, also extract the script to generate the
"gitweb.js" file. While the logic itself is trivial, it helps us avoid
duplication of logic across build systems and ensures that the build
systems will remain in sync with each other in case the logic ever needs
to change.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: extract script to generate gitweb.cgi</title>
<updated>2024-12-06T22:52:11Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T13:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2507bbbf4cec59fc002ca8e59e03155836d5005'/>
<id>urn:sha1:d2507bbbf4cec59fc002ca8e59e03155836d5005</id>
<content type='text'>
In order to generate "gitweb.cgi" we have to replace various different
placeholders. This is done ad-hoc and is thus not easily reusable across
different build systems.

Introduce a new GITWEB-BUILD-OPTIONS.in template that we populate at
configuration time with the expected options. This script is then used
as input for a new "generate-gitweb.sh" script that generates the final
"gitweb.cgi" file. While this requires us to repeat the options multiple
times, it is in line to how we generate other build options like our
GIT-BUILD-OPTIONS file.

While at it, refactor how we replace the GITWEB_PROJECT_MAXDEPTH. Even
though this variable is supposed to be an integer, the source file has
the value quoted. The quotes are eventually stripped via sed(1), which
replaces `"@GITWEB_PROJECT_MAXDEPTH@"` with the actual value, which is
rather nonsensical. This is made clearer by just dropping the quotes in
the source file.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: consistently use @PLACEHOLDER@ to substitute</title>
<updated>2024-12-06T22:52:08Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T13:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbe46c0feb25417d01267bb97edb861694ed023d'/>
<id>urn:sha1:dbe46c0feb25417d01267bb97edb861694ed023d</id>
<content type='text'>
We have a bunch of placeholders in our scripts that we replace at build
time, for example by using sed(1). These placeholders come in three
different formats: @PLACEHOLDER@, @@PLACEHOLDER@@ and ++PLACEHOLDER++.

Next to being inconsistent it also creates a bit of a problem with
CMake, which only supports the first syntax in its `configure_file()`
function. To work around that we instead manually replace placeholders
via string operations, which is a hassle and removes safeguards that
CMake has to verify that we didn't forget to replace any placeholders.
Besides that, other build systems like Meson also support the CMake
syntax.

Unify our codebase to consistently use the syntax supported by such
build systems.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb/Makefile: add a "NO_GITWEB" parameter</title>
<updated>2022-06-28T20:20:05Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:16:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a35258c62adf5c0e591f2335f3427434ff0b63f0'/>
<id>urn:sha1:a35258c62adf5c0e591f2335f3427434ff0b63f0</id>
<content type='text'>
From looking at the {Free,Net,Dragonfly}BSD packages for git[1]
they've been monkeypatching "gitweb" out of the Makefile, let's be
nicer and provide a NO_GITWEB=Y for their use.

For the "all" target this allows for optionally restoring what's been
the status quo before the preceding commit, but now we'll also behave
correctly on the subsequent "make install".

As before our installation of gitweb can be suppressed with
NO_PERL. For backwards compatibility the NO_PERL=Y flag by itself
still doesn't change whether or not we build gitweb, unlike the new
NO_GITWEB=Y flag.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb/Makefile: include in top-level Makefile</title>
<updated>2022-06-28T20:20:05Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:16:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=affc3b755cb4d1ac87096bbb93f5f2e57b703894'/>
<id>urn:sha1:affc3b755cb4d1ac87096bbb93f5f2e57b703894</id>
<content type='text'>
Include the gitweb/Makefile in the top-level Makefile rather than
calling it as a sub-Makefile. As noted in the thread starting at at
[1] (in particular [2]) we'll pay a high cost on NOOP runs of "make"
just to figure out that we have nothing to do for "make gitweb".

The "gitweb" script also isn't maintained out-of-tree, unlike
"gitk-git" or "git-gui", which both have their own "Makefile". Other
parts of it are already integrated into our main Makefiles, e.g. the
documentation is built by Documentation/Makefile since
07ea4df2780 (gitweb: Add gitweb(1) manpage for gitweb itself,
2011-10-16).

1. https://lore.kernel.org/git/20220525205651.825669-1-szeder.dev@gmail.com/
2. https://lore.kernel.org/git/220526.86k0a96sv2.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb: remove "test" and "test-installed" targets</title>
<updated>2022-06-28T20:20:05Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27438ef5e043ebca6336274c5b4e79287749eca6'/>
<id>urn:sha1:27438ef5e043ebca6336274c5b4e79287749eca6</id>
<content type='text'>
Remove the special "test" targets for gitweb added in
958a8467216 (gitweb/Makefile: Add 'test' and 'test-installed' targets,
2010-09-26). Unlike e.g. "contrib/scalar" and "contrib/subtree" the
"gitweb" tests themselves live in our top-level t/ directory.

It therefore doesn't make sense to maintain this indirection, no more
than it would to have a "git-send-email-test". By dropping it we'll
also free other tests to use the t95*.sh prefix.

These removed targets are unlikely to be used by anyone, and to the
extent that they are we can easily use an invocation like this
instead:

	make test T='t[0-9]*gitweb*.sh'

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb/Makefile: prepare to merge into top-level Makefile</title>
<updated>2022-06-28T20:20:04Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:15:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b82d66eb0cf840a991ff906ab4679785eae4605a'/>
<id>urn:sha1:b82d66eb0cf840a991ff906ab4679785eae4605a</id>
<content type='text'>
Since the "gitweb/Makefile" was split out from the top-level Makefile
in 62331ef1637 (gitweb: Makefile improvements, 2010-01-30) we've kept
the inter-dependencies between the two, and worse have dealt with a
lot of duplication as a result.

In preparation for merging the two again add a MAK_DIR_GITWEB variable
to various rules in it. This will allow us to set this variable to
"gitweb/" as we include it in the top-level Makefile, which will
minimize the size of the subsequent diff.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb/Makefile: clear up and de-duplicate the gitweb.{css,js} vars</title>
<updated>2022-06-28T20:20:04Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=564ebde3d323fc3b22534dcbb32723807771b955'/>
<id>urn:sha1:564ebde3d323fc3b22534dcbb32723807771b955</id>
<content type='text'>
Change the variable definitions for the $(GITWEB_CSS) and $(GITWEB_JS)
so that we have a clear separation between what we use as "in" files,
v.s. our "min" files. We can now make the appending to $(GITWEB_FILES)
unconditional, since $(GITWEB_{JS,CSS}) is either the "min" or
non-"min" version. This reduces the duplication within the file.

While we're at it let's initialize "GITWEB_JSLIB_FILES" as we normally
do with such variables.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitweb/Makefile: add a $(GITWEB_ALL) variable</title>
<updated>2022-06-28T20:20:04Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-28T10:15:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e08fa5e2bf9cd254a742a0ac3e950a12fc45915'/>
<id>urn:sha1:1e08fa5e2bf9cd254a742a0ac3e950a12fc45915</id>
<content type='text'>
Declare the targets that the "all" target depends on with a new
$(GITWEB_ALL) variable. This will help to reduce churn in subsequent
commits.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
