<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-pull.txt, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-07-13T23:14:54Z</updated>
<entry>
<title>Merge branch 'sb/pull-rebase-submodule'</title>
<updated>2017-07-13T23:14:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-07-13T23:14:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9c63ee558ce3399bd2016388da9676d4f5ecf55'/>
<id>urn:sha1:c9c63ee558ce3399bd2016388da9676d4f5ecf55</id>
<content type='text'>
"git pull --rebase --recurse-submodules" learns to rebase the
branch in the submodules to an updated base.

* sb/pull-rebase-submodule:
  builtin/fetch cleanup: always set default value for submodule recursing
  pull: optionally rebase submodules (remote submodule changes only)
  builtin/fetch: parse recurse-submodules-default at default options parsing
  builtin/fetch: factor submodule recurse parsing out to submodule config
</content>
</entry>
<entry>
<title>pull: optionally rebase submodules (remote submodule changes only)</title>
<updated>2017-06-23T22:36:53Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-06-23T19:13:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6d7eb2c7a6a402a938824bcf1c5f331dd1a06bb'/>
<id>urn:sha1:a6d7eb2c7a6a402a938824bcf1c5f331dd1a06bb</id>
<content type='text'>
Teach pull to optionally update submodules when '--recurse-submodules'
is provided.  This will teach pull to run 'submodule update --rebase'
when the '--recurse-submodules' and '--rebase' flags are given under
specific circumstances.

On a rebase workflow:
=====================

1. Both sides change the submodule
 ------------------------------
Let's assume the following history in a submodule:

  H---I---J---K---L local branch
       \
        M---N---O---P remote branch

and the following in the superproject (recorded submodule in parens):

  A(H)---B(I)---F(K)---G(L)  local branch
          \
           C(N)---D(N)---E(P) remote branch

In an ideal world this would rebase the submodule and rewrite
the submodule pointers that the superproject points at such that
the superproject looks like

  A(H)---B(I)              F(K')---G(L')  rebased branch
           \                /
           C(N)---D(N)---E(P) remote branch

and the submodule as:

        J---K---L (old dangeling tip)
       /
  H---I               J'---K'---L' rebased branch
       \             /
        M---N---O---P remote branch

And if a conflict arises in the submodule the superproject rebase
would stop at that commit at which the submodule conflict occurs.

Currently a "pull --rebase" in the superproject produces
a merge conflict as the submodule pointer changes are
conflicting and cannot be resolved.

2. Local submodule changes only
 -----------------------
Assuming histories as above, except that the remote branch
would not contain submodule changes, then a result as

  A(H)---B(I)               F(K)---G(L)  rebased branch
           \                /
           C(I)---D(I)---E(I) remote branch

is desire-able. This is what currently happens in rebase.

If the recursive flag is given, the ideal git would
produce a superproject as:

  A(H)---B(I)              F(K')---G(L')  rebased branch (incl. sub rebase!)
           \                /
           C(I)---D(I)---E(I) remote branch

and the submodule as:

        J---K---L (old dangeling tip)
       /
  H---I               J'---K'---L' locally rebased branch
       \             /
        M---N---O---P advanced branch

This patch doesn't address this issue, however
a test is added that this fails up front.

3. Remote submodule changes only
 ----------------------
Assuming histories as in (1) except that the local superproject branch
would not have touched the submodule the rebase already works out in the
superproject with no conflicts:

  A(H)---B(I)               F(P)---G(P)  rebased branch (no sub changes)
           \                 /
           C(N)---D(N)---E(P) remote branch

The recurse flag as presented in this patch would additionally
update the submodule as:

  H---I              J'---K'---L' rebased branch
       \            /
        M---N---O---P remote branch

As neither J, K, L nor J', K', L' are referred to from the superproject,
no rewriting of the superproject commits is required.

Conclusion for 'pull --rebase --recursive'
 -----------------------------------------
