<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/config.mak.dev, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-11-18T21:32:54Z</updated>
<entry>
<title>Merge branch 'jc/sparse-error-for-developer-build'</title>
<updated>2020-11-18T21:32:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-18T21:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dfbc63da03f584fd4f281dfaffc1cec50e076289'/>
<id>urn:sha1:dfbc63da03f584fd4f281dfaffc1cec50e076289</id>
<content type='text'>
"make DEVELOPER=1 sparse" used to run sparse and let it emit
warnings; now such warnings will cause an error.

* jc/sparse-error-for-developer-build:
  Makefile: enable -Wsparse-error for DEVELOPER build
</content>
</entry>
<entry>
<title>Merge branch 'jk/perl-warning'</title>
<updated>2020-11-09T22:06:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-09T22:06:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65681e75c1e57cb3c575969b4703323e6bdd447f'/>
<id>urn:sha1:65681e75c1e57cb3c575969b4703323e6bdd447f</id>
<content type='text'>
Dev support.

* jk/perl-warning:
  perl: check for perl warnings while running tests
</content>
</entry>
<entry>
<title>Merge branch 'jk/no-common'</title>
<updated>2020-11-02T21:17:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-02T21:17:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5277bd3e26991233199348c62c5bb7ff010f2e34'/>
<id>urn:sha1:5277bd3e26991233199348c62c5bb7ff010f2e34</id>
<content type='text'>
Dev support to catch a tentative definition of a variable in our C
code as an error.

* jk/no-common:
  config.mak.dev: build with -fno-common
</content>
</entry>
<entry>
<title>Makefile: enable -Wsparse-error for DEVELOPER build</title>
<updated>2020-10-31T22:24:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-31T22:22:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=521dc56270d6b4e3258175b6c521e16842acccf7'/>
<id>urn:sha1:521dc56270d6b4e3258175b6c521e16842acccf7</id>
<content type='text'>
With -Wsparse-error, "make sparse" would fail, instead of just
giving a warning message.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>perl: check for perl warnings while running tests</title>
<updated>2020-10-22T06:11:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-10-22T03:24:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5338ed2b26ebf91de246c59e525ad254dcbc7a84'/>
<id>urn:sha1:5338ed2b26ebf91de246c59e525ad254dcbc7a84</id>
<content type='text'>
We set "use warnings" in most of our perl code to catch problems. But as
the name implies, warnings just emit a message to stderr and don't
otherwise affect the program. So our tests are quite likely to miss that
warnings are being spewed, as most of them do not look at stderr.

We could ask perl to make all warnings fatal, but this is likely
annoying for non-developers, who would rather have a running program
with a warning than something that refuses to work at all.

So instead, let's teach the perl code to respect an environment variable
(GIT_PERL_FATAL_WARNINGS) to increase the severity of the warnings. This
can be set for day-to-day running if people want to be really pedantic,
but the primary use is to trigger it within the test suite.

We could also trigger that for every test run, but likewise even the
tests failing may be annoying to distro builders, etc (just as -Werror
would be for compiling C code). So we'll tie it to a special test-mode
variable (GIT_TEST_PERL_FATAL_WARNINGS) that can be set in the
environment or as a Makefile knob, and we'll automatically turn the knob
when DEVELOPER=1 is set. That should give developers and CI the more
careful view without disrupting normal users or packagers.

Note that the mapping from the GIT_TEST_* form to the GIT_* form in
test-lib.sh is necessary even if they had the same name: the perl
scripts need it to be normalized to a perl truth value, and we also have
to make sure it's exported (we might have gotten it from the
environment, but we might also have gotten it from GIT-BUILD-OPTIONS
directly).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config.mak.dev: build with -fno-common</title>
<updated>2020-10-16T15:41:40Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-10-15T19:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55391836224af8a65f3802f4a4c87ece0f2c19a4'/>
<id>urn:sha1:55391836224af8a65f3802f4a4c87ece0f2c19a4</id>
<content type='text'>
It's an easy mistake to define a variable in a header with "int x;" when
you really meant to only declare the variable as "extern int x;"
instead. Clang and gcc will both allow this when building with
"-fcommon"; they put these "tentative definitions" in a common block
which the linker is able to resolve.

