<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/templates/Makefile, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=master</id>
<link rel='self' href='https://git.shady.money/git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-02-18T17:02:26Z</updated>
<entry>
<title>Makefile: set default goals in makefiles</title>
<updated>2025-02-18T17:02:26Z</updated>
<author>
<name>Adam Dinwoodie</name>
<email>adam@dinwoodie.org</email>
</author>
<published>2025-02-15T21:19:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5309c1e9fb399c390ed36ef476e91f76f6746fa9'/>
<id>urn:sha1:5309c1e9fb399c390ed36ef476e91f76f6746fa9</id>
<content type='text'>
Explicitly set the default goal at the very top of various makefiles.
This is already present in some makefiles, but not all of them.

In particular, this corrects a regression introduced in a38edab7c8
(Makefile: generate doc versions via GIT-VERSION-GEN, 2024-12-06).  That
commit added some config files as build targets for the Documentation
directory, and put the target configuration in a sensible place.
Unfortunately, that sensible place was above any other build target
definitions, meaning the default goal changed to being those
configuration files only, rather than the HTML and man page
documentation.

Signed-off-by: Adam Dinwoodie &lt;adam@dinwoodie.org&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Acked-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Makefile: simplify building of templates</title>
<updated>2024-12-06T22:52:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T13:24:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed060aa0a35f5d0e201af45c6a32c405db4c2654'/>
<id>urn:sha1:ed060aa0a35f5d0e201af45c6a32c405db4c2654</id>
<content type='text'>
When we install Git we also install a set of default templates that both
git-init(1) and git-clone(1) populate into our build directories. The
way the pristine templates are laid out in our source directory is
somewhat weird though: instead of reconstructing the actual directory
hierarchy in "templates/", we represent directory separators with "--".

The only reason I could come up with for why we have this is the
"branches/" directory, which is supposed to be empty when installing it.
And as Git famously doesn't store empty directories at all we have to
work around this limitation.

Now the thing is that the "branches/" directory is a leftover to how
branches used to be stored in the dark ages. gitrepository-layout(5)
lists this directory as "slightly deprecated", which I would claim is a
strong understatement. I have never encountered anybody using it today
and would be surprised if it even works as expected. So having the "--"
hack in place for an item that is basically unused, unmaintained and
deprecated doesn't only feel unreasonable, but installing that entry by
default may also cause confusion for users that do not know what this is
supposed to be in the first place.

Remove this directory from our templates and, now that we do not require
the workaround anymore, restructure the templates to form a proper
hierarchy. This makes it way easier for build systems to install these
templates into place.

We should likely think about removing support for "branch/" altogether,
but that is outside of the scope of this patch series.

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: add "$(QUIET)" boilerplate to shared.mak</title>
<updated>2022-03-03T22:14:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-03T16:04:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9fda017f40ee7ef2d41e52581b6064bb69ff7a2'/>
<id>urn:sha1:a9fda017f40ee7ef2d41e52581b6064bb69ff7a2</id>
<content type='text'>
The $(QUIET) variables we define are largely duplicated between our
various Makefiles, let's define them in the new "shared.mak" instead.

Since we're not using the environment to pass these around we don't
need to export the "QUIET_GEN" and "QUIET_BUILT_IN" variables
anymore. The "QUIET_GEN" variable is used in "git-gui/Makefile" and
"gitweb/Makefile", but they've got their own definition for those. The
"QUIET_BUILT_IN" variable is only used in the top-level "Makefile". We
still need to export the "V" variable.

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>Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it</title>
<updated>2022-03-03T22:14:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-03T16:04:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8df786d2981f8f4456834798d99b9d92c562d1cd'/>
<id>urn:sha1:8df786d2981f8f4456834798d99b9d92c562d1cd</id>
<content type='text'>
We have various behavior that's shared across our Makefiles, or that
really should be (e.g. via defined templates). Let's create a
top-level "shared.mak" to house those sorts of things, and start by
adding the ".DELETE_ON_ERROR" flag to it.

See my own 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR"
flag, 2021-06-29) and db10fc6c09f (doc: simplify Makefile using
.DELETE_ON_ERROR, 2021-05-21) for the addition and use of the
".DELETE_ON_ERROR" flag.

I.e. this changes the behavior of existing rules in the altered
Makefiles (except "Makefile" &amp; "Documentation/Makefile"). I'm
confident that this is safe having read the relevant rules in those
Makfiles, and as the GNU make manual notes that it isn't the default
behavior is out of an abundance of backwards compatibility
caution. From edition 0.75 of its manual, covering GNU make 4.3:

    [Enabling '.DELETE_ON_ERROR' is] almost always what you want
    'make' to do, but it is not historical practice; so for
    compatibility, you must explicitly request it.

This doesn't introduce a bug by e.g. having this
".DELETE_ON_ERROR" flag only apply to this new shared.mak, Makefiles
have no such scoping semantics.

It does increase the danger that any Makefile without an explicit "The
default target of this Makefile is..." snippet to define the default
target as "all" could have its default rule changed if our new
shared.mak ever defines a "real" rule. In subsequent commits we'll be
careful not to do that, and such breakage would be obvious e.g. in the
case of "make -C t".

