<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/submodule.c, branch v2.19.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.19.0</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v2.19.0'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2018-09-08T02:05:20Z</updated>
<entry>
<title>Revert "Merge branch 'sb/submodule-core-worktree'"</title>
<updated>2018-09-08T02:05:20Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2018-09-08T00:09:46Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f178c13fdac42763a7aa58bf260aa67d9f4393ec'/>
<id>urn:sha1:f178c13fdac42763a7aa58bf260aa67d9f4393ec</id>
<content type='text'>
This reverts commit 7e25437d35a70791b345872af202eabfb3e1a8bc, reversing
changes made to 00624d608cc69bd62801c93e74d1ea7a7ddd6598.

v2.19.0-rc0~165^2~1 (submodule: ensure core.worktree is set after
update, 2018-06-18) assumes an "absorbed" submodule layout, where the
submodule's Git directory is in the superproject's .git/modules/
directory and .git in the submodule worktree is a .git file pointing
there.  In particular, it uses $GIT_DIR/modules/$name to find the
submodule to find out whether it already has core.worktree set, and it
uses connect_work_tree_and_git_dir if not, resulting in

	fatal: could not open sub/.git for writing

The context behind that patch: v2.19.0-rc0~165^2~2 (submodule: unset
core.worktree if no working tree is present, 2018-06-12) unsets
core.worktree when running commands like "git checkout
--recurse-submodules" to switch to a branch without the submodule.  If
a user then uses "git checkout --no-recurse-submodules" to switch back
to a branch with the submodule and runs "git submodule update", this
patch is needed to ensure that commands using the submodule directly
are aware of the path to the worktree.

It is late in the release cycle, so revert the whole 3-patch series.
We can try again later for 2.20.

Reported-by: Allan Sandfeld Jensen &lt;allan.jensen@qt.io&gt;
Helped-by: Stefan Beller &lt;sbeller@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>submodule.c: use the right index instead of the_index</title>
<updated>2018-08-13T21:14:43Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-13T16:14:31Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=68f08b4b235d09a95604c6bc8349208b37a2f41e'/>
<id>urn:sha1:68f08b4b235d09a95604c6bc8349208b37a2f41e</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>dir.c: remove an implicit dependency on the_index in pathspec code</title>
<updated>2018-08-13T21:14:42Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-13T16:14:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6d2df284e7f4d7cd9f46992282ef59a72a9db527'/>
<id>urn:sha1:6d2df284e7f4d7cd9f46992282ef59a72a9db527</id>
<content type='text'>
Make the match_patchspec API and friends take an index_state instead
of assuming the_index in dir.c. All external call sites are converted
blindly to keep the patch simple and retain current behavior.
Individual call sites may receive further updates to use the right
index instead of the_index.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/object-store-lookup'</title>
<updated>2018-08-02T22:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-02T22:30:42Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3a2a1dc17077a27ad1a89db27cb1b4b374f3b0ff'/>
<id>urn:sha1:3a2a1dc17077a27ad1a89db27cb1b4b374f3b0ff</id>
<content type='text'>
lookup_commit_reference() and friends have been updated to find
in-core object for a specific in-core repository instance.

* sb/object-store-lookup: (32 commits)
  commit.c: allow lookup_commit_reference to handle arbitrary repositories
  commit.c: allow lookup_commit_reference_gently to handle arbitrary repositories
  tag.c: allow deref_tag to handle arbitrary repositories
  object.c: allow parse_object to handle arbitrary repositories
  object.c: allow parse_object_buffer to handle arbitrary repositories
  commit.c: allow get_cached_commit_buffer to handle arbitrary repositories
  commit.c: allow set_commit_buffer to handle arbitrary repositories
  commit.c: migrate the commit buffer to the parsed object store
  commit-slabs: remove realloc counter outside of slab struct
  commit.c: allow parse_commit_buffer to handle arbitrary repositories
  tag: allow parse_tag_buffer to handle arbitrary repositories
  tag: allow lookup_tag to handle arbitrary repositories
  commit: allow lookup_commit to handle arbitrary repositories
  tree: allow lookup_tree to handle arbitrary repositories
  blob: allow lookup_blob to handle arbitrary repositories
  object: allow lookup_object to handle arbitrary repositories
  object: allow object_as_type to handle arbitrary repositories
  tag: add repository argument to deref_tag
  tag: add repository argument to parse_tag_buffer
  tag: add repository argument to lookup_tag
  ...
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-move-head-error-msg'</title>
<updated>2018-07-24T21:50:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-07-24T21:50:43Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=392b3dde513083b9975c990cd2cf410d2846b941'/>
<id>urn:sha1:392b3dde513083b9975c990cd2cf410d2846b941</id>
<content type='text'>
"git checkout --recurse-submodules another-branch" did not report
in which submodule it failed to update the working tree, which
resulted in an unhelpful error message.

