{"thread":{"id":"37165","subject":"a more helpful message on \"git status\" output","startedAt":"2014-07-18T19:03:43Z","lastAt":"2014-07-21T10:20:33Z","messageCount":6,"participants":["Julián Landerreche","Junio C Hamano","Jonathan Nieder","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"246329","messageId":"CAKQhN+rK0ftwC5hX4hDhXZbcEGAfCCBXRaQXYnMFLmR=n21OLA@mail.gmail.com","threadId":"37165","inReplyTo":null,"subject":"a more helpful message on \"git status\" output","fromName":"Julián Landerreche","fromEmail":"maniqui@gmail.com","sentAt":"2014-07-18T19:03:43Z","receivedAt":"2014-07-18T19:03:43Z","isPatch":false,"sender":{"key":"maniqui@gmail.com","avatar":null},"body":"Hi,\nwhen running \"git status\", if the current branch can be\nfast-forwarded, the user get this message:\n\n  On branch master\n  Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.\n    (use \"git pull\" to update your local branch)\n\n\nThe suggestion of using \"git pull\" for updating the local branch,\nalthough it will work, might not be a proper choice or advice in terms\nof what is really needed to just update the local branch.\n\nAs the user already has the newer commits locally (ie. the commits\nhave been already \"git fetch\"ed), he just needs to merge them. Running\n\"git pull\" will unnecessarily try to fetch commits from upstream\nagain.\nSo...\n\nProposal: suggesting the user to run \"git merge\" or \"git merge\norigin/master\" seems a more helpful suggestion, imo. Also, for\nbeginners, it helps for better understanding on what's going on, and\ngoes in hand with the usual advice of using \"git fetch\" + \"git merge\"\n(instead of \"git pull\") to grasp better some Git concepts and how Git\nworks.\nSo, the output of git status would read like this:\n\n  On branch master\n  Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.\n    (use \"git merge origin/master\" to update your local branch)\n\n(it could read \"git merge\" too, if it defaults to merging upstream,\ntracked branch).\n"},{"id":"246332","messageId":"xmqq38dympo8.fsf@gitster.dls.corp.google.com","threadId":"37165","inReplyTo":"CAKQhN+rK0ftwC5hX4hDhXZbcEGAfCCBXRaQXYnMFLmR=n21OLA@mail.gmail.com","subject":"Re: a more helpful message on \"git status\" output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-07-18T19:29:11Z","receivedAt":"2014-07-18T19:29:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Julián Landerreche <maniqui@gmail.com> writes:\n\n> when running \"git status\", if the current branch can be\n> fast-forwarded, the user get this message:\n>\n>   On branch master\n>   Your branch is behind 'origin/master' by 6 commits, and can be fast-forwarded.\n>     (use \"git pull\" to update your local branch)\n>\n> The suggestion of using \"git pull\" for updating the local branch,\n> although it will work, might not be a proper choice or advice in terms\n> of what is really needed to just update the local branch.\n>\n> As the user already has the newer commits locally (ie. the commits\n> have been already \"git fetch\"ed), he just needs to merge them. Running\n> \"git pull\" will unnecessarily try to fetch commits from upstream\n> again.\n\nBy running \"git pull\", the user may obtain yet newer commits from\nthe upstream, which very likely will happen in an active project, or\n\"git fetch\" launched by \"git pull\" will return without doing\nanything after noticing there is nothing new.\n\nAs long as the updates to the upstream is also a fast-forward, it\nwill still fast-forward you, but to an even newer state of the\nupstream.\n\nThere is no harm done[*1*] by suggesting \"git pull\" over \"git\nmerge\", no?\n\n\n[Footnote]\n\n*1* There is a bigger problem with this message, especially when the\nuser sees it on 'master', but your message is about the case where\nyou are strictly behind and that bigger problem will not be an\nissue, so I won't discuss it further.\n"},{"id":"246334","messageId":"CAKQhN+p5FpX-GEZeX0t-Y1Sq6+fdfRpE+ACqhKgdLWGFRj0ToA@mail.gmail.com","threadId":"37165","inReplyTo":"xmqq38dympo8.fsf@gitster.dls.corp.google.com","subject":"Re: a more helpful message on \"git status\" output","fromName":"Julián Landerreche","fromEmail":"maniqui@gmail.com","sentAt":"2014-07-18T19:47:15Z","receivedAt":"2014-07-18T19:47:15Z","isPatch":false,"sender":{"key":"maniqui@gmail.com","avatar":null},"body":"> By running \"git pull\", the user may obtain yet newer commits from\n> the upstream, which very likely will happen in an active project, or\n> \"git fetch\" launched by \"git pull\" will return without doing\n> anything after noticing there is nothing new.\n>\n> As long as the updates to the upstream is also a fast-forward, it\n> will still fast-forward you, but to an even newer state of the\n> upstream.\n>\n> There is no harm done[*1*] by suggesting \"git pull\" over \"git\n> merge\", no?\n\nOK, I'm mostly convinced.\nA more verbose, educational output could read:\n\n  (use \"git pull\" to fetch newer commits from upstream and update your\nlocal branch)\n  (use \"git merge\" to update your local branch)\n\n\n> [Footnote]\n>\n> *1* There is a bigger problem with this message, especially when the\n> user sees it on 'master', but your message is about the case where\n> you are strictly behind and that bigger problem will not be an\n> issue, so I won't discuss it further.\n\nNo idea what's this \"bigger problem with this message\". Care to expand?\n\nThanks.\n"},{"id":"246337","messageId":"20140718210500.GU12427@google.com","threadId":"37165","inReplyTo":"CAKQhN+p5FpX-GEZeX0t-Y1Sq6+fdfRpE+ACqhKgdLWGFRj0ToA@mail.gmail.com","subject":"Re: a more helpful message on \"git status\" output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-07-18T21:05:00Z","receivedAt":"2014-07-18T21:05:00Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Julián Landerreche wrote:\n\n> A more verbose, educational output could read:\n>\n>   (use \"git pull\" to fetch newer commits from upstream and update your local branch)\n>   (use \"git merge\" to update your local branch)\n\nYes, I like this idea, with a few qualifications:\n\n 1. The first line is long.  Is there a shorter way to say the same\n    thing?  Maybe\n\n    (use \"git pull\" to fetch newer commits and update your local branch)\n\n 2. s/from upstream/from $remote/ (e.g., \"from origin\") in the first\n    line?  Though that would make problem (1) worse.\n\n 3. Is there some way to make it more obvious these two hints are\n    independent suggestions and that the user doesn't need to do both?\n    Maybe something as simple as\n\n    (or use \"git merge\" to update your local branch)\n\n 4. Should the advice differ based on whether the current branch is set\n    up for merging or rebasing?\n\nThanks,\nJonathan\n"},{"id":"246338","messageId":"xmqqy4vql6c2.fsf@gitster.dls.corp.google.com","threadId":"37165","inReplyTo":"CAKQhN+p5FpX-GEZeX0t-Y1Sq6+fdfRpE+ACqhKgdLWGFRj0ToA@mail.gmail.com","subject":"Re: a more helpful message on \"git status\" output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-07-18T21:12:13Z","receivedAt":"2014-07-18T21:12:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Julián Landerreche <maniqui@gmail.com> writes:\n\n>> By running \"git pull\", the user may obtain yet newer commits from\n>> the upstream, which very likely will happen in an active project, or\n>> \"git fetch\" launched by \"git pull\" will return without doing\n>> anything after noticing there is nothing new.\n>>\n>> As long as the updates to the upstream is also a fast-forward, it\n>> will still fast-forward you, but to an even newer state of the\n>> upstream.\n>>\n>> There is no harm done[*1*] by suggesting \"git pull\" over \"git\n>> merge\", no?\n>\n> OK, I'm mostly convinced.\n> A more verbose, educational output could read:\n>\n>   (use \"git pull\" to fetch newer commits from upstream and update your\n> local branch)\n>   (use \"git merge\" to update your local branch)\n\nI actually do not like that, to be honest.\n\nThese brief reminders should be just that, and if anything, we\nshould aim to make them shorter and more concise, not longer and\nmore verbose.  They will never be sufficient to replace \"education\"\n(otherwise why would we even have complete manual?)---they should\njust point the users clearly in the right direction.\n"},{"id":"246434","messageId":"vpqtx6bnhce.fsf@anie.imag.fr","threadId":"37165","inReplyTo":"xmqqy4vql6c2.fsf@gitster.dls.corp.google.com","subject":"Re: a more helpful message on \"git status\" output","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-07-21T10:20:33Z","receivedAt":"2014-07-21T10:20:33Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Julián Landerreche <maniqui@gmail.com> writes:\n>\n>> OK, I'm mostly convinced.\n>> A more verbose, educational output could read:\n>>\n>>   (use \"git pull\" to fetch newer commits from upstream and update your\n>> local branch)\n>>   (use \"git merge\" to update your local branch)\n>\n> I actually do not like that, to be honest.\n>\n> These brief reminders should be just that, and if anything, we\n> should aim to make them shorter and more concise, not longer and\n> more verbose.\n\nI think so too. For someone not willing to read the doc, the current\nmessage is sufficient, and for someone willing to read it, the output of\n\"git status\" is IHMO not a good place to teach the difference between\nmerge and pull.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}