git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bad git pull

From
Junio C Hamano <junkio@cox.net>
Date
Dec 16, 2005, 19:20 UTC
Message-ID
<7vk6e4hmrj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051216172535.GA25856@hpsvcnb.fc.hp.com>
Carl Baldwin <cnb@fc.hp.com> writes:
> Whenever I give a colleage an introduction to git I emphatically
> recommend that they start with using git fetch and git merge
> independantly of each other and stay away for git pull at least until
> they know what they're doing.
You "reduced" this sequence:
	$ git symbolic-ref HEAD ;# to make sure you are on the branch
                                 # you think you are on
	$ git pull
to this sequence:
	$ git fetch origin      ;# would not damage the repository
	$ git symbolic-ref HEAD ;# to make sure you are on the branch
                                 # you think you are on
	$ git merge "Merge from frotz branch of git://..." HEAD FETCH_HEAD

The thing is, you need to make sure where you are, in either case, before the actual merge happens. Yours needs extra typing, and in addition loses the merge message autogenerated by "git pull". Sorry, I fail to see how that is an improvement.

> I see nothing in the English dictionary to suggest that pull
> means fetch + merge.

I agree to this. I have never used BK so this is just a speculation, but I suspect what happened is that we inherited "pull" terminology from there, needed to name the merge-less part something, and we ended up calling it "fetch". So the history behind them might be expressed better by "fetch = pull - merge" instead of saying "pull = fetch + merge" ;-).

> ...  I also recommend that some
> extra care should be taken in the tutorials and documentation to warn
> about this difference up front and possibly suggest avoiding the use of
> pull for those new to git.

Yup. Thanks for the comments. I am not a good writer, so a patch is greatly appreciated.

BTW, I feel that setting Mail-Followup-To: to other people is just plain rude.

    Mail-Followup-To: Junio C Hamano <junkio@cox.net>,
            Don Zickus <dzickus@gmail.com>, git@vger.kernel.org

I suspect you are trying to avoid receiving a duplicate message because you subscribe to the list, but when I tell my MUA "I want to say something to the author of this message in public" I get Don Zickus on the To: line instead of you, and I had to edit the To: line to point at you. Aren't you forcing me (and other people who might want to follow-up to your message) to do extra work, and making Don's life harder [*1*], just to work around the problem on your end, when you could just filter the incoming duplicates yourself?

Removing yourself from CC: line when the CC: line already contains the mailing list you subscribe to would be fine, but I find this use of Mail-Followup-To: somewhat objectionable.

[Footnote]

*1* Don could have a mail sorter that prioritizes messages addressed To: over Cc: him, and response meant to *you* goes with To: Don --- which messes up such a mail sorting rule.

Previous: Carl BaldwinNext: Morten Welinder
Message 7 of 22 in “bad git pull”
  1. Don ZickusDec 15, 2005
  2. Junio C HamanoDec 15, 2005
  3. Junio C HamanoDec 15, 2005
  4. Don ZickusDec 16, 2005
  5. Junio C HamanoDec 16, 2005
  6. Carl BaldwinDec 16, 2005
  7. Junio C HamanoDec 16, 2005
  8. Morten WelinderDec 16, 2005
  9. Junio C HamanoDec 16, 2005
  10. Linus TorvaldsDec 16, 2005
  11. Morten WelinderDec 17, 2005
  12. Linus TorvaldsDec 17, 2005
  13. Junio C HamanoDec 17, 2005
  14. Linus TorvaldsDec 17, 2005
  15. Junio C HamanoDec 17, 2005
  16. Nicolas PitreDec 17, 2005
  17. Junio C HamanoDec 18, 2005
  18. Nicolas PitreDec 18, 2005
  19. Linus TorvaldsDec 18, 2005
  20. Junio C HamanoDec 18, 2005
  21. Nicolas PitreDec 18, 2005
  22. Junio C HamanoDec 17, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.