* sb/submodule-move-head-error-msg:
  submodule.c: report the submodule that an error occurs in
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-core-worktree'</title>
<updated>2018-07-18T19:20:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-07-18T19:20:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=7e25437d35a70791b345872af202eabfb3e1a8bc'/>
<id>urn:sha1:7e25437d35a70791b345872af202eabfb3e1a8bc</id>
<content type='text'>
"git submodule" did not correctly adjust core.worktree setting that
indicates whether/where a submodule repository has its associated
working tree across various state transitions, which has been
corrected.

* sb/submodule-core-worktree:
  submodule deinit: unset core.worktree
  submodule: ensure core.worktree is set after update
  submodule: unset core.worktree if no working tree is present
</content>
</entry>
<entry>
<title>commit: add repository argument to lookup_commit_reference</title>
<updated>2018-06-29T17:43:39Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:21:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2122f6754c93be8f02bfb5704ed96c88fc9837a8'/>
<id>urn:sha1:2122f6754c93be8f02bfb5704ed96c88fc9837a8</id>
<content type='text'>
Add a repository argument to allow callers of lookup_commit_reference
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule.c: report the submodule that an error occurs in</title>
<updated>2018-06-25T16:06:15Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-20T22:32:53Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ba95d4e4bdf03badef6bc5c44bc059464f3e79d3'/>
<id>urn:sha1:ba95d4e4bdf03badef6bc5c44bc059464f3e79d3</id>
<content type='text'>
When an error occurs in updating the working tree of a submodule in
submodule_move_head, tell the user which submodule the error occurred in.

The call to read-tree contains a super-prefix, such that the read-tree
will correctly report any path related issues, but some error messages
do not contain a path, for example:

  ~/gerrit$ git checkout --recurse-submodules origin/master
  ~/gerrit$ fatal: failed to unpack tree object 07672f31880ba80300b38492df9d0acfcd6ee00a

Give the hint which submodule has a problem.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: unset core.worktree if no working tree is present</title>
<updated>2018-06-14T21:13:46Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-12T23:58:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4fa4f90ccd85842e1187e5a5daf4633dceaab779'/>
<id>urn:sha1:4fa4f90ccd85842e1187e5a5daf4633dceaab779</id>
<content type='text'>
When a submodules work tree is removed, we should unset its core.worktree
setting as the worktree is no longer present. This is not just in line
with the conceptual view of submodules, but it fixes an inconvenience
for looking at submodules that are not checked out:

    git clone --recurse-submodules git://github.com/git/git &amp;&amp; cd git &amp;&amp;
    git checkout --recurse-submodules v2.13.0
    git -C .git/modules/sha1collisiondetection log
    fatal: cannot chdir to '../../../sha1collisiondetection': \
        No such file or directory

With this patch applied, the final call to git log works instead of dying
in its setup, as the checkout will unset the core.worktree setting such
that following log will be run in a bare repository.

This patch covers all commands that are in the unpack machinery, i.e.
checkout, read-tree, reset. A follow up patch will address
"git submodule deinit", which will also make use of the new function
submodule_unset_core_worktree(), which is why we expose it in this patch.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: fix NULL correctness in renamed broken submodules</title>
<updated>2018-06-14T21:02:23Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-14T17:31:07Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=5fc84755f1478ea8c0f05b8d7be67a3c96a24bff'/>
<id>urn:sha1:5fc84755f1478ea8c0f05b8d7be67a3c96a24bff</id>
<content type='text'>
When fetching with recursing into submodules, the fetch logic inspects
the superproject which submodules actually need to be fetched. This is
tricky for submodules that were renamed in the fetched range of commits.
This was implemented in c68f8375760 (implement fetching of moved
submodules, 2017-10-16), and this patch fixes a mistake in the logic
there.

When the warning is printed, the `name` might be NULL as
default_name_or_path can return NULL, so fix the warning to use the path
as obtained from the diff machinery, as that is not NULL.

While at it, make sure we only attempt to load the submodule if a git
directory of the submodule is found as default_name_or_path will return
NULL in case the git directory cannot be found. Note that passing NULL
to submodule_from_name is just a semantic error, as submodule_from_name
accepts NULL as a value, but then the return value is not the submodule
that was asked for, but some arbitrary other submodule. (Cf. 'config_from'
in submodule-config.c: "If any parameter except the cache is a NULL
pointer just return the first submodule. Can be used to check whether
there are any submodules parsed.")

Reported-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Helped-by: Duy Nguyen &lt;pclouds@gmail.com&gt;
Helped-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Acked-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
