<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.28.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.28.1</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.28.1'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2020-07-17T00:58:42Z</updated>
<entry>
<title>Merge branch 'jn/v0-with-extensions-fix' into master</title>
<updated>2020-07-17T00:58:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-17T00:58:42Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d13b7f21989335c0ac14e3a0c7eaaee0bc30ea70'/>
<id>urn:sha1:d13b7f21989335c0ac14e3a0c7eaaee0bc30ea70</id>
<content type='text'>
In 2.28-rc0, we corrected a bug that some repository extensions are
honored by mistake even in a version 0 repositories (these
configuration variables in extensions.* namespace were supposed to
have special meaning in repositories whose version numbers are 1 or
higher), but this was a bit too big a change.

* jn/v0-with-extensions-fix:
  repository: allow repository format upgrade with extensions
  Revert "check_repository_format_gently(): refuse extensions for old repositories"
</content>
</entry>
<entry>
<title>repository: allow repository format upgrade with extensions</title>
<updated>2020-07-16T16:36:39Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2020-07-16T06:28:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=62f2eca6065d0c27b0ea3b7806a590466ea04960'/>
<id>urn:sha1:62f2eca6065d0c27b0ea3b7806a590466ea04960</id>
<content type='text'>
Now that we officially permit repository extensions in repository
format v0, permit upgrading a repository with extensions from v0 to v1
as well.

For example, this means a repository where the user has set
"extensions.preciousObjects" can use "git fetch --filter=blob:none
origin" to upgrade the repository to use v1 and the partial clone
extension.

To avoid mistakes, continue to forbid repository format upgrades in v0
repositories with an unrecognized extension.  This way, a v0 user
using a misspelled extension field gets a chance to correct the
mistake before updating to the less forgiving v1 format.

While we're here, make the error message for failure to upgrade the
repository format a bit shorter, and present it as an error, not a
warning.

Reported-by: Huan Huan Chen &lt;huanhuanchen@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Revert "check_repository_format_gently(): refuse extensions for old repositories"</title>
<updated>2020-07-16T16:36:37Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2020-07-16T06:24:29Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=11664196ac15b0382793ec0923e56a103e973bc9'/>
<id>urn:sha1:11664196ac15b0382793ec0923e56a103e973bc9</id>
<content type='text'>
This reverts commit 14c7fa269e42df4133edd9ae7763b678ed6594cd.

The core.repositoryFormatVersion field was introduced in ab9cb76f661
(Repository format version check., 2005-11-25), providing a welcome
bit of forward compatibility, thanks to some welcome analysis by
Martin Atukunda.  The semantics are simple: a repository with
core.repositoryFormatVersion set to 0 should be comprehensible by all
Git implementations in active use; and Git implementations should
error out early instead of trying to act on Git repositories with
higher core.repositoryFormatVersion values representing new formats
that they do not understand.

A new repository format did not need to be defined until 00a09d57eb8
(introduce "extensions" form of core.repositoryformatversion,
2015-06-23).  This provided a finer-grained extension mechanism for
Git repositories.  In a repository with core.repositoryFormatVersion
set to 1, Git implementations can act on "extensions.*" settings that
modify how a repository is interpreted.  In repository format version
1, unrecognized extensions settings cause Git to error out.

What happens if a user sets an extension setting but forgets to
increase the repository format version to 1?  The extension settings
were still recognized in that case; worse, unrecognized extensions
settings do *not* cause Git to error out.  So combining repository
format version 0 with extensions settings produces in some sense the
worst of both worlds.

To improve that situation, since 14c7fa269e4
(check_repository_format_gently(): refuse extensions for old
repositories, 2020-06-05) Git instead ignores extensions in v0 mode.
This way, v0 repositories get the historical (pre-2015) behavior and
maintain compatibility with Git implementations that do not know about
the v1 format.  Unfortunately, users had been using this sort of
configuration and this behavior change came to many as a surprise:

- users of "git config --worktree" that had followed its advice
  to enable extensions.worktreeConfig (without also increasing the
  repository format version) would find their worktree configuration
  no longer taking effect

- tools such as copybara[*] that had set extensions.partialClone in
  existing repositories (without also increasing the repository format
  version) would find that setting no longer taking effect

The behavior introduced in 14c7fa269e4 might be a good behavior if we
were traveling back in time to 2015, but we're far too late.  For some
reason I thought that it was what had been originally implemented and
that it had regressed.  Apologies for not doing my research when
14c7fa269e4 was under development.

Let's return to the behavior we've had since 2015: always act on
extensions.* settings, regardless of repository format version.  While
we're here, include some tests to describe the effect on the "upgrade
repository version" code path.

[*] https://github.com/google/copybara/commit/ca76c0b1e13c4e36448d12c2aba4a5d9d98fb6e7

