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

Re: [PATCH] Try harder to find a remote when on a detached HEAD or non-tracking branch.

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 20, 2012, 17:42 UTC
Message-ID
<20120620174213.GA2500@book.hvoigt.net>
In-Reply-To
<4FE0F262.9050404@xiplink.com>
Hi,
On Tue, Jun 19, 2012 at 05:42:58PM -0400, Marc Branchaud wrote:
Show 7 quoted lines
> On 12-06-19 03:31 PM, Heiko Voigt wrote:
> > Using the first configured remote as a fallback also sounds quite
> > arbitrary to me. Your current HEAD might have nothing to do with that
> > remote.
> 
> Sure, but if it doesn't specify a remote then why not?  (Instead of "first
> configured remote" think "remote used in the initial clone command".)

Returning the "remote used in the initial clone" sounds ok to me as well but that does not have to be the same as "first remote git config --list returns".

Show 10 quoted lines
> > Before falling back to origin how about guessing the remote from the
> > first branch thats contained in HEAD?
> >
> > To me that sounds quite natural. The first branch could be ambiguous so
> > we would have to come up with some ordering. Maybe a depth search and
> > first parents first? Or a breadth first search with younger generations
> > first and then first parents first?
> 
> This sounds much harder to explain to a user than "the remote you used when
> you cloned the repo".

Well I think "it uses the remote of the branch that you based your work on" is not hard to explain. What's harder is the implementation.

> > Would that work for your use case Marc?
> 
> Maybe, but it seems much more complicated than necessary.

Git is a tool used in very different workflows so a change needs to be quite generic. Make it as simple as possible but *no simpler*. I think your patch is currently not respecting the "no simpler".

Cheers Heiko
Previous: Marc BranchaudNext: Jeff King
Message 9 of 20 in “Try harder to find a remote when on a detached HEAD or non-tracking branch.”
  1. Try harder to find a remote when on a detached HEAD or non-tracking branch.marcnarc@xiplink.com, Jun 18, 2012
  2. Junio C HamanoJun 18, 2012
  3. Marc BranchaudJun 18, 2012
  4. Junio C HamanoJun 18, 2012
  5. Marc BranchaudJun 19, 2012
  6. Junio C HamanoJun 19, 2012
  7. Heiko VoigtJun 19, 2012
  8. Marc BranchaudJun 19, 2012
  9. Heiko VoigtJun 20, 2012
  10. Jeff KingJun 19, 2012
  11. Junio C HamanoJun 19, 2012
  12. Marc BranchaudJun 19, 2012
  13. Jeff KingJun 19, 2012
  14. Junio C HamanoJun 19, 2012
  15. Jeff KingJun 19, 2012
  16. Junio C HamanoJun 19, 2012
  17. Jens LehmannJun 19, 2012
  18. Marc BranchaudJun 19, 2012
  19. Phil HordJun 20, 2012
  20. Arnaud LacombeJun 18, 2012

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.