<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pull.c, branch v2.33.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.33.6</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.33.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-07-22T18:54:30Z</updated>
<entry>
<title>pull: fix handling of multiple heads</title>
<updated>2021-07-22T18:54:30Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-22T05:04:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f843a3355ee590dfe09eb90679051e75fadf675'/>
<id>urn:sha1:6f843a3355ee590dfe09eb90679051e75fadf675</id>
<content type='text'>
With multiple heads, we should not allow rebasing or fast-forwarding.
Make sure any fast-forward request calls out specifically the fact that
multiple branches are in play.  Also, since we cannot fast-forward to
multiple branches, fix our computation of can_ff.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: update docs &amp; code for option compatibility with rebasing</title>
<updated>2021-07-22T18:54:30Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-22T05:04:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=359ff6938990a438b99e95fe36b6b359f3eb9811'/>
<id>urn:sha1:359ff6938990a438b99e95fe36b6b359f3eb9811</id>
<content type='text'>
git-pull.txt includes merge-options.txt, which is written assuming
merges will happen.  git-pull has allowed rebases for many years; update
the documentation to reflect that.

While at it, pass any `--signoff` flag through to the rebase backend too
so that we don't have to document it as merge-specific.  Rebase has
supported the --signoff flag for years now as well.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: abort by default when fast-forwarding is not possible</title>
<updated>2021-07-22T18:54:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-22T05:04:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=031e2f7ae195069d00d21cde906fce5b0318dbdd'/>
<id>urn:sha1:031e2f7ae195069d00d21cde906fce5b0318dbdd</id>
<content type='text'>
We have for some time shown a long warning when the user does not
specify how to reconcile divergent branches with git pull.  Make it an
error now.

Initial-patch-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: make --rebase and --no-rebase override pull.ff=only</title>
<updated>2021-07-22T18:54:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-22T05:04:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=adc27d6a9374d012b091bc348c20f5bfdbee52d1'/>
<id>urn:sha1:adc27d6a9374d012b091bc348c20f5bfdbee52d1</id>
<content type='text'>
Fix the last few precedence tests failing in t7601 by now implementing
the logic to have --[no-]rebase override a pull.ff=only config setting.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: since --ff-only overrides, handle it first</title>
<updated>2021-07-22T18:54:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-07-22T05:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4dc25ed49d94c93b1d3f63efe17f32ca682cab7'/>
<id>urn:sha1:e4dc25ed49d94c93b1d3f63efe17f32ca682cab7</id>
<content type='text'>
There are both merge and rebase branches in the logic, and previously
both had to handle fast-forwarding.  Merge handled that implicitly
(because git merge handles it directly), while in rebase it was
explicit.  Given that the --ff-only flag is meant to override any
--rebase or --no-rebase, make the code reflect that by handling
--ff-only before the merge-vs-rebase logic.

It turns out that this also fixes a bug for submodules.  Previously,
when --ff-only was given, the code would run `merge --ff-only` on the
main module, and then run `submodule update --recursive --rebase` on the
submodules.  With this change, we still run `merge --ff-only` on the
main module, but now run `submodule update --recursive --checkout` on
the submodules.  I believe this better reflects the intent of --ff-only
to have it apply to both the main module and the submodules.

(Sidenote: It is somewhat interesting that all merges pass `--checkout`
to submodule update, even when `--no-ff` is specified, meaning that it
will only do fast-forward merges for submodules.  This was discussed in
commit a6d7eb2c7a ("pull: optionally rebase submodules (remote submodule
changes only)", 2017-06-23).  The same limitations apply now as then, so
we are not trying to fix this at this time.)

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: abort if --ff-only is given and fast-forwarding is impossible</title>
<updated>2021-07-21T04:43:12Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2021-07-21T01:42:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d5fc24daefbdf56bc36a491aed0b7990fa0c62f'/>
<id>urn:sha1:3d5fc24daefbdf56bc36a491aed0b7990fa0c62f</id>
<content type='text'>
The warning about pulling without specifying how to reconcile divergent
branches says that after setting pull.rebase to true, --ff-only can
still be passed on the command line to require a fast-forward. Make that
actually work.

Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
[en: updated tests; note 3 fixes and 1 new failure]
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: trivial whitespace style fix</title>
<updated>2021-06-19T07:36:17Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-06-17T16:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a7d18a11098b5f9cc8b1511ecaef5378c1030f97'/>
<id>urn:sha1:a7d18a11098b5f9cc8b1511ecaef5378c1030f97</id>
<content type='text'>
Two spaces unaligned to anything is not part of the coding-style. A
single tab is.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: trivial cleanup</title>
<updated>2021-06-19T07:36:17Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-06-17T16:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a751e0296f6771e4dec6258d8c3f9bf658da30de'/>
<id>urn:sha1:a751e0296f6771e4dec6258d8c3f9bf658da30de</id>
<content type='text'>
There's no need to store ran_ff. Now it's obvious from the conditionals.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: cleanup autostash check</title>
<updated>2021-06-19T07:36:16Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-06-17T16:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=340062243a474b8fa56f4c3f6572bf015392f7f9'/>
<id>urn:sha1:340062243a474b8fa56f4c3f6572bf015392f7f9</id>
<content type='text'>
Currently "git pull --rebase" takes a shortcut in the case a
fast-forward merge is possible; run_merge() is called with --ff-only.

However, "git merge" didn't have an --autostash option, so, when "git
pull --rebase --autostash" was called *and* the fast-forward merge
shortcut was taken, then the pull failed.

This was fixed in commit f15e7cf5cc (pull: ff --rebase --autostash
works in dirty repo, 2017-06-01) by simply skipping the fast-forward
merge shortcut.

Later on "git merge" learned the --autostash option [a03b55530a
(merge: teach --autostash option, 2020-04-07)], and so did "git pull"
[d9f15d37f1 (pull: pass --autostash to merge, 2020-04-07)].

Therefore it's not necessary to skip the fast-forward merge shortcut
anymore when called with --rebase --autostash.

Let's always take the fast-forward merge shortcut by essentially
reverting f15e7cf5cc.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: display default warning only when non-ff</title>
<updated>2020-12-16T01:39:42Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2020-12-12T16:52:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c525de335e4a3919d49a9126b76d1288f35737be'/>
<id>urn:sha1:c525de335e4a3919d49a9126b76d1288f35737be</id>
<content type='text'>
There's no need to display the annoying warning on every pull... only
the ones that are not fast-forward.

The current warning tests still pass, but not because of the arguments
or the configuration, but because they are all fast-forward.

We need to test non-fast-forward situations now.

Suggestions-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