If there are no local superproject changes it is sufficient to call
"submodule update --rebase" as this produces the desired results. In case
of conflicts, the behavior is the same as in 'submodule update --recursive'
which is assumed to be sane.

This patch implements (3) only.

On a merge workflow:
====================

We'll start off with the same underlying DAG as in (1) in the rebase
workflow. So in an ideal world a 'pull --merge --recursive' would
produce this:

  H---I---J---K---L----X
       \              /
        M---N---O---P

with X as the new merge-commit in the submodule and the superproject
as:

  A(H)---B(I)---F(K)---G(L)---Y(X)
          \                  /
           C(N)---D(N)---E(P)

However modifying the submodules on the fly is not supported in git-merge
such that Y(X) is not easy to produce in a single patch. In fact git-merge
doesn't know about submodules at all.

However when at least one side does not contain commits touching the
submodule at all, then we do not need to perform the merge for the
submodule but a fast-forward can be done via checking out either L or P
in the submodule.  This strategy is implemented in 68d03e4a6e (Implement
automatic fast-forward merge for submodules, 2010-07-07) already, so
to align with the rebase behavior we need to also update the worktree
of the submodule.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: update documentation to use 'stash entry'</title>
<updated>2017-06-19T05:16:36Z</updated>
<author>
<name>Liam Beguin</name>
<email>liambeguin@gmail.com</email>
</author>
<published>2017-06-17T22:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e01db917d8e5c66f9f90bf8c44995cf47200273a'/>
<id>urn:sha1:e01db917d8e5c66f9f90bf8c44995cf47200273a</id>
<content type='text'>
Most of the time, a 'stash entry' is called a 'stash'. Lets try to make
this more consistent and use 'stash entry' instead.

Signed-off-by: Liam Beguin &lt;liambeguin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>docs: fix formatting and grammar</title>
<updated>2017-06-02T05:10:57Z</updated>
<author>
<name>Adam Dinwoodie</name>
<email>adam@dinwoodie.org</email>
</author>
<published>2017-06-01T10:37:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c79cee697f7f4e304c53108ee895b706df1322e'/>
<id>urn:sha1:0c79cee697f7f4e304c53108ee895b706df1322e</id>
<content type='text'>
When compiling the documentation, asciidoc thinks a backtick surrounded
by whitespace shouldn't be interpreted as marking the start or end of a
literal.  In most cases, that's useful behaviour, but in the git-pull
documentation it means asciidoc is failing to correctly detect which
text should be monospaced and which shouldn't.

To avoid this, remove the extraneous spaces from the text to be
monospaced.  It would also be possible to fix the formatting by
switching to asciidoc's ++ monospace format markers and still have the
space characters included in the monospace text, but the spaces aren't
necessary and not having them keeps the markup simpler.

Also include a minor grammar fix suggested by Jeff while we're changing
these lines.

Signed-off-by: Adam Dinwoodie &lt;adam@dinwoodie.org&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: git-pull.txt use US spelling, fix minor typo</title>
<updated>2017-05-01T02:03:08Z</updated>
<author>
<name>René Genz</name>
<email>liebundartig@freenet.de</email>
</author>
<published>2017-04-30T14:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d395745d8108568934006c6411146bc93cc54737'/>
<id>urn:sha1:d395745d8108568934006c6411146bc93cc54737</id>
<content type='text'>
Signed-off-by: René Genz &lt;liebundartig@freenet.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mm/push-social-engineering-attack-doc'</title>
<updated>2017-01-10T23:24:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-10T23:24:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f52e70879d70b211de5d6132ed96cecaa8eaf89'/>
<id>urn:sha1:5f52e70879d70b211de5d6132ed96cecaa8eaf89</id>
<content type='text'>
Doc update on fetching and pushing.

* mm/push-social-engineering-attack-doc:
  doc: mention transfer data leaks in more places