This is the default in clang and was the default in gcc until gcc-10,
since it helps some legacy code. However, we would prefer not to rely on
this because:

  - using "extern" makes the intent more clear (so it's a style issue,
    but it's one the compiler can help us catch)

  - according to the gcc manpage, it may yield a speed and code size
    penalty

So let's build explicitly with -fno-common when the DEVELOPER knob is
set, which will let developers using clang and older versions of gcc
notice these problems.

I didn't bother making this conditional on a particular version of gcc.
As far as I know, this option has been available forever in both gcc and
clang, so old versions don't need to avoid it. And we already expect gcc
and clang options throughout config.mak.dev, so it's unlikely anybody
setting the DEVELOPER knob is using anything else. It's a noop on
gcc-10, of course, but it's not worth trying to exclude it there.

Note that there's nothing to fix in the code; we already don't have any
issues here. But if you want to test the patch, you can add a bare "int
x;" into cache.h, which will cause the link step to fail.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repository: enable SHA-256 support by default</title>
<updated>2020-07-30T16:16:49Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-07-29T23:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eff45daab8a5414f38bda6d83c6669f1bf95e570'/>
<id>urn:sha1:eff45daab8a5414f38bda6d83c6669f1bf95e570</id>
<content type='text'>
Now that we have a complete SHA-256 implementation in Git, let's enable
it so people can use it.  Remove the ENABLE_SHA256 define constant
everywhere it's used.  Add tests for initializing a repository with
SHA-256.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Reviewed-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bc/sha-256-part-1-of-4'</title>
<updated>2020-03-27T00:11:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-27T00:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8cb64e3d4d512a86c1b7b3aa584f11740b3d038'/>
<id>urn:sha1:f8cb64e3d4d512a86c1b7b3aa584f11740b3d038</id>
<content type='text'>
SHA-256 transition continues.

* bc/sha-256-part-1-of-4: (22 commits)
  fast-import: add options for rewriting submodules
  fast-import: add a generic function to iterate over marks
  fast-import: make find_marks work on any mark set
  fast-import: add helper function for inserting mark object entries
  fast-import: permit reading multiple marks files
  commit: use expected signature header for SHA-256
  worktree: allow repository version 1
  init-db: move writing repo version into a function
  builtin/init-db: add environment variable for new repo hash
  builtin/init-db: allow specifying hash algorithm on command line
  setup: allow check_repository_format to read repository format
  t/helper: make repository tests hash independent
  t/helper: initialize repository if necessary
  t/helper/test-dump-split-index: initialize git repository
  t6300: make hash algorithm independent
  t6300: abstract away SHA-1-specific constants
  t: use hash-specific lookup tables to define test constants
  repository: require a build flag to use SHA-256
  hex: add functions to parse hex object IDs in any algorithm
  hex: introduce parsing variants taking hash algorithms
  ...
</content>
</entry>
<entry>
<title>config.mak.dev: re-enable -Wformat-zero-length</title>
<updated>2020-02-28T16:39:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-02-27T23:54:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7329d94be72654f7f211e1bfa5ce3dd6fd2dc1fa'/>
<id>urn:sha1:7329d94be72654f7f211e1bfa5ce3dd6fd2dc1fa</id>
<content type='text'>
We recently triggered some -Wformat-zero-length warnings in the code,
but no developers noticed because we suppress that warning in builds
with the DEVELOPER=1 Makefile knob set. But we _don't_ suppress them in
a non-developer build (and they're part of -Wall). So even though
non-developers probably aren't using -Werror, they see the annoying
warnings when they build.

We've had back and forth discussion over the years on whether this
warning is useful or not. In most cases we've seen, it's not true that
the call is a mistake, since we're using its side effects (like adding a
newline status_printf_ln()) or writing an empty string to a destination
which is handled by the function (as in write_file()). And so we end up
working around it in the source by passing ("%s", "").

There's more discussion in the subthread starting at:

  https://lore.kernel.org/git/xmqqtwaod7ly.fsf@gitster.mtv.corp.google.com/

The short of it is that we probably can't just disable the warning for
everybody because of portability issues. And ignoring it for developers
puts us in the situation we're in now, where non-dev builds are annoyed.

Since the workaround is both rarely needed and fairly straight-forward,
let's just commit to doing it as necessary, and re-enable the warning.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repository: require a build flag to use SHA-256</title>
<updated>2020-02-24T17:33:21Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-02-22T20:17:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=94127599252d85e85571ecde740ea97e59e4bede'/>
<id>urn:sha1:94127599252d85e85571ecde740ea97e59e4bede</id>
<content type='text'>
At this point, SHA-256 support is experimental and some behavior may
change. To avoid surprising unsuspecting users, require a build flag,
ENABLE_SHA256, to allow use of a non-SHA-1 algorithm. Enable this flag
by default when the DEVELOPER make flag is set so that contributors can
test this case adequately.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