We might want to make that less fragile still (e.g. by using
".DEFAULT_GOAL" as noted in the preceding commit), but for now let's
simply include "shared.mak" without adding that boilerplate to all the
Makefiles that don't have it already. Most of those are already
exposed to that potential caveat e.g. due to including "config.mak*".

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>Make templates honour SHELL_PATH and PERL_PATH</title>
<updated>2010-03-20T16:03:52Z</updated>
<author>
<name>Ben Walton</name>
<email>bwalton@artsci.utoronto.ca</email>
</author>
<published>2010-03-20T14:48:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=502be959531b34e2d9283213b7bca51842639240'/>
<id>urn:sha1:502be959531b34e2d9283213b7bca51842639240</id>
<content type='text'>
The hook script templates were hard coded to use /bin/sh and perl.
This patch ensures that they use the same tools specified for the rest
of the suite.

The impetus for the change was noticing that, as shipped, some of the
hooks used shell constructs that wouldn't work under Solaris' /bin/sh
(eg: $(cmd...) substitutions).

Signed-off-by: Ben Walton &lt;bwalton@artsci.utoronto.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Work around option parsing bug in the busybox tar implementation</title>
<updated>2009-10-24T19:25:01Z</updated>
<author>
<name>Andreas Schwab</name>
<email>schwab@linux-m68k.org</email>
</author>
<published>2009-10-24T13:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36e561064e83d3f890f8fa128b3ca4e0d7691f10'/>
<id>urn:sha1:36e561064e83d3f890f8fa128b3ca4e0d7691f10</id>
<content type='text'>
The first argument of the tar command is interpreted as a bundle of
letters specifying the mode of operation and additional options, with
any option arguments taken from subsequent words on the command line
as needed.  The implementation of tar in busybox treats this bundle
as if preceded by a dash and then parses it by getopt rules, which
mishandles 'tar xfo -'.  Use 'tar xof -' instead to work this around.

Signed-off-by: Andreas Schwab &lt;schwab@linux-m68k.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix permission bits on sources checked out with an overtight umask</title>
<updated>2008-09-09T20:32:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-08-22T00:31:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8bdc49265559786533d7f7377b2c39038dd6309'/>
<id>urn:sha1:d8bdc49265559786533d7f7377b2c39038dd6309</id>
<content type='text'>
Two patches 9907721 (templates/Makefile: don't depend on local umask
setting, 2008-02-28) and 96cda0b (templates/Makefile: install is
unnecessary, just use mkdir -p, 2008-08-21) tried to prevent an overtight
umask the builder/installer might have from screwing over the installation
procedure, but we forgot there was another source of trouble.  If the
person who checked out the source tree had an overtight umask, it will
leak out to the built products, which is propagated to the installation
destination.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Install templates with the user and group of the installing personality</title>
<updated>2008-08-20T23:01:45Z</updated>
<author>
<name>Johannes Sixt</name>
<email>johannes.sixt@telecom.at</email>
</author>
<published>2008-08-20T15:36:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71f463773a310de016da20136fd7160685f97faa'/>
<id>urn:sha1:71f463773a310de016da20136fd7160685f97faa</id>
<content type='text'>
If 'make install' was run with sufficient privileges, then the installed
templates, which are copied using 'tar', would receive the user and group
of whoever built git. This instructs 'tar' to ignore the user and group
that are recorded in the archive.

Signed-off-by: Johannes Sixt &lt;johannes.sixt@telecom.at&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>When installing, be prepared that template_dir may be relative.</title>
<updated>2008-06-26T06:47:14Z</updated>
<author>
<name>Johannes Sixt</name>
<email>johannes.sixt@telecom.at</email>
</author>
<published>2008-01-01T21:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b50b860a505d4a1d6fa595a400f3968333e7128'/>
<id>urn:sha1:0b50b860a505d4a1d6fa595a400f3968333e7128</id>
<content type='text'>
Since the Makefile in the template/ subdirectory is only used to install
the templates, we do not simply pass down the setting of template_dir
when it is relative, but construct the intended destination in a new
variable: A relative template_dir is relative to gitexecdir.

Signed-off-by: Johannes Sixt &lt;johannes.sixt@telecom.at&gt;
</content>
</entry>
<entry>
<title>templates/Makefile: don't depend on local umask setting</title>
<updated>2008-02-28T21:36:50Z</updated>
<author>
<name>Gerrit Pape</name>
<email>pape@smarden.org</email>
</author>
<published>2008-02-28T18:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9907721501e19758e64bcce6d3b140316c9307b9'/>
<id>urn:sha1:9907721501e19758e64bcce6d3b140316c9307b9</id>
<content type='text'>
Don't take the local umask setting into account when installing the
templates/* files and directories, running 'make install' with umask set
to 077 resulted in template/* installed with permissions 700 and 600.

The problem was discovered by Florian Zumbiehl, reported through
 http://bugs.debian.org/467518

Signed-off-by: Gerrit Pape &lt;pape@smarden.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
