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

Re: [RFC] Build in clone

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 26, 2008, 17:36 UTC
Message-ID
<alpine.LNX.1.00.0802261128360.19024@iabervon.org>
In-Reply-To
<200802260321.14038.johan@herland.net>
On Tue, 26 Feb 2008, Johan Herland wrote:
Show 5 quoted lines
> Other than the failing tests, it seems to work fairly well. I've been
> playing around with it for a few minutes, and on a test repo I have with
> 1001 branches and 10000 tags, it cuts down the runtime of a local git-clone
> from 25 seconds to ~1.5 seconds. (simply by eliminating the overhead of
> invoking git-update-ref for every single ref) :)

Good to hear. A certain amount of the point is performance, and I've only got relatively simple repositories on Linux to test with, where everything is too fast to tell anyway.

Show 5 quoted lines
> I've tried to test this by diffing a cloned repo against an equivalent
> clone done by the old script. Below I pasted in a few immediate fixes I
> found. With these fixes, the only remaining diff between the clones is
> that refs/remotes/origin/HEAD used to be a symbolic ref (with no reflog),
> but is now a "regular" ref (with reflog).

I think that's just a call to the wrong function (and a lack of very very explicit documentation).

> The fixes are, in order of importance:
> - Call git_config(git_default_config) in order to properly set up
>   user.name and user.email for reflogs (This BREAKS test #9 in
>   t1020-subdirectory.sh. Have yet to figure out why)

I should have read email last night; I could have identified a bunch of the odd errors for you, but you've figured most of them out by now.

I need to look into the config system further; things should be configured such that the local config is in the new directory and the global config is unchanged. If no environment variable is set and pwd is a certain way, git_config_set() will write to the wrong file.

> - Fix "clone from $repo" reflog messages (using strbufs; something tells
>   me more of this code would benefit from using strbufs)

Most likely. I think Kristian wrote most of this before strbuf existed or something of the sort.

> - Høgsberg's name should be in UTF-8 (not sure if this will survive this
>   mail)

It is for me; I bet it didn't survive the mail from me to you. (That is, your mailer got my UTF-8 message and converted it to Latin-1 on export, and so applying it gave a Latin-1 ø in your tree, which you changed to UTF-8, and then your mailer again thought your patch was changing one Latin-1 character to two, and sent the patch like that.)

> - The two whitespace errors you mentioned
> 
> I'm sorry that my patch below sucks from a style POV. Feel free to ignore.
> Will redo when it's not in the middle of the night.

I haven't gotten to the level of style in this code myself, so no worries there. :) And whitespace noise is welcome at this point, since I'm still incorporating changes and evaluating the resulting state, instead of evaluating the changes themselves.

	-Daniel
*This .sig left intentionally blank*
Previous: Daniel BarkalowNext: Kristian Høgsberg
Message 23 of 47 in “[RFC] Build in clone”
  1. Daniel BarkalowFeb 25, 2008
  2. Johan HerlandFeb 26, 2008
  3. Johannes SchindelinFeb 26, 2008
  4. Johan HerlandFeb 26, 2008
  5. Johan HerlandFeb 26, 2008
  6. Johan HerlandFeb 26, 2008
  7. Fix premature free of ref_lists while writing temporary refs to fileJohan Herland, Feb 26, 2008
  8. Johannes SchindelinFeb 26, 2008
  9. Johan HerlandFeb 26, 2008
  10. Daniel BarkalowFeb 26, 2008
  11. Johan HerlandFeb 26, 2008
  12. Fix premature call to git_config() causing t1020-subdirectory to failJohan Herland, Feb 26, 2008
  13. Johannes SchindelinFeb 26, 2008
  14. Daniel BarkalowFeb 26, 2008
  15. Johannes SchindelinFeb 26, 2008
  16. Daniel BarkalowFeb 26, 2008
  17. Junio C HamanoFeb 27, 2008
  18. Daniel BarkalowFeb 27, 2008
  19. Junio C HamanoFeb 27, 2008
  20. Daniel BarkalowFeb 27, 2008
  21. Junio C HamanoFeb 27, 2008
  22. Daniel BarkalowFeb 27, 2008
  23. Daniel BarkalowFeb 26, 2008
  24. Kristian HøgsbergFeb 26, 2008
  25. builtin-clone: create remotes/origin/HEAD symref, if guessedJohannes Schindelin, Mar 2, 2008
  26. builtin-clone: create remotes/origin/HEAD symref, if guessedJohannes Schindelin, Mar 2, 2008
  27. builtin clone: support bundlesJohannes Schindelin, Mar 2, 2008
  28. Daniel BarkalowMar 2, 2008
  29. Santi BéjarMar 3, 2008
  30. Daniel BarkalowMar 2, 2008
  31. Johannes SchindelinMar 2, 2008
  32. Junio C HamanoMar 2, 2008
  33. Junio C HamanoMar 2, 2008
  34. Add test for cloning with "--reference" repo being a subset of source repoJohan Herland, Mar 3, 2008
  35. Daniel BarkalowMar 3, 2008
  36. Daniel BarkalowMar 3, 2008
  37. Johan HerlandMar 4, 2008
  38. 1/2 Add test illustrating issues with sha1_file_name() and switching reposJohan Herland, Mar 4, 2008
  39. 2/2 Overly simplistic fix for issue with sha1_file_name() and switching reposJohan Herland, Mar 4, 2008
  40. Daniel BarkalowMar 4, 2008
  41. Daniel BarkalowMar 5, 2008
  42. Johan HerlandMar 5, 2008
  43. Kristian HøgsbergMar 3, 2008
  44. Pierre HabouzitMar 3, 2008
  45. Johannes SchindelinMar 3, 2008
  46. Johannes SchindelinMar 3, 2008
  47. Johan HerlandMar 3, 2008

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.