{"thread":{"id":"50494","subject":"Git-pull Documentation","startedAt":"2019-02-13T18:20:18Z","lastAt":"2019-02-13T22:43:39Z","messageCount":2,"participants":["Maris Razvan","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"369243","messageId":"CALZbgSSzpd7bDWE1iyfqAsv9oovsSK22oReDiPGG-Td5D2qgaA@mail.gmail.com","threadId":"50494","inReplyTo":null,"subject":"Git-pull Documentation","fromName":"Maris Razvan","fromEmail":"razvan.alex.maris@gmail.com","sentAt":"2019-02-13T18:13:09Z","receivedAt":"2019-02-13T18:20:18Z","isPatch":false,"sender":{"key":"razvan.alex.maris@gmail.com","avatar":null},"body":"Hello,\n\nIn the \"EXAMPLES\" section of the git-pull documentation\n(https://git-scm.com/docs/git-pull#_examples) there is the following:\n\n    \"[...] Merge into the current branch the remote branch next:\n\n    $ git pull origin next\n\n    This leaves a copy of next temporarily in FETCH_HEAD, but does not\nupdate any remote-\n    tracking branches. [...]\"\n\nHowever, the second bullet-point in the \"CONFIGURED REMOTE-TRACKING\nBRANCHES\" section of the git-fetch documentation\n(https://git-scm.com/docs/git-fetch#_configured_remote_tracking_branches_a_id_crtb_a)\nstates that it is possible for a command of the form \"git fetch\n<remote> <branch>\" to update a remote-tracking branch.\n\nI checked and the current behaviour of \"git pull <remote> <branch>\" is\nto update the remote-tracking branch if required, because, as I have\nseen in the code, it just calls \"git fetch\".\n\nI believe that the quoted example from the git-pull documentation is wrong.\n\nAlso, in the beginning of the git-pull documentation there is the\nfollowing paragraph:\n\n    \"Default values for <repository> and <branch> are read from the\n\"remote\" and \"merge\"\n    configuration for the current branch as set by git-branch[1] --track.\"\n\nI believe that this paragraph tries to state that if the <remote> and\nthe <refspec> arguments are missing, they are replaced with\nbranch.<name>.remote and branch.<name>.merge, respectively. However I\nthink that this paragraph is unnecessary (and partially wrong), as the\nbehaviour of git-pull when no arguments are given is described in the\n\"DEFAULT BEHAVIOUR\" section\n(https://git-scm.com/docs/git-pull#_default_behaviour) and it is a\nlittle more complicated than that, as one set of branches are used for\nfetching (e.g. the values of remote.<origin>.fetch) and another set of\nbranches are used for merging (e.g. the value of branch.<name>.merge).\n\n\nI hope I did not miss anything.\n\n\nThank you,\nRazvan Maris\n"},{"id":"369265","messageId":"xmqqsgwr9ung.fsf@gitster-ct.c.googlers.com","threadId":"50494","inReplyTo":"CALZbgSSzpd7bDWE1iyfqAsv9oovsSK22oReDiPGG-Td5D2qgaA@mail.gmail.com","subject":"Re: Git-pull Documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-13T22:43:31Z","receivedAt":"2019-02-13T22:43:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Maris Razvan <razvan.alex.maris@gmail.com> writes:\n\n> I checked and the current behaviour of \"git pull <remote> <branch>\" is\n> to update the remote-tracking branch if required, because, as I have\n> seen in the code, it just calls \"git fetch\".\n\nThe thing is, \"git fetch origin next\" did *NOT* update remote-tracking\nbranch refs/remotes/origin/next for a long time, until f2690487\n(\"fetch: opportunistically update tracking refs\", 2013-05-11)\nhappend.\n\nThe series did not update the documentation all that much, which was\nwhy you are seeing neither \"git fetch\" nor \"git pull\" documented to\nperform this \"opportunistic update of tracking refs\".  The only\nchange the topic with f2690487 brought in to the Documentation was\nthe attached bit.\n\nDocumentation updates to both pull and fetch are very much welcomed.\n\nThanks.\n\n$ git diff --stat -p 67b57a90f4 db400949b31a Documentation/\n Documentation/pull-fetch-param.txt | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt\nindex 94a9d32f1d..18cffc25b8 100644\n--- a/Documentation/pull-fetch-param.txt\n+++ b/Documentation/pull-fetch-param.txt\n@@ -68,6 +68,11 @@ Some short-cut notations are also supported.\n +\n * `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;\n   it requests fetching everything up to the given tag.\n-* A parameter <ref> without a colon is equivalent to\n-  <ref>: when pulling/fetching, so it merges <ref> into the current\n-  branch without storing the remote branch anywhere locally\n+ifndef::git-pull[]\n+* A parameter <ref> without a colon fetches that ref into FETCH_HEAD,\n+endif::git-pull[]\n+ifdef::git-pull[]\n+* A parameter <ref> without a colon merges <ref> into the current\n+  branch,\n+endif::git-pull[]\n+  and updates the remote-tracking branches (if any).\n\n\n\n"}]}