<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.c, branch v2.1.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.1.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.1.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-07-27T22:14:18Z</updated>
<entry>
<title>Merge branch 'cc/replace-graft'</title>
<updated>2014-07-27T22:14:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-27T22:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16737445a94cb9b18378fff973129d974c7cdf8a'/>
<id>urn:sha1:16737445a94cb9b18378fff973129d974c7cdf8a</id>
<content type='text'>
"git replace" learned a "--graft" option to rewrite parents of a
commit.

* cc/replace-graft:
  replace: add test for --graft with a mergetag
  replace: check mergetags when using --graft
  replace: add test for --graft with signed commit
  replace: remove signature when using --graft
  contrib: add convert-grafts-to-replace-refs.sh
  Documentation: replace: add --graft option
  replace: add test for --graft
  replace: add --graft option
  replace: cleanup redirection style in tests
</content>
</entry>
<entry>
<title>Merge branch 'jk/stable-prio-queue'</title>
<updated>2014-07-27T22:14:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-27T22:14:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4799593e26f09e4209249caf9536001036618ac2'/>
<id>urn:sha1:4799593e26f09e4209249caf9536001036618ac2</id>
<content type='text'>
* jk/stable-prio-queue:
  t5539: update a flaky test
  paint_down_to_common: use prio_queue
  prio-queue: make output stable with respect to insertion
  prio-queue: factor out compare and swap operations
</content>
</entry>
<entry>
<title>Merge branch 'rs/code-cleaning'</title>
<updated>2014-07-22T17:59:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-22T17:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12621cb22224d1c2f507a643a578e386ee891c5c'/>
<id>urn:sha1:12621cb22224d1c2f507a643a578e386ee891c5c</id>
<content type='text'>
* rs/code-cleaning:
  remote-testsvn: use internal argv_array of struct child_process in cmd_import()
  bundle: use internal argv_array of struct child_process in create_bundle()
  fast-import: use hashcmp() for SHA1 hash comparison
  transport: simplify fetch_objs_via_rsync() using argv_array
  run-command: use internal argv_array of struct child_process in run_hook_ve()
  use commit_list_count() to count the members of commit_lists
  strbuf: use strbuf_addstr() for adding C strings
</content>
</entry>
<entry>
<title>Merge branch 'jk/alloc-commit-id'</title>
<updated>2014-07-22T17:59:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-22T17:59:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=10b944b37b11d6e0597541efdd1fa23c0eecbeff'/>
<id>urn:sha1:10b944b37b11d6e0597541efdd1fa23c0eecbeff</id>
<content type='text'>
Make sure all in-core commit objects are assigned a unique number
so that they can be annotated using the commit-slab API.

* jk/alloc-commit-id:
  diff-tree: avoid lookup_unknown_object
  object_as_type: set commit index
  alloc: factor out commit index
  add object_as_type helper for casting objects
  parse_object_buffer: do not set object type
  move setting of object-&gt;type to alloc_* functions
  alloc: write out allocator definitions
  alloc.c: remove the alloc_raw_commit_node() function
</content>
</entry>
<entry>
<title>replace: remove signature when using --graft</title>
<updated>2014-07-21T19:05:58Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2014-07-19T15:01:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b05ab6f1bfa045f460ad5c40d87ef8c2965bf56'/>
<id>urn:sha1:0b05ab6f1bfa045f460ad5c40d87ef8c2965bf56</id>
<content type='text'>
It could be misleading to keep a signature in a
replacement commit, so let's remove it.

Note that there should probably be a way to sign
the replacement commit created when using --graft,
but this can be dealt with in another commit or
patch series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/for-each-mergetag'</title>
<updated>2014-07-21T18:17:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-21T18:17:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dadb89d92ce9c81846c1b4c743a41b6e845b572c'/>
<id>urn:sha1:dadb89d92ce9c81846c1b4c743a41b6e845b572c</id>
<content type='text'>
* cc/for-each-mergetag:
  commit: add for_each_mergetag()
