<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-submodule.sh, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-22T05:25:26Z</updated>
<entry>
<title>Sync with Git 2.16.4</title>
<updated>2018-05-22T05:25:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-22T05:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=68f95b26e43f8183b9d1cdd41f42e99da43152bf'/>
<id>urn:sha1:68f95b26e43f8183b9d1cdd41f42e99da43152bf</id>
<content type='text'>
* maint-2.16:
  Git 2.16.4
  Git 2.15.2
  Git 2.14.4
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
</content>
</entry>
<entry>
<title>Sync with Git 2.15.2</title>
<updated>2018-05-22T05:18:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-22T05:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=023020401d21c8c48d7f0a123c7ff50888e101c7'/>
<id>urn:sha1:023020401d21c8c48d7f0a123c7ff50888e101c7</id>
<content type='text'>
* maint-2.15:
  Git 2.15.2
  Git 2.14.4
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
</content>
</entry>
<entry>
<title>Sync with Git 2.13.7</title>
<updated>2018-05-22T05:10:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-22T05:10:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b01c71b64d25202d80b73cbd46104ebfddbdab3'/>
<id>urn:sha1:7b01c71b64d25202d80b73cbd46104ebfddbdab3</id>
<content type='text'>
* maint-2.13:
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
</content>
</entry>
<entry>
<title>submodule-config: verify submodule names as paths</title>
<updated>2018-05-22T03:50:11Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-04-30T07:25:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0383bbb9015898cbc79abd7b64316484d7713b44'/>
<id>urn:sha1:0383bbb9015898cbc79abd7b64316484d7713b44</id>
<content type='text'>
Submodule "names" come from the untrusted .gitmodules file,
but we blindly append them to $GIT_DIR/modules to create our
on-disk repo paths. This means you can do bad things by
putting "../" into the name (among other things).

Let's sanity-check these names to avoid building a path that
can be exploited. There are two main decisions:

  1. What should the allowed syntax be?

     It's tempting to reuse verify_path(), since submodule
     names typically come from in-repo paths. But there are
     two reasons not to:

       a. It's technically more strict than what we need, as
          we really care only about breaking out of the
          $GIT_DIR/modules/ hierarchy.  E.g., having a
          submodule named "foo/.git" isn't actually
          dangerous, and it's possible that somebody has
          manually given such a funny name.

       b. Since we'll eventually use this checking logic in
          fsck to prevent downstream repositories, it should
          be consistent across platforms. Because
          verify_path() relies on is_dir_sep(), it wouldn't
          block "foo\..\bar" on a non-Windows machine.

  2. Where should we enforce it? These days most of the
     .gitmodules reads go through submodule-config.c, so
     I've put it there in the reading step. That should
     cover all of the C code.

     We also construct the name for "git submodule add"
     inside the git-submodule.sh script. This is probably
     not a big deal for security since the name is coming
     from the user anyway, but it would be polite to remind
     them if the name they pick is invalid (and we need to
     expose the name-checker to the shell anyway for our
     test scripts).

     This patch issues a warning when reading .gitmodules
     and just ignores the related config entry completely.
     This will generally end up producing a sensible error,
     as it works the same as a .gitmodules file which is
     missing a submodule entry (so "submodule update" will
     barf, but "git clone --recurse-submodules" will print
     an error but not abort the clone.

     There is one minor oddity, which is that we print the
     warning once per malformed config key (since that's how
     the config subsystem gives us the entries). So in the
     new test, for example, the user would see three
     warnings. That's OK, since the intent is that this case
     should never come up outside of malicious repositories
     (and then it might even benefit the user to see the
     message multiple times).

Credit for finding this vulnerability and the proof of
concept from which the test script was adapted goes to
Etienne Stalmans.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>submodule: port submodule subcommand 'deinit' from shell to C</title>
<updated>2018-01-16T19:29:50Z</updated>
<author>
<name>Prathamesh Chavan</name>
<email>pc44800@gmail.com</email>
</author>
<published>2018-01-14T21:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e612731b55f1a83fb5b7f4ecb9391f0cba63cb2'/>
<id>urn:sha1:2e612731b55f1a83fb5b7f4ecb9391f0cba63cb2</id>
<content type='text'>
The same mechanism is used even for porting this submodule
subcommand, as used in the ported subcommands till now.
The function cmd_deinit in split up after porting into four
functions: module_deinit(), for_each_listed_submodule(),
deinit_submodule() and deinit_submodule_cb().

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>submodule: port submodule subcommand 'sync' from shell to C</title>
<updated>2018-01-16T19:29:48Z</updated>
<author>
<name>Prathamesh Chavan</name>
<email>pc44800@gmail.com</email>
</author>
<published>2018-01-14T21:15:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=13424764db3273091d136bd470cf14852255c98c'/>
<id>urn:sha1:13424764db3273091d136bd470cf14852255c98c</id>
<content type='text'>
Port the submodule subcommand 'sync' from shell to C using the same
mechanism as that used for porting submodule subcommand 'status'.
Hence, here the function cmd_sync() is ported from shell to C.
This is done by introducing four functions: module_sync(),
sync_submodule(), sync_submodule_cb() and print_default_remote().

The function print_default_remote() is introduced for getting
the default remote as stdout.

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>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' into maint</title>
<updated>2017-09-10T08:03:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-10T08:03:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95d25c412d140698ac0084bd94dcde8ecdcd332d'/>
<id>urn:sha1:95d25c412d140698ac0084bd94dcde8ecdcd332d</id>
<content type='text'>
Code clean-up.

* sb/submodule-parallel-update:
  submodule.sh: remove unused variable
</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>
</feed>
