<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pull.c, branch v2.37.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.37.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.37.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-20T22:26:57Z</updated>
<entry>
<title>Merge branch 'gc/pull-recurse-submodules'</title>
<updated>2022-05-20T22:26:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed54e1b31ad1a9a35ef6c23024d325a2c4d85221'/>
<id>urn:sha1:ed54e1b31ad1a9a35ef6c23024d325a2c4d85221</id>
<content type='text'>
"git pull" without "--recurse-submodules=&lt;arg&gt;" made
submodule.recurse take precedence over fetch.recurseSubmodules by
mistake, which has been corrected.

* gc/pull-recurse-submodules:
  pull: do not let submodule.recurse override fetch.recurseSubmodules
</content>
</entry>
<entry>
<title>pull: do not let submodule.recurse override fetch.recurseSubmodules</title>
<updated>2022-05-11T22:42:30Z</updated>
<author>
<name>Glen Choo</name>
<email>chooglen@google.com</email>
</author>
<published>2022-05-10T19:25:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=58194173652786709ba9dd1f56df6922a92f419f'/>
<id>urn:sha1:58194173652786709ba9dd1f56df6922a92f419f</id>
<content type='text'>
Fix a bug in "git pull" where `submodule.recurse` is preferred over
`fetch.recurseSubmodules` when performing a fetch
(Documentation/config/fetch.txt says that `fetch.recurseSubmodules`
should be preferred.). Do this by passing the value of the
"--recurse-submodules" CLI option to the underlying fetch, instead of
passing a value that combines the CLI option and config variables.

In other words, this bug occurred because builtin/pull.c is conflating
two similar-sounding, but different concepts:

- Whether "git pull" itself should care about submodules e.g. whether it
  should update the submodule worktrees after performing a merge.
- The value of "--recurse-submodules" to pass to the underlying "git
  fetch".

Thus, when `submodule.recurse` is set, the underlying "git fetch" gets
invoked with "--recurse-submodules[=value]", overriding the value of
`fetch.recurseSubmodules`.

An alternative (and more obvious) approach to fix the bug would be to
teach "git pull" to understand `fetch.recurseSubmodules`, but the
proposed solution works better because:

- We don't maintain two identical config-parsing implementions in "git
  pull" and "git fetch".
- It works better with other commands invoked by "git pull" e.g. "git
  merge" won't accidentally respect `fetch.recurseSubmodules`.

Reported-by: Huang Zou &lt;huang.zou@schrodinger.com&gt;
Helped-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Glen Choo &lt;chooglen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ja/i18n-common-messages'</title>
<updated>2022-02-25T23:47:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-25T23:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d21d5ddfe675f9dbcdbb94ab01776115a2d1fdde'/>
<id>urn:sha1:d21d5ddfe675f9dbcdbb94ab01776115a2d1fdde</id>
<content type='text'>
Unify more messages to help l10n.

* ja/i18n-common-messages:
  i18n: fix some misformated placeholders in command synopsis
  i18n: remove from i18n strings that do not hold translatable parts
  i18n: factorize "invalid value" messages
  i18n: factorize more 'incompatible options' messages
</content>
</entry>
<entry>
<title>Merge branch 'js/short-help-outside-repo-fix'</title>
<updated>2022-02-18T21:53:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-18T21:53:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5973cb98ff4fe0779e90e04de7c099cc2256a3a'/>
<id>urn:sha1:c5973cb98ff4fe0779e90e04de7c099cc2256a3a</id>
<content type='text'>
"git cmd -h" outside a repository should error out cleanly for many
commands, but instead it hit a BUG(), which has been corrected.

* js/short-help-outside-repo-fix:
  t0012: verify that built-ins handle `-h` even without gitdir
  checkout/fetch/pull/pack-objects: allow `-h` outside a repository
</content>
</entry>
<entry>
<title>checkout/fetch/pull/pack-objects: allow `-h` outside a repository</title>
<updated>2022-02-08T17:54:44Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-02-08T11:21:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=059fda190215d18e7aa23f825cd607b16a016b65'/>
<id>urn:sha1:059fda190215d18e7aa23f825cd607b16a016b65</id>
<content type='text'>
When we taught these commands about the sparse index, we did not account
for the fact that the `cmd_*()` functions _can_ be called without a
gitdir, namely when `-h` is passed to show the usage.

A plausible approach to address this is to move the
`prepare_repo_settings()` calls right after the `parse_options()` calls:
The latter will never return when it handles `-h`, and therefore it is
safe to assume that we have a `gitdir` at that point, as long as the
built-in is marked with the `RUN_SETUP` flag.

