<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-submodule.sh, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-10-05T21:01:53Z</updated>
<entry>
<title>Merge branch 'td/submodule-update-quiet'</title>
<updated>2020-10-05T21:01:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-05T21:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=300cd14ee92eaa0e56688078e967402371488013'/>
<id>urn:sha1:300cd14ee92eaa0e56688078e967402371488013</id>
<content type='text'>
"git submodule update --quiet" did not squelch underlying "rebase"
and "pull" commands.

* td/submodule-update-quiet:
  submodule update: silence underlying merge/rebase with "--quiet"
</content>
</entry>
<entry>
<title>submodule update: silence underlying merge/rebase with "--quiet"</title>
<updated>2020-10-01T15:50:24Z</updated>
<author>
<name>Theodore Dubois</name>
<email>tbodt@google.com</email>
</author>
<published>2020-09-30T19:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ad0401e9e6d3e243a21a3f376e36453572dcf0d'/>
<id>urn:sha1:3ad0401e9e6d3e243a21a3f376e36453572dcf0d</id>
<content type='text'>
Commands such as

    $ git pull --rebase --recurse-submodules --quiet

produce non-quiet output from the merge or rebase.  Pass the --quiet
option down when invoking "rebase" and "merge".

Also fix the parsing of git submodule update -v.

When e84c3cf3 (git-submodule.sh: accept verbose flag in cmd_update
to be non-quiet, 2018-08-14) taught "git submodule update" to take
"--quiet", it apparently did not know how ${GIT_QUIET:+--quiet}
works, and reviewers seem to have missed that setting the variable
to "0", rather than unsetting it, still results in "--quiet" being
passed to underlying commands.

Signed-off-by: Theodore Dubois &lt;tbodt@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: port submodule subcommand 'summary' from shell to C</title>
<updated>2020-08-12T21:12:58Z</updated>
<author>
<name>Prathamesh Chavan</name>
<email>pc44800@gmail.com</email>
</author>
<published>2020-08-12T19:44:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e83e3333b5770815e9c2e3aee48c305257385bbb'/>
<id>urn:sha1:e83e3333b5770815e9c2e3aee48c305257385bbb</id>
<content type='text'>
Convert submodule subcommand 'summary' to a builtin and call it via
'git-submodule.sh'.

The shell version had to call $diff_cmd twice, once to find the modified
modules cared by the user and then again, with that list of modules
to do various operations for computing the summary of those modules.
On the other hand, the C version does not need a second call to
$diff_cmd since it reuses the module list from the first call to do the
aforementioned tasks.

In the C version, we use the combination of setting a child process'
working directory to the submodule path and then calling
'prepare_submodule_repo_env()' which also sets the 'GIT_DIR' to '.git',
so that we can be certain that those spawned processes will not access
the superproject's ODB by mistake.

A behavioural difference between the C and the shell version is that the
shell version outputs two line feeds after the 'git log' output when run
outside of the tests while the C version outputs one line feed in any
case. The reason for this is that the shell version calls log with
'--pretty=format:&lt;fmt&gt;' whose output is followed by two echo
calls; 'format' does not have "terminator" semantics like its 'tformat'
counterpart. So, the log output is terminated by a newline only when
invoked by the user and not when invoked from the scripts. This results
in the one &amp; two line feed differences in the shell version.
On the other hand, the C version calls log with '--pretty=&lt;fmt&gt;'
which is equivalent to '--pretty:tformat:&lt;fmt&gt;' which is then
followed by a 'printf("\n")'. Due to its "terminator" semantics the
log output is always terminated by newline and hence one line feed in
any case.

Also, when we try to pass an option-like argument after a non-option
argument, for instance:

    git submodule summary HEAD --foo-bar

    (or)

    git submodule summary HEAD --cached

That argument would be treated like a path to the submodule for which
the user is requesting a summary. So, the option ends up having no
effect. Though, passing '--quiet' is an exception to this:

    git submodule summary HEAD --quiet

While 'summary' doesn't support '--quiet', we don't get an output for
the above command as '--quiet' is treated as a path which means we get
an output only if a submodule whose path is '--quiet' exists.

The error message in case of computing a summary for non-existent
submodules in the C version is different from that of the shell version.
Since the new error message is not marked for translation, change the
'test_i18ngrep' in t7421.4 to 'grep'.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Stefan Beller &lt;stefanbeller@gmail.com&gt;
Mentored-by: Kaartic Sivaraam &lt;kaartic.sivaraam@gmail.com&gt;
Helped-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Prathamesh Chavan &lt;pc44800@gmail.com&gt;
Signed-off-by: Shourya Shukla &lt;shouryashukla.oo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: port subcommand 'set-branch' from shell to C</title>
<updated>2020-06-02T17:51:54Z</updated>
<author>
<name>Shourya Shukla</name>
<email>shouryashukla.oo@gmail.com</email>
</author>
<published>2020-06-02T16:35:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2964d6e5e1e5e3286cfdc8c68f347e0aba97caf0'/>
<id>urn:sha1:2964d6e5e1e5e3286cfdc8c68f347e0aba97caf0</id>
<content type='text'>
Convert submodule subcommand 'set-branch' to a builtin and call it via
'git-submodule.sh'.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Kaartic Sivaraam &lt;kaartic.sivaraam@gmail.com&gt;
Helped-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Helped-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Shourya Shukla &lt;shouryashukla.oo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: port subcommand 'set-url' from shell to C</title>
<updated>2020-05-08T16:17:55Z</updated>
<author>
<name>Shourya Shukla</name>
<email>shouryashukla.oo@gmail.com</email>
</author>
<published>2020-05-08T06:21:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6417cf9c21e9b3f450cd78352d19f43a4dd5a495'/>
<id>urn:sha1:6417cf9c21e9b3f450cd78352d19f43a4dd5a495</id>
<content type='text'>
Convert submodule subcommand 'set-url' to a builtin. Port 'set-url' to
'submodule--helper.c' and call the latter via 'git-submodule.sh'.

