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

Re: Multi-head fetches, pulls, and a King Ghidorah

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 19, 2005, 09:14 UTC
Message-ID
<Pine.LNX.4.63.0508191039460.11916@wgmdd8.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vy86y1ibg.fsf@assigned-by-dhcp.cox.net>
Hi,

If I understand correctly, the multi-head fetch would not write any ref if used like this:

	git fetch remote:repository/ head tail
but it would try a fast-forward when used like this:
	git fetch remote:repository/ head:head tail:tail
Correct? If yes: This is fantastic! It obsoletes my dumb script.
On Fri, 19 Aug 2005, Junio C Hamano wrote:
Show 9 quoted lines
> However, suppose then I were Joe Random, an individual netdev
> contributor who is interested in these two netdev branches.
> Upon seeing the pull request, I might decide it is a good time
> to get changes from there, my upstream.
> 
>     $ git pull jgarzik/netdev-2.6.git/ sis190:sis190 e100:e100
> 
> Because I am keeping track of copies of these two branches, I
> use "sis190:sis190 e100:e100" to update my local heads.

I propose a "--separate" flag to git pull. This would do exactly the same as a plain git pull, but for each fetched branch which could not be fast-forwarded

	- try to switch to the branch (dying if it is not the current,
	  and the working tree is dirty)
	- try a merge
	- if the merge fails, reset the branch to original state,
	  write out a temporary head and output a warning

After that, it would switch back to the original branch and check that out.

For all failed merges, the user needs to "git resolve" (the exact command line could be output by "git pull --separate").

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 5 in “Multi-head fetches, pulls, and a King Ghidorah”
  1. Junio C HamanoAug 19, 2005
  2. Johannes SchindelinAug 19, 2005
  3. Junio C HamanoAug 19, 2005
  4. My GIT DayJunio C Hamano, Aug 20, 2005
  5. Johannes SchindelinAug 20, 2005

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.