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

Re: What should "git fetch origin +next" should do?

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Oct 19, 2011, 13:45 UTC
Message-ID
<4E9ED47E.5050408@xiplink.com>
In-Reply-To
<7v8vohfvqs.fsf@alter.siamese.dyndns.org>
On 11-10-19 12:31 AM, Junio C Hamano wrote:
Show 21 quoted lines
> Marc Branchaud <marcnarc@xiplink.com> writes:
> 
>> In all cases if the command-line refspec has no RHS then git should try to
>> figure out which local ref to update from the config, and it should die if it
>> can't figure out a local ref to create or update.  (As I said above, maybe
>> allow "git fetch origin foo:" to let the user put the tip of origin's foo ref
>> into FETCH_HEAD.)
> 
> I'd agree with everything you said in your message, except for the above
> "it should die" part.
> 
> You are assuming that the user knows what his configured refspecs would
> normally do and that is the whole reason why "git fetch origin next" that
> would update the remote tracking branch specified for the upstream's next
> might feel more natural than the current behaviour. I too think that is a
> reasonable assumption.
> 
> With the same assumption, if you said "git fetch origin frotz" when you
> know you are not usually tracking the remote 'frotz' branch, the command
> just should store what is fetched in FETCH_HEAD (and nowhere else) without
> dying. I do not think how it helps the user to die in that situation.
Sounds reasonable to me.
In all cases, I'd expect fetch to tell me what it did.
Show 5 quoted lines
>> All this gets a bit more complicated if the user has currently checked out
>> the a ref that should be updated (regardless of the presence of a LHS +).
> 
> That "do not update the currently checked out branch" already exists and
> is correctly handled by "git fetch", I think.
Sweet!

(I'd also be happy if fetch updated the ref, and left the checked-out HEAD detached, with attendant messages. But then I'm quite comfortable working with detached HEADs.)

		M.
Previous: Junio C Hamano
Message 10 of 10 in “What should "git fetch origin +next" should do?”
  1. Junio C HamanoOct 16, 2011
  2. Marc BranchaudOct 17, 2011
  3. Ramkumar RamachandraOct 17, 2011
  4. Junio C HamanoOct 17, 2011
  5. Ramkumar RamachandraOct 17, 2011
  6. Jeff KingOct 17, 2011
  7. Junio C HamanoOct 17, 2011
  8. Marc BranchaudOct 17, 2011
  9. Junio C HamanoOct 19, 2011
  10. Marc BranchaudOct 19, 2011

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.