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

Re: "git-send-pack"

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jun 30, 2005, 22:25 UTC
Message-ID
<Pine.LNX.4.21.0506301731220.30848-100000@iabervon.org>
In-Reply-To
<Pine.LNX.4.58.0506301412470.14331@ppc970.osdl.org>
On Thu, 30 Jun 2005, Linus Torvalds wrote:
Show 22 quoted lines
> On Thu, 30 Jun 2005, Daniel Barkalow wrote:
> > 
> > I suspect that I'll be able to merge send-pack/receive-pack with
> > ssh-push/ssh-pull this evening, and then it'll have the feature of not
> > caring too much which side your command line is on.
> 
> The simple thing to do is to just get one commit at a time, see if you 
> have it already, parse if it not, and go on to the parents.
> 
> That would fit the current git-pull thing, and may be good enough, but it 
> has the downside that it can need a _lot_ of back-and-forth fecthing of 
> commit objects from the other side until you find the one you want. That's 
> going to be _very_ slow over a high-latency connection.
> 
> So what I'd suggest is:
> 
> 1- puller starts by just asking "what's your SHA1 for the ref I want"
> 
>    The puller wants to know this, because a common case may be that it 
>    already has it, in which case it doesn't need to do anything. But more 
>    importantly, the puller will need to know this anyway if it gets an 
>    object-pack, so that the puller can update it's FETCH_HEAD.
Already have this, for the non-pack case.
Show 7 quoted lines
>  - At some point the server sees the first SHA1 it recognizes, and at that 
>    point the server will have to start working. It will just send back an 
>    "ok, got it" message (telling the client to not bother continuing to 
>    send it any more commit ID's), and then does
> 
> 	git-rev-list --objects ref-client-wants ^first-common-sha1 |
> 		git-pack-objects --stdout
Right.
>  - the client just unpacks the objects, and if successful, it puts the new 
>    top ref it got into FETCH_HEAD. It's now done.
Or wherever it's been told to, yes.
Show 6 quoted lines
> And I do _not_ think that it makes a lot of sense to try to be symmetric.  
> For one thing, while a "git-send-pack" should update all the refs
> in-place, a "git-pull-pack" should _not_ update the ref, it should just
> set FETCH_HEAD instead and the puller can decide what he wants to do with
> that ref (possibly merge it, but possibly just make it be a new local
> branch "remote-branch").

My expectation is that the puller will have a ref "remote-branch", and will therefore: (1) want to update it, and (2) know the last commit pulled from it. In this situation, we can skip figuring out the start (the two points I didn't quote), because we saved it from before.

At least, this is how I've always done it; I've got a "linus" branch that follows the public repo, and I commit changes to a different branch. I suppose one could skip hanging onto this info, but it seems like an obviously useful thing to keep, if for no other reason than that I want to diff against it. This is essentially promoting FETCH_HEAD to a refs/heads/ thing, and having separate ones when you pull from separate sources.

I suppose things are different if you do a lot of one-shot pulls, rather than tracking branches that you pull from; I'll need to think about this case (assuming that's actually what you do).

	-Daniel
*This .sig left intentionally blank*
Previous: A Large Angry SCMNext: Linus Torvalds
Message 29 of 86 in “"git-send-pack"”
  1. Linus TorvaldsJun 30, 2005
  2. A Large Angry SCMJun 30, 2005
  3. A Large Angry SCMJun 30, 2005
  4. Linus TorvaldsJun 30, 2005
  5. Jan HarkesJun 30, 2005
  6. Mike TahtJun 30, 2005
  7. Linus TorvaldsJun 30, 2005
  8. Matthias UrlichsJul 1, 2005
  9. Linus TorvaldsJun 30, 2005
  10. Junio C HamanoJun 30, 2005
  11. Daniel BarkalowJun 30, 2005
  12. Linus TorvaldsJun 30, 2005
  13. H. Peter AnvinJun 30, 2005
  14. Linus TorvaldsJun 30, 2005
  15. H. Peter AnvinJun 30, 2005
  16. Linus TorvaldsJul 1, 2005
  17. H. Peter AnvinJul 1, 2005
  18. Mike TahtJul 1, 2005
  19. H. Peter AnvinJul 2, 2005
  20. Linus TorvaldsJul 2, 2005
  21. H. Peter AnvinJul 2, 2005
  22. Linus TorvaldsJul 2, 2005
  23. H. Peter AnvinJul 2, 2005
  24. Linus TorvaldsJul 2, 2005
  25. H. Peter AnvinJul 2, 2005
  26. Tony LuckJul 2, 2005
  27. H. Peter AnvinJul 2, 2005
  28. A Large Angry SCMJul 2, 2005
  29. Daniel BarkalowJun 30, 2005
  30. Linus TorvaldsJun 30, 2005
  31. Daniel BarkalowJul 1, 2005
  32. Linus TorvaldsJun 30, 2005
  33. Dan HolmsandJun 30, 2005
  34. Daniel BarkalowJun 30, 2005
  35. Linus TorvaldsJun 30, 2005
  36. H. Peter AnvinJun 30, 2005
  37. Linus TorvaldsJun 30, 2005
  38. H. Peter AnvinJun 30, 2005
  39. H. Peter AnvinJun 30, 2005
  40. Linus TorvaldsJun 30, 2005
  41. H. Peter AnvinJun 30, 2005
  42. Matthias UrlichsJul 1, 2005
  43. Jan HarkesJul 1, 2005
  44. TagsEric W. Biederman, Jul 1, 2005
  45. H. Peter AnvinJul 1, 2005
  46. Eric W. BiedermanJul 1, 2005
  47. H. Peter AnvinJul 1, 2005
  48. Eric W. BiedermanJul 1, 2005
  49. Daniel BarkalowJul 1, 2005
  50. H. Peter AnvinJul 2, 2005
  51. Eric W. BiedermanJul 2, 2005
  52. H. Peter AnvinJul 2, 2005
  53. Eric W. BiedermanJul 2, 2005
  54. H. Peter AnvinJul 2, 2005
  55. Eric W. BiedermanJul 2, 2005
  56. Matthias UrlichsJul 2, 2005
  57. H. Peter AnvinJul 2, 2005
  58. Linus TorvaldsJul 2, 2005
  59. H. Peter AnvinJul 2, 2005
  60. A Large Angry SCMJul 2, 2005
  61. Linus TorvaldsJul 2, 2005
  62. A Large Angry SCMJul 2, 2005
  63. Linus TorvaldsJul 3, 2005
  64. Petr BaudisJul 2, 2005
  65. Linus TorvaldsJul 2, 2005
  66. Dan HolmsandJul 3, 2005
  67. Kevin SmithJul 3, 2005
  68. Eric W. BiedermanJul 5, 2005
  69. Daniel BarkalowJul 5, 2005
  70. Eric W. BiedermanJul 5, 2005
  71. Linus TorvaldsJul 5, 2005
  72. Junio C HamanoJul 5, 2005
  73. Matthias UrlichsJul 6, 2005
  74. Eric W. BiedermanJul 7, 2005
  75. Linus TorvaldsJul 2, 2005
  76. Jan HarkesJul 2, 2005
  77. Jan HarkesJul 2, 2005
  78. Matthias UrlichsJul 2, 2005
  79. Petr BaudisJul 1, 2005
  80. H. Peter AnvinJul 1, 2005
  81. Matthias UrlichsJul 1, 2005
  82. Petr BaudisJul 1, 2005
  83. H. Peter AnvinJul 1, 2005
  84. Daniel BarkalowJul 1, 2005
  85. Petr BaudisJul 1, 2005
  86. Daniel BarkalowJun 30, 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.