<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/submodule.h, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-08-19T18:43:10Z</updated>
<entry>
<title>submodule: allow erroneous values for the fetchRecurseSubmodules option</title>
<updated>2015-08-19T18:43:10Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:22:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=027771fcb153e0003bcb2d68e1838594a48b0161'/>
<id>urn:sha1:027771fcb153e0003bcb2d68e1838594a48b0161</id>
<content type='text'>
We should not die when reading the submodule config cache since the
user might not be able to get out of that situation when the
configuration is part of the history.

We should handle this condition later when the value is about to be
used.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
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: use new config API for worktree configurations</title>
<updated>2015-08-19T18:43:10Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=851e18c3859ad0f9f7e91fdb4d6cce5a8272420b'/>
<id>urn:sha1:851e18c3859ad0f9f7e91fdb4d6cce5a8272420b</id>
<content type='text'>
We remove the extracted functions and directly parse into and read out
of the cache. This allows us to have one unified way of accessing
submodule configuration values specific to single submodules. Regardless
whether we need to access a configuration from history or from the
worktree.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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: implement a config API for lookup of .gitmodules values</title>
<updated>2015-08-19T18:43:09Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:21:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=959b5455d07c7724eea9d323ca8ce6bb6ddde40e'/>
<id>urn:sha1:959b5455d07c7724eea9d323ca8ce6bb6ddde40e</id>
<content type='text'>
In a superproject some commands need to interact with submodules. They
need to query values from the .gitmodules file either from the worktree
of from certain revisions. At the moment this is quite hard since a
caller would need to read the .gitmodules file from the history and then
parse the values. We want to provide an API for this so we have one
place to get values from .gitmodules from any revision (including the
worktree).

The API is realized as a cache which allows us to lazily read
.gitmodules configurations by commit into a runtime cache which can then
be used to easily lookup values from it. Currently only the values for
path or name are stored but it can be extended for any value needed.

It is expected that .gitmodules files do not change often between
commits. Thats why we lookup the .gitmodules sha1 from a commit and then
either lookup an already parsed configuration or parse and cache an
unknown one for each sha1. The cache is lazily build on demand for each
requested commit.

This cache can be used for all purposes which need knowledge about
submodule configurations. Example use cases are:

 * Recursive submodule checkout needs to lookup a submodule name from
   its path when a submodule first appears. This needs be done before
   this configuration exists in the worktree.

 * The implementation of submodule support for 'git archive' needs to
   lookup the submodule name to generate the archive when given a
   revision that is not checked out.

 * 'git fetch' when given the --recurse-submodules=on-demand option (or
   configuration) needs to lookup submodule names by path from the
   database rather than reading from the worktree. For new submodule it
   needs to lookup the name from its path to allow cloning new
   submodules into the .git folder so they can be checked out without
   any network interaction when the user does a checkout of that
   revision.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
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>rm: delete .gitmodules entry of submodules removed from the work tree</title>
<updated>2013-08-06T21:11:00Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2013-08-06T19:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95c16418f0375e2fc325f32c3d7578fba9cfd7ef'/>
<id>urn:sha1:95c16418f0375e2fc325f32c3d7578fba9cfd7ef</id>
<content type='text'>
Currently using "git rm" on a submodule removes the submodule's work tree
from that of the superproject and the gitlink from the index. But the
submodule's section in .gitmodules is left untouched, which is a leftover
of the now removed submodule and might irritate users (as opposed to the
setting in .git/config, this must stay as a reminder that the user showed
interest in this submodule so it will be repopulated later when an older
commit is checked out).

Let "git rm" help the user by not only removing the submodule from the
work tree but by also removing the "submodule.&lt;submodule name&gt;" section
from the .gitmodules file and stage both. This doesn't happen when the
"--cached" option is used, as it would modify the work tree. This also
silently does nothing when no .gitmodules file is found and only issues a
warning when it doesn't have a section for this submodule. This is because
the user might just use plain gitlinks without the .gitmodules file or has
already removed the section by hand before issuing the "git rm" command
(in which case the warning reminds him that rm would have done that for
him). Only when .gitmodules is found and contains merge conflicts the rm
command will fail and tell the user to resolve the conflict before trying
again.

Also extend the man page to inform the user about this new feature. While
at it promote the submodule sub-section to a chapter as it made not much
sense under "REMOVING FILES THAT HAVE DISAPPEARED FROM THE FILESYSTEM".

