<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin-pack-objects.c, branch v1.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-04-23T02:02:12Z</updated>
<entry>
<title>Fix typos / spelling in comments</title>
<updated>2009-04-23T02:02:12Z</updated>
<author>
<name>Mike Ralphson</name>
<email>mike@abacus.co.uk</email>
</author>
<published>2009-04-17T18:13:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ea3c215c02dc4a4e7d0881c25b2223540960797'/>
<id>urn:sha1:3ea3c215c02dc4a4e7d0881c25b2223540960797</id>
<content type='text'>
Signed-off-by: Mike Ralphson &lt;mike@abacus.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lt/pack-object-memuse'</title>
<updated>2009-04-18T21:46:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-18T21:46:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9824a388e53ba0951e38f246038fa0ef6fda3397'/>
<id>urn:sha1:9824a388e53ba0951e38f246038fa0ef6fda3397</id>
<content type='text'>
* lt/pack-object-memuse:
  show_object(): push path_name() call further down
  process_{tree,blob}: show objects without buffering

Conflicts:
	builtin-pack-objects.c
	builtin-rev-list.c
	list-objects.c
	list-objects.h
	upload-pack.c
</content>
</entry>
<entry>
<title>show_object(): push path_name() call further down</title>
<updated>2009-04-13T00:28:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-04-11T01:15:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf2ab916afa4231f7e9db31796e7c0f712ff6ad1'/>
<id>urn:sha1:cf2ab916afa4231f7e9db31796e7c0f712ff6ad1</id>
<content type='text'>
In particular, pushing the "path_name()" call _into_ the show() function
would seem to allow

 - more clarity into who "owns" the name (ie now when we free the name in
   the show_object callback, it's because we generated it ourselves by
   calling path_name())

 - not calling path_name() at all, either because we don't care about the
   name in the first place, or because we are actually happy walking the
   linked list of "struct name_path *" and the last component.

Now, I didn't do that latter optimization, because it would require some
more coding, but especially looking at "builtin-pack-objects.c", we really
don't even want the whole pathname, we really would be better off with the
list of path components.

Why? We use that name for two things:
 - add_preferred_base_object(), which actually _wants_ to traverse the
   path, and now does it by looking for '/' characters!
 - for 'name_hash()', which only cares about the last 16 characters of a
   name, so again, generating the full name seems to be just unnecessary
   work.

Anyway, so I didn't look any closer at those things, but it did convince
me that the "show_object()" calling convention was crazy, and we're
actually better off doing _less_ in list-objects.c, and giving people
access to the internal data structures so that they can decide whether
they want to generate a path-name or not.

This patch does that, and then for people who did use the name (even if
they might do something more clever in the future), it just does the
straightforward "name = path_name(path, component); .. free(name);" thing.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>process_{tree,blob}: show objects without buffering</title>
<updated>2009-04-13T00:28:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-04-11T00:27:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d2dfc49b199c7da6faefd7993630f24bd37fee0'/>
<id>urn:sha1:8d2dfc49b199c7da6faefd7993630f24bd37fee0</id>
<content type='text'>
Here's a less trivial thing, and slightly more dubious one.

I was looking at that "struct object_array objects", and wondering why we
do that. I have honestly totally forgotten. Why not just call the "show()"
function as we encounter the objects? Rather than add the objects to the
object_array, and then at the very end going through the array and doing a
'show' on all, just do things more incrementally.

Now, there are possible downsides to this:

 - the "buffer using object_array" _can_ in theory result in at least
   better I-cache usage (two tight loops rather than one more spread out
   one). I don't think this is a real issue, but in theory..

 - this _does_ change the order of the objects printed. Instead of doing a
   "process_tree(revs, commit-&gt;tree, &amp;objects, NULL, "");" in the loop
   over the commits (which puts all the root trees _first_ in the object
   list, this patch just adds them to the list of pending objects, and
   then we'll traverse them in that order (and thus show each root tree
   object together with the objects we discover under it)

   I _think_ the new ordering actually makes more sense, but the object
   ordering is actually a subtle thing when it comes to packing
   efficiency, so any change in order is going to have implications for
   packing. Good or bad, I dunno.

 - There may be some reason why we did it that odd way with the object
   array, that I have simply forgotten.

Anyway, now that we don't buffer up the objects before showing them
that may actually result in lower memory usage during that whole
traverse_commit_list() phase.

This is seriously not very deeply tested. It makes sense to me, it seems
to pass all the tests, it looks ok, but...

Does anybody remember why we did that "object_array" thing? It used to be
an "object_list" a long long time ago, but got changed into the array due
to better memory usage patterns (those linked lists of obejcts are
horrible from a memory allocation standpoint). But I wonder why we didn't
do this back then. Maybe there's a reason for it.