Reported-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-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 'bc/sha-256-part-2'</title>
<updated>2020-07-07T05:09:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-07T05:09:13Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=12210859da0c16c644dab658d9e1ef671ec28788'/>
<id>urn:sha1:12210859da0c16c644dab658d9e1ef671ec28788</id>
<content type='text'>
SHA-256 migration work continues.

* bc/sha-256-part-2: (44 commits)
  remote-testgit: adapt for object-format
  bundle: detect hash algorithm when reading refs
  t5300: pass --object-format to git index-pack
  t5704: send object-format capability with SHA-256
  t5703: use object-format serve option
  t5702: offer an object-format capability in the test
  t/helper: initialize the repository for test-sha1-array
  remote-curl: avoid truncating refs with ls-remote
  t1050: pass algorithm to index-pack when outside repo
  builtin/index-pack: add option to specify hash algorithm
  remote-curl: detect algorithm for dumb HTTP by size
  builtin/ls-remote: initialize repository based on fetch
  t5500: make hash independent
  serve: advertise object-format capability for protocol v2
  connect: parse v2 refs with correct hash algorithm
  connect: pass full packet reader when parsing v2 refs
  Documentation/technical: document object-format for protocol v2
  t1302: expect repo format version 1 for SHA-256
  builtin/show-index: provide options to determine hash algo
  t5302: modernize test formatting
  ...
</content>
</entry>
<entry>
<title>check_repository_format_gently(): refuse extensions for old repositories</title>
<updated>2020-06-05T17:13:30Z</updated>
<author>
<name>Xin Li</name>
<email>delphij@google.com</email>
</author>
<published>2020-06-05T09:10:04Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=14c7fa269e42df4133edd9ae7763b678ed6594cd'/>
<id>urn:sha1:14c7fa269e42df4133edd9ae7763b678ed6594cd</id>
<content type='text'>
Previously, extensions were recognized regardless of repository format
version.  If the user sets an undefined "extensions" value on a
repository of version 0 and that value is used by a future git version,
they might get an undesired result.

Because all extensions now also upgrade repository versions, tightening
the check would help avoid this for future extensions.

Signed-off-by: Xin Li &lt;delphij@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repository: add a helper function to perform repository format upgrade</title>
<updated>2020-06-05T17:13:30Z</updated>
<author>
<name>Xin Li</name>
<email>delphij@google.com</email>
</author>
<published>2020-06-05T09:10:01Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=16af5f1abb2b3291f96a248698449c48c6a0ec36'/>
<id>urn:sha1:16af5f1abb2b3291f96a248698449c48c6a0ec36</id>
<content type='text'>
In version 1 of repository format, "extensions" gained special meaning
and it is safer to avoid upgrading when there are pre-existing
extensions.

Make list-objects-filter to use the helper function instead of setting
repository version directly as a prerequisite of exposing the upgrade
capability.

Signed-off-by: Xin Li &lt;delphij@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: set the_repository's hash algo when checking format</title>
<updated>2020-05-27T17:07:06Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-05-25T19:59:08Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d553acebeeda584e0e749cfe04dad450c667de90'/>
<id>urn:sha1:d553acebeeda584e0e749cfe04dad450c667de90</id>
<content type='text'>
When we're checking the repository's format, set the hash algorithm at
the same time.  This ensures that we perform a suitable initialization
early enough to avoid confusing any parts of the code.  If we defer
until later, we can end up with portions of the code which are confused
about the hash algorithm, resulting in segfaults when working with
SHA-256 repositories.

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>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://www.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>Merge branch 'am/real-path-fix'</title>
<updated>2020-03-25T20:57:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-25T20:57:42Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4d0e8996ec54e53149c2f24075eb64921ca61812'/>
<id>urn:sha1:4d0e8996ec54e53149c2f24075eb64921ca61812</id>
<content type='text'>
The real_path() convenience function can easily be misused; with a
bit of code refactoring in the callers' side, its use has been
eliminated.

* am/real-path-fix:
  get_superproject_working_tree(): return strbuf
  real_path_if_valid(): remove unsafe API
  real_path: remove unsafe API
  set_git_dir: fix crash when used with real_path()
</content>
</entry>
<entry>
<title>Merge branch 'es/outside-repo-errmsg-hints'</title>
<updated>2020-03-16T19:43:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-16T19:43:29Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e96327c94799460e02b38b242995eab0600ebbd6'/>
<id>urn:sha1:e96327c94799460e02b38b242995eab0600ebbd6</id>
<content type='text'>
An earlier update to show the location of working tree in the error
message did not consider the possibility that a git command may be
run in a bare repository, which has been corrected.

* es/outside-repo-errmsg-hints:
  prefix_path: show gitdir if worktree unavailable
</content>
</entry>
</feed>
