<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/submodule.c, 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-12-09T20:32:07Z</updated>
<entry>
<title>submodules: fix of regression on fetching of non-init subsub-repo</title>
<updated>2020-12-09T20:32:07Z</updated>
<author>
<name>Peter Kaestle</name>
<email>peter.kaestle@nokia.com</email>
</author>
<published>2020-12-09T10:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=505a27659638614157a36b218fdaf25fe9fed0ce'/>
<id>urn:sha1:505a27659638614157a36b218fdaf25fe9fed0ce</id>
<content type='text'>
A regression has been introduced by a62387b (submodule.c: fetch in
submodules git directory instead of in worktree, 2018-11-28).

The scenario in which it triggers is when one has a repository with a
submodule inside a submodule like this:
superproject/middle_repo/inner_repo

Person A and B have both a clone of it, while Person B is not working
with the inner_repo and thus does not have it initialized in his working
copy.

Now person A introduces a change to the inner_repo and propagates it
through the middle_repo and the superproject.

Once person A pushed the changes and person B wants to fetch them using
"git fetch" at the superproject level, B's git call will return with
error saying:

Could not access submodule 'inner_repo'
Errors during submodule fetch:
         middle_repo

Expectation is that in this case the inner submodule will be recognized
as uninitialized submodule and skipped by the git fetch command.

This used to work correctly before 'a62387b (submodule.c: fetch in
submodules git directory instead of in worktree, 2018-11-28)'.

Starting with a62387b the code wants to evaluate "is_empty_dir()" inside
.git/modules for a directory only existing in the worktree, delivering
then of course wrong return value.

This patch ensures is_empty_dir() is getting the correct path of the
uninitialized submodule by concatenation of the actual worktree and the
name of the uninitialized submodule.

