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

Re: [PATCH 1/3] fetch: add --allow-local option

From
Junio C Hamano <gitster@pobox.com>
Date
May 17, 2013, 18:30 UTC
Message-ID
<7vtxm1xxvd.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAMP44s0J7vcxno=v9_ewUE6FcuRVuYQhCNVS8D+AvP6cG2XNfQ@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> This is irrelevant, it's an implementation detail of 'git pull'. *THE
> USER* is not running 'git fetch .'

To those who fear running "git pull", the following has worked as a quick way to "preview" what they would be getting.

	git fetch
        git log ..FETCH_HEAD

and then they can "git merge FETCH_HEAD" to conclude it, or run a "git pull" for real. We teach the more explicit form to end users in our tutorial, but it shows the explicit form only because we want to illustrate what goes on. Over time we added support to "git fetch" (and "git pull") to make it possible for users to type less when the remote and branch involved are obvious, but we carefully avoided breaking this expectation.

So when "the user" is running "git fetch" on "mywork" branch that happens to be forked from a local "master", i.e. her configuration is set as

	[branch "mywork"]
        	remote = .
                merge = refs/heads/master

we still need to have FETCH_HEAD updated to point at what we would be merging if she did a "git pull". It may be OK to additionally fetch objects from 'origin' and update the remote tracking branches associated with 'origin', but anything from 'origin' should not contaminate what results in FETCH_HEAD---it should record whatever we record when we did fetch refs/heads/master from '.'.

As I said in the very beginning, it was a mistake for me to suggest adding a special case behaviour for '.' remote in the first place. It breaks a long-standing expectation and workflow built around it.

So sorry for wasting our time, and consider this as a misguided excursion.

Previous: Felipe ContrerasNext: Felipe Contreras
Message 19 of 31 in “fetch: fix '.' fetching”
  1. 0/3 fetch: fix '.' fetchingFelipe Contreras, May 16, 2013
  2. 1/3 fetch: add --allow-local optionFelipe Contreras, May 16, 2013
  3. Ramkumar RamachandraMay 16, 2013
  4. Felipe ContrerasMay 16, 2013
  5. Ramkumar RamachandraMay 16, 2013
  6. Felipe ContrerasMay 16, 2013
  7. Ramkumar RamachandraMay 16, 2013
  8. Felipe ContrerasMay 16, 2013
  9. Ramkumar RamachandraMay 16, 2013
  10. Felipe ContrerasMay 16, 2013
  11. Junio C HamanoMay 16, 2013
  12. Felipe ContrerasMay 16, 2013
  13. Junio C HamanoMay 16, 2013
  14. Felipe ContrerasMay 16, 2013
  15. Junio C HamanoMay 16, 2013
  16. Felipe ContrerasMay 16, 2013
  17. Junio C HamanoMay 16, 2013
  18. Felipe ContrerasMay 17, 2013
  19. Junio C HamanoMay 17, 2013
  20. Felipe ContrerasMay 18, 2013
  21. Junio C HamanoMay 19, 2013
  22. Felipe ContrerasMay 19, 2013
  23. About overzealous compatibilityFelipe Contreras, May 19, 2013
  24. Felipe ContrerasMay 19, 2013
  25. Philip OakleyMay 18, 2013
  26. Felipe ContrerasMay 18, 2013
  27. Philip OakleyMay 18, 2013
  28. Felipe ContrerasMay 18, 2013
  29. Junio C HamanoMay 19, 2013
  30. 2/3 fetch: switch allow-local off by defaultFelipe Contreras, May 16, 2013
  31. 3/3 remote: disable allow-local for pushesFelipe Contreras, May 16, 2013

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.