However, it is unfortunately not that simple. In `cmd_pack_objects()`,
for example, the repo settings need to be fully populated so that the
command-line options `--sparse`/`--no-sparse` can override them, not the
other way round.

Therefore, we choose to imitate the strategy taken in `cmd_diff()`,
where we simply do not bother to prepare and initialize the repo
settings unless we have a `gitdir`.

This fixes https://github.com/git-for-windows/git/issues/3688

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pb/pull-rebase-autostash-fix'</title>
<updated>2022-02-05T17:42:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-02-05T17:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a9ae6d0d9cf979a2b1a018135370dd6331e505c'/>
<id>urn:sha1:7a9ae6d0d9cf979a2b1a018135370dd6331e505c</id>
<content type='text'>
"git pull --rebase" ignored the rebase.autostash configuration
variable when the remote history is a descendant of our history,
which has been corrected.

* pb/pull-rebase-autostash-fix:
  pull --rebase: honor rebase.autostash when fast-forwarding
</content>
</entry>
<entry>
<title>i18n: factorize "invalid value" messages</title>
<updated>2022-02-04T21:58:28Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2022-01-31T22:07:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a8aea857e4225a9d35a531869fd47777f3063d6'/>
<id>urn:sha1:1a8aea857e4225a9d35a531869fd47777f3063d6</id>
<content type='text'>
Use the same message when an invalid value is passed to a command line
option or a configuration variable.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull --rebase: honor rebase.autostash when fast-forwarding</title>
<updated>2022-01-14T19:59:02Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2022-01-14T03:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3013d98d7a09b42a111a355db286e72ee03b2e94'/>
<id>urn:sha1:3013d98d7a09b42a111a355db286e72ee03b2e94</id>
<content type='text'>
"pull --rebase" internally uses the merge machinery when the other
history is a descendant of ours (i.e. perform fast-forward).  This
came from [1], where the discussion was started from a feature
request to do so.  It is a bit hard to read the rationale behind it
in the discussion, but it seems that it was an established fact for
everybody involved that does not even need to be mentioned that
fast-forwarding done with "rebase" was much undesirable than done
with "merge", and more importantly, the result left by "merge" is as
good as (or better than) that by "rebase".

Except for one thing.  Because "git merge" does not (and should not)
honor rebase.autostash, "git pull" needs to read it and forward it
when we use "git merge" as a (hopefully better) substitute for "git
rebase" during the fast-forwarding.  But we forgot to do so (we only
add "--[no-]autostash" to the "git merge" command when "git pull" itself
was invoked with "--[no-]autostash" command line option.

Make sure "git merge" is run with "--autostash" when
rebase.autostash is set and used to fast-forward the history on
behalf of "git rebase".  Incidentally this change also takes care of
the case where

 - "git pull --rebase" (without other command line options) is run
 - "rebase.autostash" is not set
 - The history fast-forwards

In such a case, "git merge" is run with an explicit "--no-autostash"
to prevent it from honoring merge.autostash configuration, which is
what we want.  After all, we want the "git merge" to pretend as if
it is "git rebase" while being used for this purpose.

[1] https://lore.kernel.org/git/xmqqa8cfbkeq.fsf_-_@gitster.mtv.corp.google.com/

Reported-by: Tilman Vogel &lt;tilman.vogel@web.de&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch/pull: use the sparse index</title>
<updated>2021-12-22T19:42:39Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2021-12-22T14:20:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a4e0547e2386f9bf0565316d7b751fe9459898b'/>
<id>urn:sha1:5a4e0547e2386f9bf0565316d7b751fe9459898b</id>
<content type='text'>
The 'git fetch' and 'git pull' commands parse the index in order to
determine if submodules exist. Without command_requires_full_index=0,
this will expand a sparse index, causing slow performance even when
there is no new data to fetch.

The .gitmodules file will never be inside a sparse directory entry, and
even if it was, the index_name_pos() method would expand the sparse
index if needed as we search for the path by name. These commands do not
iterate over the index, which is the typical thing we are careful about
when integrating with the sparse index.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ah/advice-pull-has-no-preference-between-rebase-and-merge'</title>
<updated>2021-12-10T22:35:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-10T22:35:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e715503f1c57c43808ac63881e69cb51b08c145'/>
<id>urn:sha1:8e715503f1c57c43808ac63881e69cb51b08c145</id>
<content type='text'>
The advice message given by "git pull" when the user hasn't made a
choice between merge and rebase still said that the merge is the
default, which no longer is the case.  This has been corrected.

* ah/advice-pull-has-no-preference-between-rebase-and-merge:
  pull: don't say that merge is "the default strategy"
</content>
</entry>
</feed>
