<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.27.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v2.27.0</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.27.0'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2020-03-27T00:11:20Z</updated>
<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>
<entry>
<title>prefix_path: show gitdir if worktree unavailable</title>
<updated>2020-03-15T16:35:46Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-03-03T04:05:06Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=5c20398699165a91af2d81ea2d20385bc8dd3627'/>
<id>urn:sha1:5c20398699165a91af2d81ea2d20385bc8dd3627</id>
<content type='text'>
If there is no worktree at present, we can still hint the user about
Git's current directory by showing them the absolute path to the Git
directory. Even though the Git directory doesn't make it as easy to
locate the worktree in question, it can still help a user figure out
what's going on while developing a script.

This fixes a segmentation fault introduced in e0020b2f
("prefix_path: show gitdir when arg is outside repo", 2020-02-14).

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.com&gt;
[jc: added minimum tests, with help from Szeder Gábor]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>real_path_if_valid(): remove unsafe API</title>
<updated>2020-03-10T18:41:40Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2020-03-10T13:11:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4530a85b4c34f009b5f190eb2dc8367801de5028'/>
<id>urn:sha1:4530a85b4c34f009b5f190eb2dc8367801de5028</id>
<content type='text'>
This commit continues the work started with previous commit.

Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>real_path: remove unsafe API</title>
<updated>2020-03-10T18:41:40Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2020-03-10T13:11:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3d7747e318532a36a263c61cdf92f2decb6424ff'/>
<id>urn:sha1:3d7747e318532a36a263c61cdf92f2decb6424ff</id>
<content type='text'>
Returning a shared buffer invites very subtle bugs due to reentrancy or
multi-threading, as demonstrated by the previous patch.

There was an unfinished effort to abolish this [1].

Let's finally rid of `real_path()`, using `strbuf_realpath()` instead.

This patch uses a local `strbuf` for most places where `real_path()` was
previously called.

However, two places return the value of `real_path()` to the caller. For
them, a `static` local `strbuf` was added, effectively pushing the
problem one level higher:
    read_gitfile_gently()
    get_superproject_working_tree()

[1] https://lore.kernel.org/git/1480964316-99305-1-git-send-email-bmwill@google.com/

Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>set_git_dir: fix crash when used with real_path()</title>
<updated>2020-03-06T22:45:51Z</updated>
<author>
<name>Alexandr Miloslavskiy</name>
<email>alexandr.miloslavskiy@syntevo.com</email>
</author>
<published>2020-03-06T19:03:13Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0915a5b4cdf00a8c6c755b77b854725a183993b4'/>
<id>urn:sha1:0915a5b4cdf00a8c6c755b77b854725a183993b4</id>
<content type='text'>
`real_path()` returns result from a shared buffer, inviting subtle
reentrance bugs. One of these bugs occur when invoked this way:
    set_git_dir(real_path(git_dir))

In this case, `real_path()` has reentrance:
    real_path
    read_gitfile_gently
    repo_set_gitdir
    setup_git_env
    set_git_dir_1
    set_git_dir

Later, `set_git_dir()` uses its now-dead parameter:
    !is_absolute_path(path)

Fix this by using a dedicated `strbuf` to hold `strbuf_realpath()`.

Signed-off-by: Alexandr Miloslavskiy &lt;alexandr.miloslavskiy@syntevo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>setup: allow check_repository_format to read repository format</title>
<updated>2020-02-24T17:33:27Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2020-02-22T20:17:37Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=cfe3917c85f38c3367de7b6f5838ecaf6d1e148d'/>
<id>urn:sha1:cfe3917c85f38c3367de7b6f5838ecaf6d1e148d</id>
<content type='text'>
In some cases, we will want to not only check the repository format, but
extract the information that we've gained.  To do so, allow
check_repository_format to take a pointer to struct repository_format.
Allow passing NULL for this argument if we're not interested in the
information, and pass NULL for all existing callers.  A future patch
will make use of this information.

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 'es/outside-repo-errmsg-hints'</title>
<updated>2020-02-17T21:22:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-17T21:22:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f97741f6e9c46a75b4322760d77322e53c4322d7'/>
<id>urn:sha1:f97741f6e9c46a75b4322760d77322e53c4322d7</id>
<content type='text'>
Error message clarification.

* es/outside-repo-errmsg-hints:
  prefix_path: show gitdir when arg is outside repo
</content>
</entry>
<entry>
<title>prefix_path: show gitdir when arg is outside repo</title>
<updated>2020-02-16T23:32:59Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-02-15T01:00:13Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e0020b2f82910f50bc697d86aff70c3796fbdc41'/>
<id>urn:sha1:e0020b2f82910f50bc697d86aff70c3796fbdc41</id>
<content type='text'>
When developing a script, it can be painful to understand why Git thinks
something is outside the current repo, if the current repo isn't what
the user thinks it is. Since this can be tricky to diagnose, especially
in cases like submodules or nested worktrees, let's give the user a hint
about which repository is offended about that path.

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