<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/notes.c, branch v2.3.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.7</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-11-12T19:00:11Z</updated>
<entry>
<title>builtin/notes: add --allow-empty, to allow storing empty notes</title>
<updated>2014-11-12T19:00:11Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d73a5b933db1e722faa54d6709e89e2450d7c1e3'/>
<id>urn:sha1:d73a5b933db1e722faa54d6709e89e2450d7c1e3</id>
<content type='text'>
Although the "git notes" man page advertises that we support binary-safe
notes addition (using the -C option), we currently do not support adding
the empty note (i.e. using the empty blob to annotate an object). Instead,
an empty note is always treated as an intent to remove the note
altogether.

Introduce the --allow-empty option to the add/append/edit subcommands,
to explicitly allow an empty note to be stored into the notes tree.

Also update the documentation, and add test cases for the new option.

Reported-by: James H. Fisher &lt;jhf@trifork.com&gt;
Improved-by: Kyle J. McKay &lt;mackyle@gmail.com&gt;
Improved-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: split create_note() to clarify add vs. remove logic</title>
<updated>2014-11-12T18:59:50Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52694cdabbf68f19c8289416e7bb3bbef41d8d27'/>
<id>urn:sha1:52694cdabbf68f19c8289416e7bb3bbef41d8d27</id>
<content type='text'>
create_note() has a non-trivial interface, and comprises three loosely
related parts:

 1. launching the editor with the note contents, if needed
 2. appending to an existing note, if append_only was given
 3. adding or removing the resulting note, based on whether it's non-empty

Split it along those lines to make the logic clearer: The first part
goes into a new function - prepare_note_data(), with a simpler interface.
The second part is moved into append_edit(), which is the only user of
this code. Finally, the add vs. remove decision is moved into the callers
(add() and append_edit()), keeping the logic for writing the actual note
object in a separate function: write_note_data().

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: simplify early exit code in add()</title>
<updated>2014-11-12T18:58:09Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0de56c6a5bb41da71babafefc9207b0fc211d66'/>
<id>urn:sha1:b0de56c6a5bb41da71babafefc9207b0fc211d66</id>
<content type='text'>
Remove the need for 'retval' and the unnecessary goto. Also reorganize
to only call free_note_data() is actually needed.

Improved-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: refactor note file path into struct note_data</title>
<updated>2014-11-10T20:08:21Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4282af0fc91e7a2667f8cba7282a5b70347f6e6f'/>
<id>urn:sha1:4282af0fc91e7a2667f8cba7282a5b70347f6e6f</id>
<content type='text'>
Move the 'path' variable from create_note() and into the
note_data struct. Unify cleanup of note_data objects with
a free_note_data() function.

This might not make too much sense on its own, but it makes the
future refactoring of create_note() considerably cleaner.

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: improve naming</title>
<updated>2014-11-10T20:08:21Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bebf5c04767b3c67dadfa8b65e6f0ceb258f6b83'/>
<id>urn:sha1:bebf5c04767b3c67dadfa8b65e6f0ceb258f6b83</id>
<content type='text'>
In preparation for some needed refactoring, rename struct msg_arg to
struct note_data, and rename its instances from "msg" to "d" (also
removing some unnecessary parentheses). The 'msg_arg' name was
inherited from tag.c, but is not really a good name for the contents
of a note.

Also rename write_note_data() to copy_obj_to_fd(), which more aptly
describes what it actually does: Copying the contents of a git object
(given by its SHA1) into a given file descriptor.

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/notes: fix premature failure when trying to add the empty blob</title>
<updated>2014-11-10T20:08:20Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=511726e4b191ad76e7b4875d8f2361b05d5cfb39'/>
<id>urn:sha1:511726e4b191ad76e7b4875d8f2361b05d5cfb39</id>
<content type='text'>
This fixes a small buglet when trying to explicitly add the empty blob
as a note object using the -c or -C option to git notes add/append.
Instead of failing with a nonsensical error message indicating that the
empty blob does not exist, we should rather behave as if an empty notes
message was given (e.g. using -m "" or -F /dev/null).

The next patch contains a test that verifies the fixed behavior.

Found-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs.c: change resolve_ref_unsafe reading argument to be a flags field</title>
<updated>2014-10-15T17:47:24Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>sahlberg@google.com</email>
</author>
<published>2014-07-15T19:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7695d118e5a3c9c6fcb4cb15eb766a1c57422aed'/>
<id>urn:sha1:7695d118e5a3c9c6fcb4cb15eb766a1c57422aed</id>
<content type='text'>
resolve_ref_unsafe takes a boolean argument for reading (a nonexistent ref
resolves successfully for writing but not for reading).  Change this to be
a flags field instead, and pass the new constant RESOLVE_REF_READING when
we want this behaviour.

While at it, swap two of the arguments in the function to put output
arguments at the end.  As a nice side effect, this ensures that we can
catch callers that were unaware of the new API so they can be audited.

Give the wrapper functions resolve_refdup and read_ref_full the same
treatment for consistency.

Signed-off-by: Ronnie Sahlberg &lt;sahlberg@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ah/grammofix'</title>
<updated>2014-09-19T18:38:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T18:38:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=296b4c4bbf63c8addb1654a05950843e9984d0eb'/>
<id>urn:sha1:296b4c4bbf63c8addb1654a05950843e9984d0eb</id>
<content type='text'>
* ah/grammofix:
  grammofix in user-facing messages
</content>
</entry>
<entry>
<title>grammofix in user-facing messages</title>
<updated>2014-09-02T19:00:30Z</updated>
<author>
<name>Alex Henrie</name>
<email>alexhenrie24@gmail.com</email>
</author>
<published>2014-08-30T19:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad5fe3771b50f3862130d150b5cc8bb316ef6f1c'/>
<id>urn:sha1:ad5fe3771b50f3862130d150b5cc8bb316ef6f1c</id>
<content type='text'>
Signed-off-by: Alex Henrie &lt;alexhenrie24@gmail.com&gt;
Acked-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: introduce CHILD_PROCESS_INIT</title>
<updated>2014-08-20T16:53:37Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-08-19T19:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3180279322c7450a47decf8833de47f444ca93f'/>
<id>urn:sha1:d3180279322c7450a47decf8833de47f444ca93f</id>
<content type='text'>
Most struct child_process variables are cleared using memset first after
declaration.  Provide a macro, CHILD_PROCESS_INIT, that can be used to
initialize them statically instead.  That's shorter, doesn't require a
function call and is slightly more readable (especially given that we
already have STRBUF_INIT, ARGV_ARRAY_INIT etc.).

Helped-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
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>
</feed>
