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 16, 2013, 16:26 UTC
Message-ID
<CAMP44s14TSGtQ7kvWUgrOQvT1uKciSV5fd5pQvy1ven8Z=qVcg@mail.gmail.com>
In-Reply-To
<7v61yi9arl.fsf@alter.siamese.dyndns.org>
On Thu, May 16, 2013 at 10:58 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> I _think_ the real reason you want a "git fetch" while on "mywork"
> to go to 'origin' is because you are building your "master" off of
> somebody else's work that comes from 'origin', and you want to check
> what has changed to see what you need to rebuild both your "master"
> and "mywork" branches on top of.  If 'master' were forked from a
> remote that is not 'origin', then making "git fetch" ignore '.' and
> instead go to 'origin' would not solve anything.  For an updated
> behaviour to be useful in that workflow, it needs to follow the
> inter-branch relationship ("mywork is a fork of master which is a
> fork of frotz branch from a remote xyzzy") to see the first remote
> repository and fetch from there, instead of blindly fetching from
> the 'origin'.

No, the reason I want 'git fetch' to fetch 'origin' is because it has always done so. It only stopped doing so when I configured 'upstream' branches. I'm not even sure I want 'git fetch' to fetch from the remote of my current branch if it has an upstream branch.

Show 9 quoted lines
> Having said all that, I am not all that sure that it is a good idea
> to introduce such an exception for "git fetch" to ignore '.',
> regardless of where it goes instead, either the 'origin' or the
> first remote repository it finds by recursively finding its
> upstreams, to break the consistency at the UI level.  It is dubious
> if the benefit of convenience to fetch from remote 'xyzzy' that is
> an eventual remote of 'mywork' without having to say so outweighs
> the cost of additional UI inconsistency, making things harder to
> explain to both new and old people.

That doesn't change the fact that 'git fetch .' does not make any sense whatsoever. The user *will* get confused when (s)he does 'git fetch' and nothing happens. The problem is not solved.

% git checkout -b fixes master % git fetch % git branch -u master % git fetch

# scratch head
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 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.