</content>
</entry>
<entry>
<title>doc: mention transfer data leaks in more places</title>
<updated>2016-11-14T19:23:07Z</updated>
<author>
<name>Matt McCutchen</name>
<email>matt@mattmccutchen.net</email>
</author>
<published>2016-11-14T18:20:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=235ec24352e151bed37063a004b9800ee0debd74'/>
<id>urn:sha1:235ec24352e151bed37063a004b9800ee0debd74</id>
<content type='text'>
The "SECURITY" section of the gitnamespaces(7) man page described two
ways for a client to steal data from a server that wasn't intended to be
shared. Similar attacks can be performed by a server on a client, so
adapt the section to cover both directions and add it to the
git-fetch(1), git-pull(1), and git-push(1) man pages. Also add
references to this section from the documentation of server
configuration options that attempt to control data leakage but may not
be fully effective.

Signed-off-by: Matt McCutchen &lt;matt@mattmccutchen.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull --rebase: add --[no-]autostash flag</title>
<updated>2016-03-21T20:30:36Z</updated>
<author>
<name>Mehul Jain</name>
<email>mehul.jain2029@gmail.com</email>
</author>
<published>2016-03-21T18:18:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f66398eb57c627169429f47bbe4d943d2c975959'/>
<id>urn:sha1:f66398eb57c627169429f47bbe4d943d2c975959</id>
<content type='text'>
If rebase.autoStash configuration variable is set, there is no way to
override it for "git pull --rebase" from the command line.

Teach "git pull --rebase" the --[no-]autostash command line flag which
overrides the current value of rebase.autoStash, if set. As "git rebase"
understands the --[no-]autostash option, it's just a matter of passing
the option to underlying "git rebase" when "git pull --rebase" is called.

Helped-by: Matthieu Moy &lt;Matthieu.Moy@grenoble-inp.fr&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Mehul Jain &lt;mehul.jain2029@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: allow interactive rebase with --rebase=interactive</title>
<updated>2016-01-13T20:59:15Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-01-13T12:17:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5eb87b98dd6aa587683057b9f5bd063e682e145'/>
<id>urn:sha1:f5eb87b98dd6aa587683057b9f5bd063e682e145</id>
<content type='text'>
A couple of years ago, I found the need to collaborate on topic
branches that were rebased all the time, and I really needed to see
what I was rebasing when pulling, so I introduced an
interactively-rebasing pull.

The way builtin pull works, this change also supports the value
'interactive' for the 'branch.&lt;name&gt;.rebase' config variable, which
is a neat thing because users can now configure given branches for
interactively-rebasing pulls without having to type out the complete
`--rebase=interactive` option every time they pull.

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: handle git-fetch's options as well</title>
<updated>2015-06-02T20:36:22Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-02T14:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb2a8d9ed3fca2ba2f617b704992d483605f3bb6'/>
<id>urn:sha1:eb2a8d9ed3fca2ba2f617b704992d483605f3bb6</id>
<content type='text'>
While parsing the command-line arguments, git-pull stops parsing at the
first unrecognized option, assuming that any subsequent options are for
git-fetch, and can thus be kept in the shell's positional parameters
list, so that it can be passed to git-fetch via the expansion of "$@".

However, certain functions in git-pull assume that the positional
parameters do not contain any options:

* error_on_no_merge_candidates() uses the number of positional
  parameters to determine which error message to print out, and will
  thus print the wrong message if git-fetch's options are passed in as
  well.

* the call to get_remote_merge_branch() assumes that the positional
  parameters only contains the optional repo and refspecs, and will
  thus silently fail if git-fetch's options are passed in as well.

* --dry-run is a valid git-fetch option, but if provided after any
  git-fetch options, it is not recognized by git-pull and thus git-pull
  will continue to run the merge or rebase.

Fix these bugs by teaching git-pull to parse git-fetch's options as
well. Add tests to prevent regressions.

This removes the limitation where git-fetch's options have to come after
git-merge's and git-rebase's options on the command line. Update the
documentation to reflect this.

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