<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pull.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-12-16T01:39:42Z</updated>
<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>
<entry>
<title>pull: correct condition to trigger non-ff advice</title>
<updated>2020-12-16T01:39:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-14T17:08:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7539fdc6290750c617c0b638c2f3b2f63c389ed3'/>
<id>urn:sha1:7539fdc6290750c617c0b638c2f3b2f63c389ed3</id>
<content type='text'>
Refactor the advise() call that teaches users how they can choose
between merge and rebase into a helper function.  This revealed that
the caller's logic needs to be further clarified to allow future
actions (like "erroring out" instead of the current "go ahead and
merge anyway") that should happen whether the advice message is
squelched out.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: get rid of unnecessary global variable</title>
<updated>2020-12-16T01:39:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-14T17:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b044db9172f020768e85835f87bfc5564e310714'/>
<id>urn:sha1:b044db9172f020768e85835f87bfc5564e310714</id>
<content type='text'>
It is easy enough to do, and gives a more descriptive name to the
variable that is scoped in a more focused way.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: give the advice for choosing rebase/merge much later</title>
<updated>2020-12-14T17:03:17Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2020-12-12T16:52:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=278f4be806f93579c64cd9993fdad2eb589f86c6'/>
<id>urn:sha1:278f4be806f93579c64cd9993fdad2eb589f86c6</id>
<content type='text'>
Eventually we want to be omit the advice when we can fast-forward
in which case there is no reason to require the user to choose
between rebase or merge.

In order to do so, we need to delay giving the advice up to the
point where we can check if we can fast-forward or not.

Additionally, config_get_rebase() was probably never its true home.

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: refactor fast-forward check</title>
<updated>2020-12-14T16:59:40Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2020-12-12T16:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77a7ec632952ee335cb544fee7c6b3fb1c5ec147'/>
<id>urn:sha1:77a7ec632952ee335cb544fee7c6b3fb1c5ec147</id>
<content type='text'>
We would like to be able to make this check before the decision to
rebase is made in a future step.  Besides, using a separate helper
makes the code easier to follow.

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>Merge branch 'pb/pull-rebase-recurse-submodules'</title>
<updated>2020-12-03T08:18:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-03T08:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c692e1b6731da33ebfc2dfd72476057cd16aceb9'/>
<id>urn:sha1:c692e1b6731da33ebfc2dfd72476057cd16aceb9</id>
<content type='text'>
"git pull --rebase --recurse-submodules" checked for local changes
in a wrong range and failed to run correctly when it should.

* pb/pull-rebase-recurse-submodules:
  pull: check for local submodule modifications with the right range
  t5572: describe '--rebase' tests a little more
  t5572: add notes on a peculiar test
  pull --rebase: compute rebase arguments in separate function
</content>
</entry>
<entry>
<title>Merge branch 'js/pull-rebase-use-advise'</title>
<updated>2020-11-30T22:49:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-30T22:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=290c94085bc913951d15c47bce818a19541a1e72'/>
<id>urn:sha1:290c94085bc913951d15c47bce818a19541a1e72</id>
<content type='text'>
UI improvement.

* js/pull-rebase-use-advise:
  pull: colorize the hint about setting `pull.rebase`
</content>
</entry>
<entry>
<title>pull: colorize the hint about setting `pull.rebase`</title>
<updated>2020-11-19T22:13:30Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-19T10:22:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e01ae2a4a7e99357b9464b54e48cbf4b4caac036'/>
<id>urn:sha1:e01ae2a4a7e99357b9464b54e48cbf4b4caac036</id>
<content type='text'>
In d18c950a69f (pull: warn if the user didn't say whether to rebase or
to merge, 2020-03-09), a new hint was introduced to encourage users to
make a conscious decision about whether they want their pull to merge or
to rebase by configuring the `pull.rebase` setting.

This warning was clearly intended to advise users, but as pointed out in
https://lore.kernel.org/git/87ima2rdsm.fsf%40evledraar.gmail.com, it
uses `warning()` instead of `advise()`.

One consequence is that the advice is not colorized in the same manner
as other, similar messages. So let's use `advise()` instead.

Pointed-out-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
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>pull: check for local submodule modifications with the right range</title>
<updated>2020-11-17T00:01:13Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2020-11-14T00:34:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5176f20ffeab9c2bda6f93195096372364ec6f88'/>
<id>urn:sha1:5176f20ffeab9c2bda6f93195096372364ec6f88</id>
<content type='text'>
Ever since 'git pull' learned '--recurse-submodules' in a6d7eb2c7a
(pull: optionally rebase submodules (remote submodule changes only),
2017-06-23), we check if there are local submodule modifications by
checking the revision range 'curr_head --not rebase_fork_point'.

The goal of this check is to abort the pull if there are submodule
modifications in the local commits being rebased, since this scenario is
not supported.

However, the actual range of commits being rebased is not
'rebase_fork_point..curr_head', as the logic in
'get_rebase_newbase_and_upstream' reveals, it is 'upstream..curr_head'.

If the 'git merge-base --fork-point' invocation in
'get_rebase_fork_point' fails to find a fork point between the current
branch and the remote-tracking branch we are pulling from,
'rebase_fork_point' is null and since 4d36f88be7 (submodule: do not pass
null OID to setup_revisions, 2018-05-24), 'submodule_touches_in_range'
checks 'curr_head' and all its ancestors for submodule modifications.

Since it is highly likely that there are submodule modifications in this
range (which is in effect the whole history of the current branch), this
prevents 'git pull --rebase --recurse-submodules' from succeeding if no
fork point exists between the current branch and the remote-tracking
branch being pulled. This can happen, for example, when the current
branch was forked from a commit which was never recorded in the reflog
of the remote-tracking branch we are pulling, as the last two paragraphs
of the "Discussion on fork-point mode" section in git-merge-base(1)
explain.

Fix this bug by passing 'upstream' instead of 'rebase_fork_point' as the
'excl_oid' argument to 'submodule_touches_in_range'.

Reported-by: Brice Goglin &lt;bgoglin@free.fr&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>pull --rebase: compute rebase arguments in separate function</title>
<updated>2020-11-17T00:01:13Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2020-11-14T00:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f66d79ae301a74cead51e703d566ec5f395beb8'/>
<id>urn:sha1:4f66d79ae301a74cead51e703d566ec5f395beb8</id>
<content type='text'>
The function 'run_rebase' is responsible for constructing the
command line to be passed to 'git rebase'. This includes both forwarding
pass-through options given to 'git pull' as well computing the &lt;newbase&gt;
and &lt;upstream&gt; arguments to 'git rebase'.

A following commit will need to access the &lt;upstream&gt; argument in
'cmd_pull' to fix a bug with 'git pull --rebase --recurse-submodules'.
In order to do so, refactor the code so that the &lt;newbase&gt; and
&lt;upstream&gt; commits are computed in a new, separate function,
'get_rebase_newbase_and_upstream'.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
