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

Re: How is working on arbitrary remote heads supposed to work in Cogito (+ PATCH)?

From
Petr Baudis <pasky@suse.cz>
Date
Jul 28, 2005, 12:08 UTC
Message-ID
<20050728120806.GA2391@pasky.ji.cz>
In-Reply-To
<7vll3rlnqm.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Wed, Jul 27, 2005 at 02:58:42PM CEST, I got a letter where Josef Weidendorfer <Josef.Weidendorfer@gmx.de> told me that...

> Hi,
Hello,
Show 15 quoted lines
> if I clone a remote head other than master via Cogito with
> 
> 	cg-clone host:path#remoteHead,
> 
> work on this branch, and try to push back my changes with
> 
> 	cg-push,
> 
> I get the error
> 
> 	"pushing to a different head not supported yet".
> 
> As far as I can see, there is no support in core GIT to make this ever work 
> (at least with get-send-packs), as "git-send-pack" only updates a set of 
> heads with the same name both locally and remote.
Yes. It sucks. :-)
Show 5 quoted lines
> I suppose the best would be to always keep the same head names in cloned 
> repositories - it seems to be easier to handle for users. Perhaps the only 
> exception would be "master", as one probably would like to pull masters of 
> different remote repositories into a local one (without really working on 
> them).

I think that would be quite confusing. I mean, you added a remote "bar" branch under name "foo" by cg-branch-add, but suddenly, branch "bar" appears as well. Worse if you already have a different branch "bar".

> Thus, what about the following: Each time a remote head other than master is 
> cloned, a head with the same name is created locally which is an alias to the 
> local master. This way, cg-push almost works out of the box. Following patch 
> implements this behavior.

See above. I would much rather see more flexible git-send-pack. Junio, what about changing its [heads]* parameter e.g. to [remotehead[:localhead]]* ?

Dear diary, on Thu, Jul 28, 2005 at 03:32:01AM CEST, I got a letter where Junio C Hamano <junkio@cox.net> told me that...

Show 11 quoted lines
> Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:
> 
> > As far as I can see, there is no support in core GIT to make this ever work 
> > (at least with get-send-packs), as "git-send-pack" only updates a set of 
> > heads with the same name both locally and remote.
> 
> Yes, it is my understanding that "clone" means to literally
> clone, not "pull into an empty repository with renamed head
> names", to the core GIT.  I do not speak for Pasky, but Cogito's
> "clone" seems to have a bit different semantics (which I suspect
> is more friendly to the users in many situations).

cg-clone serves only for initializing the repository from a remote source initially.

> Similarly, "push" to the core GIT (that is what git-send-pack is
> about) means performing a subset of "clone" in reverse.  This is
> primarily to synchronise two repositories owned by a single
> person.

cg-push aims to serve as a general pushing mechanism, which should work properly even if multiple people push to a single repository.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 41 in “How is working on arbitrary remote heads supposed to work in Cogito (+ PATCH)?”
  1. Josef WeidendorferJul 27, 2005
  2. Junio C HamanoJul 28, 2005
  3. Petr BaudisJul 28, 2005
  4. Johannes SchindelinJul 28, 2005
  5. Petr BaudisJul 28, 2005
  6. Johannes SchindelinJul 28, 2005
  7. Petr BaudisJul 28, 2005
  8. Junio C HamanoJul 28, 2005
  9. Johannes SchindelinJul 28, 2005
  10. Ryan AndersonJul 28, 2005
  11. Johannes SchindelinJul 28, 2005
  12. Petr BaudisJul 28, 2005
  13. Johannes SchindelinJul 28, 2005
  14. Matthias UrlichsJul 28, 2005
  15. Johannes SchindelinJul 28, 2005
  16. Petr BaudisJul 29, 2005
  17. Junio C HamanoJul 29, 2005
  18. Petr BaudisJul 29, 2005
  19. Junio C HamanoJul 29, 2005
  20. Petr BaudisJul 29, 2005
  21. Junio C HamanoJul 29, 2005
  22. Petr BaudisJul 29, 2005
  23. Johannes SchindelinJul 29, 2005
  24. Petr BaudisJul 29, 2005
  25. Johannes SchindelinJul 29, 2005
  26. Petr BaudisJul 29, 2005
  27. Junio C HamanoJul 30, 2005
  28. Matthias UrlichsJul 29, 2005
  29. Junio C HamanoJul 30, 2005
  30. Carl BaldwinAug 13, 2005
  31. Junio C HamanoAug 13, 2005
  32. Carl BaldwinAug 15, 2005
  33. Johannes SchindelinAug 15, 2005
  34. Josef WeidendorferJul 29, 2005
  35. Matthias UrlichsJul 28, 2005
  36. Petr BaudisJul 29, 2005
  37. Josef WeidendorferJul 28, 2005
  38. Unnamed branchesPetr Baudis, Jul 28, 2005
  39. Junio C HamanoJul 28, 2005
  40. Petr BaudisJul 28, 2005
  41. Petr BaudisJul 28, 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.