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
Junio C Hamano <junkio@cox.net>
Date
Aug 13, 2005, 07:48 UTC
Message-ID
<7vacjmqnu7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050813041114.GA29412@hpsvcnb.fc.hp.com>
Carl Baldwin <cnb@fc.hp.com> writes:
Show 8 quoted lines
> On Fri, Jul 29, 2005 at 08:10:51AM +0000, Petr Baudis wrote:
>> Exactly. I want much more freedom in pushing, the only requirement being
>> that "the to-be-replaced remote head is ancestor of the to-be-pushed
>> local head". I think (am I wrong?) git-send-pack localhead:remotehead
>> would work just fine for me, the only thing I need is the support for
>> different local and remote head names.
>
> Sorry to join the game so late.  I've only read this thread now.

Just in case you have not noticed, the push in 0.99.4 and onwards does exactly that. Please see git-push-script.txt in the Documentation/ directory --- oops, there is no such thing.

Please see git-send-pack.txt instead, and if you feel like it, I would appreciate a patch to add the missing documentation for git-push-script ;-).

What's not supported well yet is the opposite --- downloading multiple refs and dealing with them.

Johannes Schindelin calls this "reverse push", and I think that is really a good name to describe what it does. It takes a remote repository and possibly multiple refs, downloads the objects to complete the named remote references, and updates the local refs only if the remote refs are fast forward children of the local refs being replaced, just like "push" fast forwards the remote refs using the local refs. In other words, given <src> and <dst> repository, the following should do the same thing:

    On <src> repository machine, with GIT_DIR being the <src> repository:
    $ git push <dst> <ref-local-name>:<ref-remote-name>...
    On <dst> repository machine, with GIT_DIR being the <dst> repository:
    $ git pull <src> <ref-remote-name>:<ref-local-name>...

Johannes posted a script on the list a couple of days ago, which should work well, except that it was written before the git-fetch-pack command was updated to natively download from multiple refs, so it does not know how to fetch multiple refs at a one go.

-jc
Previous: Carl BaldwinNext: Carl Baldwin
Message 31 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.