<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/notes-utils.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-06-11T20:15:07Z</updated>
<entry>
<title>commit: fix leaking parents when calling `commit_tree_extended()`</title>
<updated>2024-06-11T20:15:07Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-06-11T09:20:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63c9bd372e388f5fed77be56771d5ad972f37f8e'/>
<id>urn:sha1:63c9bd372e388f5fed77be56771d5ad972f37f8e</id>
<content type='text'>
When creating commits via `commit_tree_extended()`, the caller passes in
a string list of parents. This call implicitly transfers ownership of
that list to the function, which is quite surprising to begin with. But
to make matters worse, `commit_tree_extended()` doesn't even bother to
free the list of parents in error cases. The result is a memory leak,
and one that the caller cannot fix by themselves because they do not
know whether parts of the string list have already been released.

Refactor the code such that callers can keep ownership of the list of
parents, which is getting indicated by parameter being a constant
pointer now. Free the lists at the calling site and add a common exit
path to those sites as required.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes-utils.c: remove the_repository references</title>
<updated>2019-01-14T20:13:04Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-12T02:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1d18d7581cf1ce45314b7ed58e52d5cc73b2e7a7'/>
<id>urn:sha1:1d18d7581cf1ce45314b7ed58e52d5cc73b2e7a7</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add missing includes and forward declarations</title>
<updated>2018-08-15T18:52:09Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2018-08-15T17:54:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef3ca95475ce467ae883cc8175ed40e6f7d27800'/>
<id>urn:sha1:ef3ca95475ce467ae883cc8175ed40e6f7d27800</id>
<content type='text'>
I looped over the toplevel header files, creating a temporary two-line C
program for each consisting of
  #include "git-compat-util.h"
  #include $HEADER
This patch is the result of manually fixing errors in compiling those
tiny programs.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: convert commit_tree* to object_id</title>
<updated>2018-01-30T18:42:36Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2018-01-28T00:13:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5078f344591ee3c454e64ff73e6563f0a3f14950'/>
<id>urn:sha1:5078f344591ee3c454e64ff73e6563f0a3f14950</id>
<content type='text'>
Convert the definitions and declarations of commit_tree and
commit_tree_extended to use struct object_id and adjust all usages of
these functions.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: convert to struct object_id</title>
<updated>2017-06-02T00:36:06Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-05-30T17:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb7e4739712e3f9eee0dfd60088b6d8983067960'/>
<id>urn:sha1:bb7e4739712e3f9eee0dfd60088b6d8983067960</id>
<content type='text'>
Convert most of the static functions to use struct object_id.  In
addition, convert copy_notes_for_rewrite and its callers.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes: extract parse_notes_merge_strategy to notes-utils</title>
<updated>2015-08-17T22:38:32Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2015-08-17T21:33:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93efcad31777142840eaefc19b71d1a4b6a2fe24'/>
<id>urn:sha1:93efcad31777142840eaefc19b71d1a4b6a2fe24</id>
<content type='text'>
Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes: extract enum notes_merge_strategy to notes-utils.h</title>
<updated>2015-08-17T22:36:23Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2015-08-17T21:33:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d03dd18f0860d4052fab5ce7779e4bba302e5fc'/>
<id>urn:sha1:4d03dd18f0860d4052fab5ce7779e4bba302e5fc</id>
<content type='text'>
A future patch will extract parsing of the --strategy string into a
helper function in notes.c and will require the enumeration definition.

Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit_tree: take a pointer/len pair rather than a const strbuf</title>
<updated>2014-06-12T17:29:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-10T21:36:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ffefb54c0515308ceafb6ba071567d9fd379498'/>
<id>urn:sha1:3ffefb54c0515308ceafb6ba071567d9fd379498</id>
<content type='text'>
While strbufs are pretty common throughout our code, it is
more flexible for functions to take a pointer/len pair than
a strbuf. It's easy to turn a strbuf into such a pair (by
dereferencing its members), but less easy to go the other
way (you can strbuf_attach, but that has implications about
memory ownership).

This patch teaches commit_tree (and its associated callers
and sub-functions) to take such a pair for the commit
message rather than a strbuf.  This makes passing the buffer
around slightly more verbose, but means we can get rid of
some dangerous strbuf_attach calls in the next patch.

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>typofix: commit is spelled with two ems</title>
<updated>2013-09-04T22:30:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-04T22:28:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a316b954efb6d55f83c3950cfc2c7bbe356b5037'/>
<id>urn:sha1:a316b954efb6d55f83c3950cfc2c7bbe356b5037</id>
<content type='text'>
There are a handful of instances where we say commmit when we mean
commit.  Fix them.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Move create_notes_commit() from notes-merge.c into notes-utils.c</title>
<updated>2013-06-12T17:38:13Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2013-06-12T00:13:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf9a05ba46a9d464424d22482aaa54abdd28b77d'/>
<id>urn:sha1:bf9a05ba46a9d464424d22482aaa54abdd28b77d</id>
<content type='text'>
create_notes_commit() is needed by both the notes-merge code, and by
commit_notes() in notes-utils. Since it is generally useful, and not
bound to the notes-merge machinery, we move it from (the more specific)
notes-merge to (the more general) notes-utils.

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
