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

Re: [3/5] Add http-pull

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 17, 2005, 19:08 UTC
Message-ID
<20050417190824.GF1461@pasky.ji.cz>
In-Reply-To
<Pine.LNX.4.21.0504171412350.30848-100000@iabervon.org>

Dear diary, on Sun, Apr 17, 2005 at 08:49:11PM CEST, I got a letter where Daniel Barkalow <barkalow@iabervon.org> told me that...

Show 10 quoted lines
> On Sun, 17 Apr 2005, Petr Baudis wrote:
> > > Index: http-pull.c
> > > ===================================================================
> > > --- /dev/null  (tree:d662b707e11391f6cfe597fd4d0bf9c41d34d01a)
> > > +++ 157b46ce1d82b3579e2e1258927b0d9bdbc033ab/http-pull.c  (mode:100644 sha1:106ca31239e6afe6784e7c592234406f5c149e44)
> > > +	url = malloc(strlen(base) + 50);
> > 
> > Off-by-one. What about the trailing NUL?
> 
> I get length(base) + "object/"=8 + 40 SHA1 + 1 for '/' and 1 for NUL = 50.
Sorry, counted one '/' more. :-)
Show 22 quoted lines
> > I think you should have at least two disjunct modes - either you are
> > downloading everything related to the given commit, or you are
> > downloading all commit records for commit predecessors.
> > 
> > Even if you might not want all the intermediate trees, you definitively
> > want the intermediate commits, to keep the history graph contignuous.
> > 
> > So in git pull, I'd imagine to do
> > 
> > 	http-pull -c $new_head
> > 	http-pull -t $(tree-id $new_head)
> > 
> > So, -c would fetch a given commit and all its predecessors until it hits
> > what you already have on your side. -t would fetch a given tree with all
> > files and subtrees and everything. http-pull shouldn't default on
> > either, since they are mutually exclusive.
> > 
> > What do you think?
> 
> I think I'd rather keep the current behavior and add a -c for getting the
> history of commits, and maybe a -a for getting the history of commits and
> their tress.

I'm not too kind at this. Either make it totally separate commands, or make a required switch specifying what to do. Otherwise it implies the switches would just modify what it does, but they make it do something completely different.

-a would be fine too - basically a combination of -c and -t. I'd imagine that is what Linus would want to use, e.g.

> There's some trickiness for the history of commits thing for stopping at
> the point where you have everything, but also behaving appropriately if
> you try once, fail partway through, and then try again. It's on my queue
> of things to think about.

Can't you just stop the recursion when you hit a commit you already have?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 20 of 37 in “[0/5] Patch set for various things”
  1. Daniel BarkalowApr 17, 2005
  2. 1/5 Parsing code in revision.hDaniel Barkalow, Apr 17, 2005
  3. Petr BaudisApr 17, 2005
  4. Daniel BarkalowApr 17, 2005
  5. Linus TorvaldsApr 17, 2005
  6. Petr BaudisApr 17, 2005
  7. Linus TorvaldsApr 17, 2005
  8. Daniel BarkalowApr 17, 2005
  9. Linus TorvaldsApr 17, 2005
  10. Daniel BarkalowApr 17, 2005
  11. 2/5 Add merge-baseDaniel Barkalow, Apr 17, 2005
  12. Petr BaudisApr 17, 2005
  13. Daniel BarkalowApr 17, 2005
  14. 1/5 Add merge-baseDaniel Barkalow, Apr 17, 2005
  15. Petr BaudisApr 17, 2005
  16. Daniel BarkalowApr 17, 2005
  17. 3/5 Add http-pullDaniel Barkalow, Apr 17, 2005
  18. Petr BaudisApr 17, 2005
  19. Daniel BarkalowApr 17, 2005
  20. Petr BaudisApr 17, 2005
  21. Daniel BarkalowApr 17, 2005
  22. Petr BaudisApr 17, 2005
  23. Brad RobertsApr 21, 2005
  24. Daniel BarkalowApr 21, 2005
  25. tony.luck@intel.comApr 21, 2005
  26. Daniel BarkalowApr 22, 2005
  27. Petr BaudisApr 22, 2005
  28. Daniel BarkalowApr 22, 2005
  29. Petr BaudisApr 22, 2005
  30. Daniel BarkalowApr 22, 2005
  31. Martin SchlemmerApr 22, 2005
  32. 1/5 Add http-pullDaniel Barkalow, Apr 17, 2005
  33. 4/5 Add option for hardlinkable cache of extracted blobsDaniel Barkalow, Apr 17, 2005
  34. Petr BaudisApr 17, 2005
  35. Daniel BarkalowApr 17, 2005
  36. Paul JacksonApr 17, 2005
  37. 5/5 Add commit-id to versionDaniel Barkalow, Apr 17, 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.