<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-submodule.sh, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-10-07T08:52:35Z</updated>
<entry>
<title>submodule: port submodule subcommand 'status' from shell to C</title>
<updated>2017-10-07T08:52:35Z</updated>
<author>
<name>Prathamesh Chavan</name>
<email>pc44800@gmail.com</email>
</author>
<published>2017-10-06T13:24:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9f8a37584a6d3e4702ce115476bebda20d871d3'/>
<id>urn:sha1:a9f8a37584a6d3e4702ce115476bebda20d871d3</id>
<content type='text'>
This aims to make git-submodule 'status' a built-in. Hence, the function
cmd_status() is ported from shell to C. This is done by introducing
four functions: module_status(), submodule_status_cb(),
submodule_status() and print_status().

The function module_status() acts as the front-end of the subcommand.
It parses subcommand's options and then calls the function
module_list_compute() for computing the list of submodules. Then
this functions calls for_each_listed_submodule() looping through the
list obtained.

Then for_each_listed_submodule() calls submodule_status_cb() for each of
the submodule in its list. The function submodule_status_cb() calls
submodule_status() after passing appropriate arguments to the funciton.
Function submodule_status() is responsible for generating the status
each submodule it is called for, and then calls print_status().

Finally, the function print_status() handles the printing of submodule's
status.

Function set_name_rev() is also ported from git-submodule to the
submodule--helper builtin function compute_rev_name(), which now
generates the value of the revision name as required.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Prathamesh Chavan &lt;pc44800@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-parallel-update'</title>
<updated>2017-08-23T21:13:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-23T21:13:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4add209e2c1f31c25297a5610f6720d7504001d5'/>
<id>urn:sha1:4add209e2c1f31c25297a5610f6720d7504001d5</id>
<content type='text'>
Code clean-up.

* sb/submodule-parallel-update:
  submodule.sh: remove unused variable
</content>
</entry>
<entry>
<title>submodule.sh: remove unused variable</title>
<updated>2017-08-17T18:05:49Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-08-16T22:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8d0c4fe9b7987e2d68eb2b639d0f4eb5f89599b'/>
<id>urn:sha1:c8d0c4fe9b7987e2d68eb2b639d0f4eb5f89599b</id>
<content type='text'>
This could have been part of 48308681b0 (git submodule update: have a
dedicated helper for cloning, 2016-02-29).

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>scripts: use "git foo" not "git-foo"</title>
<updated>2017-08-07T19:04:45Z</updated>
<author>
<name>Michael Forney</name>
<email>mforney@mforney.org</email>
</author>
<published>2017-08-05T06:49:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=974ce8078c9a91190d798eaa65c9f173dd50c3f8'/>
<id>urn:sha1:974ce8078c9a91190d798eaa65c9f173dd50c3f8</id>
<content type='text'>
We want to make sure that people who copy &amp; paste code would see
fewer instances of "git-foo".  The use of these dashed forms have
been discouraged since v1.6.0 days.

Signed-off-by: Michael Forney &lt;mforney@mforney.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add: warn when adding an embedded repository</title>
<updated>2017-06-15T16:10:44Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-06-14T10:58:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=532139940c98a98bce2001bb495d75dec3d88e4d'/>
<id>urn:sha1:532139940c98a98bce2001bb495d75dec3d88e4d</id>
<content type='text'>
It's an easy mistake to add a repository inside another
repository, like:

  git clone $url
  git add .

The resulting entry is a gitlink, but there's no matching
.gitmodules entry. Trying to use "submodule init" (or clone
with --recursive) doesn't do anything useful. Prior to
v2.13, such an entry caused git-submodule to barf entirely.
In v2.13, the entry is considered "inactive" and quietly
ignored. Either way, no clone of your repository can do
anything useful with the gitlink without the user manually
adding the submodule config.

In most cases, the user probably meant to either add a real
submodule, or they forgot to put the embedded repository in
their .gitignore file.

Let's issue a warning when we see this case. There are a few
things to note:

  - the warning will go in the git-add porcelain; anybody
    wanting to do low-level manipulation of the index is
    welcome to create whatever funny states they want.

  - we detect the case by looking for a newly added gitlink;
    updates via "git add submodule" are perfectly reasonable,
    and this avoids us having to investigate .gitmodules
    entirely

  - there's a command-line option to suppress the warning.
    This is needed for git-submodule itself (which adds the
    entry before adding any submodule config), but also
    provides a mechanism for other scripts doing
    submodule-like things.

We could make this a hard error instead of a warning.
However, we do add lots of sub-repos in our test suite. It's
not _wrong_ to do so. It just creates a state where users
may be surprised. Pointing them in the right direction with
a gentle hint is probably the best option.

There is a config knob that can disable the (long) hint. But
I intentionally omitted a config knob to disable the warning
entirely. Whether the warning is sensible or not is
generally about context, not about the user's preferences.
If there's a tool or workflow that adds gitlinks without
matching .gitmodules, it should probably be taught about the
new command-line option, rather than blanket-disabling the
warning.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: prevent backslash expantion in submodule names</title>
<updated>2017-04-17T03:09:36Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-04-07T17:23:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf9e55f49438d07dd554c5ade92f1c266363af36'/>
<id>urn:sha1:cf9e55f49438d07dd554c5ade92f1c266363af36</id>
<content type='text'>
When attempting to add a submodule with backslashes in its name 'git
submodule' fails in a funny way.  We can see that some of the
backslashes are expanded resulting in a bogus path:

git -C main submodule add ../sub\\with\\backslash
fatal: repository '/tmp/test/sub\witackslash' does not exist
fatal: clone of '/tmp/test/sub\witackslash' into submodule path

To solve this, convert calls to 'read' to 'read -r' in git-submodule.sh
in order to prevent backslash expantion in submodule names.

Reported-by: Joachim Durchholz &lt;jo@durchholz.org&gt;
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule add: respect submodule.active and submodule.&lt;name&gt;.active</title>
<updated>2017-03-18T16:51:23Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-17T22:38:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b614c07d2428927358cc7317622913d1dbd59c9'/>
<id>urn:sha1:1b614c07d2428927358cc7317622913d1dbd59c9</id>
<content type='text'>
In addition to adding submodule.&lt;name&gt;.url to the config, set
submodule.&lt;name&gt;.active to true unless submodule.active is configured
and the submodule's path matches the configured pathspec.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule sync: use submodule--helper is-active</title>
<updated>2017-03-17T18:06:09Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-16T22:29:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=25b31f1b73331d3d9e90a72c34e514795e98c174'/>
<id>urn:sha1:25b31f1b73331d3d9e90a72c34e514795e98c174</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule sync: skip work for inactive submodules</title>
<updated>2017-03-17T18:06:09Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-16T22:29:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7849a9677e9db6af81f568ae40ad2eddf5d3f0d'/>
<id>urn:sha1:e7849a9677e9db6af81f568ae40ad2eddf5d3f0d</id>
<content type='text'>
Sync does some work determining what URLs should be used for a submodule
but then throws this work away if the submodule isn't active.  Instead
perform the activity check earlier and skip inactive submodule in order
to avoid doing unnecessary work.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule status: use submodule--helper is-active</title>
<updated>2017-03-17T18:06:09Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-16T22:29:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6dc9f01f33bdbaebcf811c89766d4e4902a96f27'/>
<id>urn:sha1:6dc9f01f33bdbaebcf811c89766d4e4902a96f27</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