In t7610 three uses of "git rm submod" had to be replaced with "git rm
--cached submod" because that test expects .gitmodules and the work tree
to stay untouched. Also in t7400 the tests for the remaining settings in
the .gitmodules file had to be changed to assert that these settings are
missing.

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mv: update the path entry in .gitmodules for moved submodules</title>
<updated>2013-08-06T21:10:35Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2013-08-06T19:15:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0656781fadca17cc51fb1c30f265c251ebe12819'/>
<id>urn:sha1:0656781fadca17cc51fb1c30f265c251ebe12819</id>
<content type='text'>
Currently using "git mv" on a submodule moves the submodule's work tree in
that of the superproject. But the submodule's path setting in .gitmodules
is left untouched, which is now inconsistent with the work tree and makes
git commands that rely on the proper path -&gt; name mapping (like status and
diff) behave strangely.

Let "git mv" help here by not only moving the submodule's work tree but
also updating the "submodule.&lt;submodule name&gt;.path" setting from the
.gitmodules file and stage both. This doesn't happen when no .gitmodules
file is found and only issues a warning when it doesn't have a section for
this submodule. This is because the user might just use plain gitlinks
without the .gitmodules file or has already updated the path setting by
hand before issuing the "git mv" command (in which case the warning
reminds him that mv would have done that for him). Only when .gitmodules
is found and contains merge conflicts the mv command will fail and tell
the user to resolve the conflict before trying again.

Also extend the man page to inform the user about this new feature.

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule.c: add .gitmodules staging helper functions</title>
<updated>2013-07-30T21:39:56Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2013-07-30T19:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5fee995244e13fd59500425d49038b00499396f8'/>
<id>urn:sha1:5fee995244e13fd59500425d49038b00499396f8</id>
<content type='text'>
Add the new is_staging_gitmodules_ok() and stage_updated_gitmodules()
functions to submodule.c. The first makes it possible for call sites to
see if the .gitmodules file did contain any unstaged modifications they
would accidentally stage in addition to those they intend to stage
themselves. The second function stages all modifications to the
.gitmodules file, both will be used by subsequent patches for the mv
and rm commands.

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mv: move submodules using a gitfile</title>
<updated>2013-07-30T20:52:53Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2013-07-30T19:50:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a88c915de9886fe17005a5daff4900ced0ea76ad'/>
<id>urn:sha1:a88c915de9886fe17005a5daff4900ced0ea76ad</id>
<content type='text'>
When moving a submodule which uses a gitfile to point to the git directory
stored in .git/modules/&lt;name&gt; of the superproject two changes must be made
to make the submodule work: the .git file and the core.worktree setting
must be adjusted to point from work tree to git directory and back.

Achieve that by remembering which submodule uses a gitfile by storing the
result of read_gitfile() of each submodule. If that is not NULL the new
function connect_work_tree_and_git_dir() is called after renaming the
submodule's work tree which updates the two settings to the new values.

Extend the man page to inform the user about that feature (and while at it
change the description to not talk about a script anymore, as mv is a
builtin for quite some time now).

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: print graph output next to submodule log</title>
<updated>2013-04-05T18:28:10Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2013-04-05T16:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f33a0677d6d93b3f6d8fb7d1df62f30eb7b73a9'/>
<id>urn:sha1:0f33a0677d6d93b3f6d8fb7d1df62f30eb7b73a9</id>
<content type='text'>
When running "git log -p --submodule=log", the submodule log is not
indented by the graph output, although all other lines are.  Fix this by
prepending the current line prefix to each line of the submodule log.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: display summary header in bold</title>
<updated>2012-11-19T03:18:13Z</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>artagnon@gmail.com</email>
</author>
<published>2012-11-13T15:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4e215131d2543a28a065c5161438c315316f9961'/>
<id>urn:sha1:4e215131d2543a28a065c5161438c315316f9961</id>
<content type='text'>
Currently, 'git diff --submodule' displays output with a bold diff
header for non-submodules.  So this part is in bold:

    diff --git a/file1 b/file1
    index 30b2f6c..2638038 100644
    --- a/file1
    +++ b/file1

For submodules, the header looks like this:

    Submodule submodule1 012b072..248d0fd:

Unfortunately, it's easy to miss in the output because it's not bold.
Change this.

Signed-off-by: Ramkumar Ramachandra &lt;artagnon@gmail.com&gt;
Acked-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 'jl/submodule-rm'</title>
<updated>2012-10-29T08:12:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-10-29T08:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d21240fafafdea4fb4cab27c0e9b58ebad7d6172'/>
<id>urn:sha1:d21240fafafdea4fb4cab27c0e9b58ebad7d6172</id>
<content type='text'>
"git rm submodule" cannot blindly remove a submodule directory as
its working tree may have local changes, and worse yet, it may even
have its repository embedded in it.  Teach it some special cases
where it is safe to remove a submodule, specifically, when there is
no local changes in the submodule working tree, and its repository
is not embedded in its working tree but is elsewhere and uses the
gitfile mechanism to point at it.

* jl/submodule-rm:
  submodule: teach rm to remove submodules unless they contain a git directory
</content>
</entry>
</feed>
