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

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

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 17, 2013, 00:04 UTC
Message-ID
<CAMP44s0J7vcxno=v9_ewUE6FcuRVuYQhCNVS8D+AvP6cG2XNfQ@mail.gmail.com>
In-Reply-To
<7vk3my33vb.fsf@alter.siamese.dyndns.org>
On Thu, May 16, 2013 at 6:24 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 51 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Thu, May 16, 2013 at 1:04 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>>>
>>>>> If you come from "git pull" is "git fetch" + "git merge",
>>>>> and if your current branch is integrating with your local branch,
>>>>
>>>> How many times do I have to say that 'git pull' is not 'git fetch' +
>>>> 'git merge'?
>>>>
>>>> You must think everybody has 'merge.defaulttoupstream=true'.
>>>
>>> I am confused.  What does that have anything to do with this topic?
>>> It only affects what a lazy "git merge" (without any other parameter
>>> on the command line) does, doesn't it?
>>
>> And that's what we are talking about here; commands without any other
>> parameter in the command like.
>>
>> So "git pull $nothing" is *not* "git fetch $nothing" + "git merge $nothing".
>
> Of course not.  But what does it change the equation?
>
> Let's rephrase the above, then.
>
>         "git pull" with 0 or more arguments is to first
>
>         - make sure that necessary history is available in your
>           repository
>
>         - prepare FETCH_HEAD to record what is to be merged
>
>         which is done by running "git fetch" with appropriate
>         arguments against the repository of your upstream, and then
>         to
>
>         - merge the upstream history
>
>         which is done by running "git merge" with appropriate
>         arguments (which in turn is formulated by reading FETCH_HEAD
>         that is left by the previous "git fetch" step).
>
> So if your "upstream" happens to live in a local repository, it is
> very natural to run "git fetch" against repository "." (with
> appropriate arguments, like 'refs/heads/master' if you were on your
> mywork branch that was forked from your 'master' branch).  Running
> "git fetch ." is hardly "does not make any sense whatever" from that
> point of view.  It is just a natural consequence that our local
> repository is merely one of the repositories we could fetch/pull
> from.

This is irrelevant, it's an implementation detail of 'git pull'. *THE USER* is not running 'git fetch .' (s)he is running 'git push .'. ONCE AGAIN; I'm not talking about 'git pull .' I am talking about 'git fetch .' (a *USER*-run 'git fetch .'), and a *USER*-run 'git fetch .' does *not* make any sense whatsoever.

-- 
Felipe Contreras
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 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.