</content>
</entry>
<entry>
<title>use commit_list_count() to count the members of commit_lists</title>
<updated>2014-07-17T20:36:25Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-07-16T23:52:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4bbaa1eb6fb4a520069e53ec5afa977a316a5d36'/>
<id>urn:sha1:4bbaa1eb6fb4a520069e53ec5afa977a316a5d36</id>
<content type='text'>
Call commit_list_count() instead of open-coding it repeatedly.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/code-cleaning'</title>
<updated>2014-07-16T18:33:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-16T18:33:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fc83452c76e65385b3da69ea94eb957e36e6c78'/>
<id>urn:sha1:1fc83452c76e65385b3da69ea94eb957e36e6c78</id>
<content type='text'>
* rs/code-cleaning:
  fsck: simplify fsck_commit_buffer() by using commit_list_count()
  commit: use commit_list_append() instead of duplicating its code
  merge: simplify merge_trivial() by using commit_list_append()
  use strbuf_addch for adding single characters
  use strbuf_addbuf for adding strbufs
</content>
</entry>
<entry>
<title>paint_down_to_common: use prio_queue</title>
<updated>2014-07-15T18:02:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-07-14T05:53:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=73f43f220f0276012de50c84413fd61bf6aa307b'/>
<id>urn:sha1:73f43f220f0276012de50c84413fd61bf6aa307b</id>
<content type='text'>
When we are traversing to find merge bases, we keep our
usual commit_list of commits to process, sorted by their
commit timestamp. As we add each parent to the list, we have
to spend "O(width of history)" to do the insertion, where
the width of history is the number of simultaneous lines of
development.

If we instead use a heap-based priority queue, we can do
these insertions in "O(log width)" time. This provides minor
speedups to merge-base calculations (timings in linux.git,
warm cache, best-of-five):

  [before]
  $ git merge-base HEAD v2.6.12
  real    0m3.251s
  user    0m3.148s
  sys     0m0.104s

  [after]
  $ git merge-base HEAD v2.6.12
  real    0m3.234s
  user    0m3.108s
  sys     0m0.128s

That's only an 0.5% speedup, but it does help protect us
against pathological cases.

While we are munging the "interesting" function, we also
take the opportunity to give it a more descriptive name, and
convert the return value to an int (we returned the first
interesting commit, but nobody ever looked at it).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add object_as_type helper for casting objects</title>
<updated>2014-07-14T01:59:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-07-13T06:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ff226a9d5ee065fe52752e6032f63cb6e4beccb'/>
<id>urn:sha1:8ff226a9d5ee065fe52752e6032f63cb6e4beccb</id>
<content type='text'>
When we call lookup_commit, lookup_tree, etc, the logic goes
something like:

  1. Look for an existing object struct. If we don't have
     one, allocate and return a new one.

  2. Double check that any object we have is the expected
     type (and complain and return NULL otherwise).

  3. Convert an object with type OBJ_NONE (from a prior
     call to lookup_unknown_object) to the expected type.

We can encapsulate steps 2 and 3 in a helper function which
checks whether we have the expected object type, converts
OBJ_NONE as appropriate, and returns the object.

Not only does this shorten the code, but it also provides
one central location for converting OBJ_NONE objects into
objects of other types. Future patches will use that to
enforce type-specific invariants.

Since this is a refactoring, we would want it to behave
exactly as the current code. It takes a little reasoning to
see that this is the case:

  - for lookup_{commit,tree,etc} functions, we are just
    pulling steps 2 and 3 into a function that does the same
    thing.

  - for the call in peel_object, we currently only do step 3
    (but we want to consolidate it with the others, as
    mentioned above). However, step 2 is a noop here, as the
    surrounding conditional makes sure we have OBJ_NONE
    (which we want to keep to avoid an extraneous call to
    sha1_object_info).

  - for the call in lookup_commit_reference_gently, we are
    currently doing step 2 but not step 3. However, step 3
    is a noop here. The object we got will have just come
    from deref_tag, which must have figured out the type for
    each object in order to know when to stop peeling.
    Therefore the type will never be OBJ_NONE.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