Or maybe there _used_ to be a reason, and no longer is.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/bisect-filter'</title>
<updated>2009-04-12T23:46:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-12T23:46:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e353a5e5de9da021c7c6c0bc2dc5f95a39900a1'/>
<id>urn:sha1:6e353a5e5de9da021c7c6c0bc2dc5f95a39900a1</id>
<content type='text'>
* cc/bisect-filter: (21 commits)
  rev-list: add "int bisect_show_flags" in "struct rev_list_info"
  rev-list: remove last static vars used in "show_commit"
  list-objects: add "void *data" parameter to show functions
  bisect--helper: string output variables together with "&amp;&amp;"
  rev-list: pass "int flags" as last argument of "show_bisect_vars"
  t6030: test bisecting with paths
  bisect: use "bisect--helper" and remove "filter_skipped" function
  bisect: implement "read_bisect_paths" to read paths in "$GIT_DIR/BISECT_NAMES"
  bisect--helper: implement "git bisect--helper"
  bisect: use the new generic "sha1_pos" function to lookup sha1
  rev-list: call new "filter_skip" function
  patch-ids: use the new generic "sha1_pos" function to lookup sha1
  sha1-lookup: add new "sha1_pos" function to efficiently lookup sha1
  rev-list: pass "revs" to "show_bisect_vars"
  rev-list: make "show_bisect_vars" non static
  rev-list: move code to show bisect vars into its own function
  rev-list: move bisect related code into its own file
  rev-list: make "bisect_list" variable local to "cmd_rev_list"
  refs: add "for_each_ref_in" function to refactor "for_each_*_ref" functions
  quote: add "sq_dequote_to_argv" to put unwrapped args in an argv array
  ...
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2009-04-12T23:01:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-12T23:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a54c4edc511608fdba513cc94812c31fd4b497f6'/>
<id>urn:sha1:a54c4edc511608fdba513cc94812c31fd4b497f6</id>
<content type='text'>
* maint:
  GIT 1.6.2.3
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls

Conflicts:
	GIT-VERSION-GEN
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.6.1' into maint</title>
<updated>2009-04-12T22:34:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-12T22:34:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1966af81760aea2966f8f218d442aed5f296b992'/>
<id>urn:sha1:1966af81760aea2966f8f218d442aed5f296b992</id>
<content type='text'>
* maint-1.6.1:
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls
</content>
</entry>
<entry>
<title>Merge branch 'maint-1.6.0' into maint-1.6.1</title>
<updated>2009-04-12T22:20:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-04-12T22:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bc69776aa12c68958e381e8c24e8faa172dde2d8'/>
<id>urn:sha1:bc69776aa12c68958e381e8c24e8faa172dde2d8</id>
<content type='text'>
* maint-1.6.0:
  State the effect of filter-branch on graft explicitly
  process_{tree,blob}: Remove useless xstrdup calls
</content>
</entry>
<entry>
<title>process_{tree,blob}: Remove useless xstrdup calls</title>
<updated>2009-04-12T21:30:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-04-10T22:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=213152688c85a0e4d591abc1c10b7c279ffefb99'/>
<id>urn:sha1:213152688c85a0e4d591abc1c10b7c279ffefb99</id>
<content type='text'>
On Wed, 8 Apr 2009, Björn Steinbrink wrote:
&gt;
&gt; The name of the processed object was duplicated for passing it to
&gt; add_object(), but that already calls path_name, which allocates a new
&gt; string anyway. So the memory allocated by the xstrdup calls just went
&gt; nowhere, leaking memory.

Ack, ack.

There's another easy 5% or so for the built-in object walker: once we've
created the hash from the name, the name isn't interesting any more, and
so something trivial like this can help a bit.

Does it matter? Probably not on its own. But a few more memory saving
tricks and it might all make a difference.

		Linus

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Update delta compression message to be less misleading</title>
<updated>2009-04-12T05:21:59Z</updated>
<author>
<name>Dan McGee</name>
<email>dpmcgee@gmail.com</email>
</author>
<published>2009-04-09T15:45:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6c29915d2efd0d2cb56eca88bd8e6b4999546dc'/>
<id>urn:sha1:b6c29915d2efd0d2cb56eca88bd8e6b4999546dc</id>
<content type='text'>
In the case of a small repository, pack-objects is smart enough to not
start more threads than necessary. However, the output to the user always
reports the value of the pack.threads configuration and not the real
number of threads to be used.

Signed-off-by: Dan McGee &lt;dpmcgee@gmail.com&gt;
Acked-by: Nicolas Pitre &lt;nico@cam.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