Signed-off-by: Shourya Shukla &lt;shouryashukla.oo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lx/submodule-clear-variables'</title>
<updated>2020-04-28T22:49:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-04-28T22:49:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27dd34b95e44b717e14e879a9b46ecdd5232632b'/>
<id>urn:sha1:27dd34b95e44b717e14e879a9b46ecdd5232632b</id>
<content type='text'>
The "git submodule" command did not initialize a few variables it
internally uses and was affected by variable settings leaked from
the environment.

* lx/submodule-clear-variables:
  git-submodule.sh: setup uninitialized variables
</content>
</entry>
<entry>
<title>git-submodule.sh: setup uninitialized variables</title>
<updated>2020-04-02T18:19:33Z</updated>
<author>
<name>Li Xuejiang</name>
<email>xuejiang@alibaba-inc.com</email>
</author>
<published>2020-04-02T08:42:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65d100c4ddbe83953870be2e08566086e4b1cd3c'/>
<id>urn:sha1:65d100c4ddbe83953870be2e08566086e4b1cd3c</id>
<content type='text'>
We have an environment variable `jobs=16` defined in our CI system, and
this environment makes our build job failed with the following message:

    error: pathspec '16' did not match any file(s) known to git

The pathspec '16' for Git command is from the environment variable
"jobs".

This is because "git-submodule" command is implemented in shell script,
and environment variables may change its behavior.  Set values for
uninitialized variables, such as "jobs" and "recommend_shallow" will
fix this issue.

Helped-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Li Xuejiang &lt;xuejiang@alibaba-inc.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'es/recursive-single-branch-clone'</title>
<updated>2020-03-05T18:43:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-05T18:43:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b22db265d6bde72391c8d47700dc781a3ea2ae41'/>
<id>urn:sha1:b22db265d6bde72391c8d47700dc781a3ea2ae41</id>
<content type='text'>
"git clone --recurse-submodules --single-branch" now uses the same
single-branch option when cloning the submodules.

* es/recursive-single-branch-clone:
  clone: pass --single-branch during --recurse-submodules
  submodule--helper: use C99 named initializer
</content>
</entry>
<entry>
<title>clone: pass --single-branch during --recurse-submodules</title>
<updated>2020-02-25T18:00:38Z</updated>
<author>
<name>Emily Shaffer</name>
<email>emilyshaffer@google.com</email>
</author>
<published>2020-02-21T03:10:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=132f600b060c2db7fd3d450dfadb6779a61c648a'/>
<id>urn:sha1:132f600b060c2db7fd3d450dfadb6779a61c648a</id>
<content type='text'>
Previously, performing "git clone --recurse-submodules --single-branch"
resulted in submodules cloning all branches even though the superproject
cloned only one branch. Pipe --single-branch through the submodule
helper framework to make it to 'clone' later on.

Signed-off-by: Emily Shaffer &lt;emilyshaffer@google.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>submodule add: show 'add --dry-run' stderr when aborting</title>
<updated>2020-01-15T18:22:24Z</updated>
<author>
<name>Kyle Meyer</name>
<email>kyle@kyleam.com</email>
</author>
<published>2020-01-08T00:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c81638541cbbf5868e79037ca29b6e37e47461e5'/>
<id>urn:sha1:c81638541cbbf5868e79037ca29b6e37e47461e5</id>
<content type='text'>
Unless --force is specified, 'submodule add' checks if the destination
path is ignored by calling 'git add --dry-run --ignore-missing', and,
if that call fails, aborts with a custom "path is ignored" message (a
slight variant of what 'git add' shows).  Aborting early rather than
letting the downstream 'git add' call fail is done so that the command
exits before cloning into the destination path.  However, in rare
cases where the dry-run call fails for a reason other than the path
being ignored---for example, due to a preexisting index.lock
file---displaying the "ignored path" error message hides the real
source of the failure.

Instead of displaying the tailored "ignored path" message, let's
report the standard error from the dry run to give the caller more
accurate information about failures that are not due to an ignored
path.

For the ignored path case, this leads to the following change in the
error message:

  The following [-path is-]{+paths are+} ignored by one of your .gitignore files:
  &lt;destination path&gt;
  Use -f if you really want to add [-it.-]{+them.+}

The new phrasing is a bit awkward, because 'submodule add' is only
dealing with one destination path.  Alternatively, we could continue
to use the tailored message when the exit code is 1 (the expected
status for a failure due to an ignored path) and relay the standard
error for all other non-zero exits.  That, however, risks hiding the
message of unrelated failures that share an exit code of 1, so it
doesn't seem worth doing just to avoid a clunkier, but still clear,
error message.

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