<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/config.mak.dev, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-07-30T16:16:49Z</updated>
<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>
<entry>
<title>Makefile: allow for combining DEVELOPER=1 and CFLAGS="..."</title>
<updated>2019-02-24T15:35:07Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2019-02-22T14:41:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d5d4b4e9326021f080508126be38ea1beaba6aa'/>
<id>urn:sha1:6d5d4b4e9326021f080508126be38ea1beaba6aa</id>
<content type='text'>
Ever since the DEVELOPER=1 facility introduced there's been no way to
have custom CFLAGS (e.g. CFLAGS="-O0 -g -ggdb3") while still
benefiting from the set of warnings and assertions DEVELOPER=1
enables.

This is because the semantics of variables in the Makefile are such
that the user setting CFLAGS overrides anything we set, including what
we're doing in config.mak.dev[1].

So let's introduce a "DEVELOPER_CFLAGS" variable in config.mak.dev and
add it to ALL_CFLAGS. Before this the ALL_CFLAGS variable
would (basically, there's some nuance we won't go into) be set to:

    $(CPPFLAGS) [$(CFLAGS) *or* $(CFLAGS) in config.mak.dev] $(BASIC_CFLAGS) $(EXTRA_CPPFLAGS)

But will now be:

    $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(BASIC_CFLAGS) $(EXTRA_CPPFLAGS)

The reason for putting DEVELOPER_CFLAGS first is to allow for
selectively overriding something DEVELOPER=1 brings in. On both GCC
and Clang later settings override earlier ones. E.g. "-Wextra
-Wno-extra" will enable no "extra" warnings, but not if those two
arguments are reversed.

Examples of things that weren't possible before, but are now:

    # Use -O0 instead of -O2 for less painful debuggng
    DEVELOPER=1 CFLAGS="-O0 -g"
    # DEVELOPER=1 plus -Wextra, but disable some of the warnings
    DEVELOPER=1 DEVOPTS="no-error extra-all" CFLAGS="-O0 -g -Wno-unused-parameter"

The reason for the patches leading up to this one re-arranged the
various *FLAGS assignments and includes is just for readability. The
Makefile supports assignments out of order, e.g.:

    $ cat Makefile
    X = $(A) $(B) $(C)
    A = A
    B = B
    include c.mak
    all:
            @echo $(X)
    $ cat c.mak
    C=C
    $ make
    A B C

So we could have gotten away with the much smaller change of changing
"CFLAGS" in config.mak.dev to "DEVELOPER_CFLAGS" and adding that to
ALL_CFLAGS earlier in the Makefile "before" the config.mak.*
includes. But I think it's more readable to use variables "after"
they're included.

1. https://www.gnu.org/software/make/manual/html_node/Overriding.html

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>Merge branch 'jk/dev-build-format-security'</title>
<updated>2019-01-18T21:49:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-18T21:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=74ae0652c4736629db9c97f7a3ac7cebedaeae10'/>
<id>urn:sha1:74ae0652c4736629db9c97f7a3ac7cebedaeae10</id>
<content type='text'>
Earlier we added "-Wformat-security" to developer builds, assuming
that "-Wall" (which includes "-Wformat" which in turn is required
to use "-Wformat-security") is always in effect.  This is not true
when config.mak.autogen is in use, unfortunately.  This has been
fixed by unconditionally adding "-Wall" to developer builds.

* jk/dev-build-format-security:
  config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users
</content>
</entry>
<entry>
<title>config.mak.dev: add -Wall, primarily for -Wformat, to help autoconf users</title>
<updated>2019-01-07T17:02:08Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2018-10-12T18:40:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6163f3f1a4288a6a17d2e3cdee4391b25ef09edd'/>
<id>urn:sha1:6163f3f1a4288a6a17d2e3cdee4391b25ef09edd</id>
<content type='text'>
801fa63a90 ("config.mak.dev: add -Wformat-security", 2018-09-08)
added the "-Wformat-security" to the flags set in config.mak.dev.
In the gcc man page this is documented as:

         If -Wformat is specified, also warn about uses of format
         functions that represent possible security problems.  [...]

The commit did however not add the "-Wformat" flag, but instead
relied on the fact that "-Wall" is set in the Makefile by default
and that "-Wformat" is part of "-Wall".

Unfortunately, those who use config.mak.autogen generated with the
autoconf to configure toolchain do *not* get "-Wall" in their CFLAGS
and the added -Wformat-security had no effect.  Worse yet, newer
versions of gcc (gcc 8.2.1 in this particular case) warn about the
lack of "-Wformat" and thus compilation fails only with this option
set.

We could fix it by adding "-Wformat", but in general we do want all
checks included in "-Wall", so let's add it to config.mak.dev to
cover more cases.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/unused-function'</title>
<updated>2018-10-30T06:43:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5cde07a71b5629ecdf5fe41adf41c942743fff5'/>
<id>urn:sha1:c5cde07a71b5629ecdf5fe41adf41c942743fff5</id>
<content type='text'>
Developer support.

* jk/unused-function:
  config.mak.dev: enable -Wunused-function
</content>
</entry>
<entry>
<title>config.mak.dev: enable -Wunused-function</title>
<updated>2018-10-19T01:24:11Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-10-18T07:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36da893114e02b7f0a8ac5eeb5114dec129a4027'/>
<id>urn:sha1:36da893114e02b7f0a8ac5eeb5114dec129a4027</id>
<content type='text'>
We explicitly omitted -Wunused-function when we added
-Wextra, but there is no need: the current code compiles
cleanly with it. And it's worth having, since it can let you
know when there are cascading effects from a cleanup (e.g.,
deleting one function lets you delete its static helpers).

There are cases where we may need an unused function to
exist, but we can handle these easily:

  - macro-generated code like commit-slab; there we have the
    MAYBE_UNUSED annotation to silence the compiler

  - conditional compilation, where we may or may not need a
    static helper. These generally fall into one of two
    categories:

      - the call should not be conditional, but rather the
	function body itself should be (and may just be a
	no-op on one side of the #if). That keeps the
	conditional pollution out of the main code.

      - call-chains of static helpers should all be in the
        same #if block, so they are all-or-nothing

    And if there's some case that doesn't cover, we still
    have MAYBE_UNUSED as a fallback.

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>Merge branch 'jk/dev-build-format-security'</title>
<updated>2018-09-24T17:30:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-24T17:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2bdbe4a2c376ce2d7e8b056b70ce4f1ce92e2d15'/>
<id>urn:sha1:2bdbe4a2c376ce2d7e8b056b70ce4f1ce92e2d15</id>
<content type='text'>
Build tweak to help developers.

* jk/dev-build-format-security:
  config.mak.dev: add -Wformat-security
</content>
</entry>
</feed>