The first attempt to fix this regression, in 1b7ac4e6d4 (submodules:
fix of regression on fetching of non-init subsub-repo, 2020-11-12), by
simply reverting a62387b, resulted in an infinite loop of submodule
fetches in the simpler case of a recursive fetch of a superproject with
uninitialized submodules, and so this commit was reverted in 7091499bc0
(Revert "submodules: fix of regression on fetching of non-init
subsub-repo", 2020-12-02).
To prevent future breakages, also add a regression test for this
scenario.

Signed-off-by: Peter Kaestle &lt;peter.kaestle@nokia.com&gt;
CC: Junio C Hamano &lt;gitster@pobox.com&gt;
CC: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
CC: Ralf Thielow &lt;ralf.thielow@gmail.com&gt;
CC: Eric Sunshine &lt;sunshine@sunshineco.us&gt;
Reviewed-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'so/combine-diff-simplify'</title>
<updated>2020-10-05T21:01:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-05T21:01:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34415c76c8f67c8692090ef4911d1626689e8f38'/>
<id>urn:sha1:34415c76c8f67c8692090ef4911d1626689e8f38</id>
<content type='text'>
Code simplification.

* so/combine-diff-simplify:
  diff: get rid of redundant 'dense' argument
</content>
</entry>
<entry>
<title>diff: get rid of redundant 'dense' argument</title>
<updated>2020-09-29T18:54:53Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2020-09-29T11:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d01141de5ab02cf4a156183ef4dc5ee8bf2638a3'/>
<id>urn:sha1:d01141de5ab02cf4a156183ef4dc5ee8bf2638a3</id>
<content type='text'>
Get rid of 'dense' argument that is redundant for every function that has
'struct rev_info *rev' argument as well, as the value of 'dense' passed is
always taken from 'rev-&gt;dense_combined_merges' field.

The only place where this was not the case is in 'submodule.c' where
'diff_tree_combined_merge()' was called with '1' for 'dense' argument. However,
at that call the 'revs' instance used is local to the function, and we now just
set 'revs-&gt;dense_combined_merges' to 1 in this local instance.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mf/submodule-summary-with-correct-repository'</title>
<updated>2020-09-19T00:58:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-19T00:58:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4831c23f75556df8906a508454d70faca0facd27'/>
<id>urn:sha1:4831c23f75556df8906a508454d70faca0facd27</id>
<content type='text'>
"git diff/show" on a change that involves a submodule used to read
the information on commits in the submodule from a wrong repository
and gave a wrong information when the commit-graph is involved.

* mf/submodule-summary-with-correct-repository:
  submodule: use submodule repository when preparing summary
  revision: use repository from rev_info when parsing commits
</content>
</entry>
<entry>
<title>Merge branch 'os/collect-changed-submodules-optim'</title>
<updated>2020-09-19T00:58:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-19T00:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ce9d4e5c7186e15f2e2f7be06a9db52b5e61bde'/>
<id>urn:sha1:2ce9d4e5c7186e15f2e2f7be06a9db52b5e61bde</id>
<content type='text'>
Optimization around submodule handling.

* os/collect-changed-submodules-optim:
  submodule: suppress checking for file name and ref ambiguity for object ids
</content>
</entry>
<entry>
<title>Merge branch 'ss/submodule-summary-in-c'</title>
<updated>2020-09-09T20:53:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-09T20:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bbdba3d88320cd99ae3425f31e4c20213a877cac'/>
<id>urn:sha1:bbdba3d88320cd99ae3425f31e4c20213a877cac</id>
<content type='text'>
Yet another subcommand of "git submodule" is getting rewritten in C.

* ss/submodule-summary-in-c:
  submodule: port submodule subcommand 'summary' from shell to C
  t7421: introduce a test script for verifying 'summary' output
  submodule: rename helper functions to avoid ambiguity
  submodule: remove extra line feeds between callback struct and macro
</content>
</entry>
<entry>
<title>submodule: suppress checking for file name and ref ambiguity for object ids</title>
<updated>2020-09-06T21:44:41Z</updated>
<author>
<name>Orgad Shaneh</name>
<email>orgads@gmail.com</email>
</author>
<published>2020-09-06T20:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a462bee5d5b52c9778a9df600494fbd87f3c5fb9'/>
<id>urn:sha1:a462bee5d5b52c9778a9df600494fbd87f3c5fb9</id>
<content type='text'>
The argv argument of collect_changed_submodules() contains only object ids
(the objects references of all the refs).

Notify setup_revisions() that the input is not filenames by passing
assume_dashdash, so it can avoid redundant stat for each ref.

Also suppress refname_ambiguity flag to avoid filesystem lookups for
each object. Similar logic can be found in cat-file, pack-objects and more.

This change reduces the time for git fetch in my repo from 25s to 6s.

Signed-off-by: Orgad Shaneh &lt;orgads@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/run-command-use-embedded-args'</title>
<updated>2020-09-03T19:37:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-03T19:37:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f02c0ad360d96e8dbba92f97b42ebbaa4319db1'/>
<id>urn:sha1:3f02c0ad360d96e8dbba92f97b42ebbaa4319db1</id>
<content type='text'>
Various callers of run_command API has been modernized.

* jc/run-command-use-embedded-args:
  run_command: teach API users to use embedded 'args' more
</content>
</entry>
<entry>
<title>Merge branch 'jk/leakfix'</title>
<updated>2020-08-27T21:04:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-27T21:04:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d9a8e33f9fd07efa10072576df01a9cae5d89e6'/>
<id>urn:sha1:0d9a8e33f9fd07efa10072576df01a9cae5d89e6</id>
<content type='text'>
Code clean-up.

* jk/leakfix:
  submodule--helper: fix leak of core.worktree value
  config: fix leak in git_config_get_expiry_in_days()
  config: drop git_config_get_string_const()
  config: fix leaks from git_config_get_string_const()
  checkout: fix leak of non-existent branch names
  submodule--helper: use strbuf_release() to free strbufs
  clear_pattern_list(): clear embedded hashmaps
</content>
</entry>
<entry>
<title>run_command: teach API users to use embedded 'args' more</title>
<updated>2020-08-26T22:32:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-26T22:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afbdba391eaf3c473eff8f12437ff510935b520f'/>
<id>urn:sha1:afbdba391eaf3c473eff8f12437ff510935b520f</id>
<content type='text'>
The child_process structure has an embedded strvec for formulating
the command line argument list these days, but code that predates
the wide use of it prepared a separate char *argv[] array and
manually set the child_process.argv pointer point at it.

Teach these old-style code to lose the separate argv[] array.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
