<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/git.git, branch jh/empty-notes</title>
<subtitle>github.com: git/git.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/'/>
<entry>
<title>Fix unclosed here document in t3301.sh</title>
<updated>2015-01-22T20:23:42+00:00</updated>
<author>
<name>Kacper Kornet</name>
<email>draenog@pld-linux.org</email>
</author>
<published>2015-01-22T11:59:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=85cb1d0ba883627f38ad994aa489bf0b3dc40f7f'/>
<id>85cb1d0ba883627f38ad994aa489bf0b3dc40f7f</id>
<content type='text'>
Commit 908a3203632a02568df230c0fccf9a2cd8da24e6 introduced  indentation
to here documents in t3301.sh. However in one place &lt;&lt;-EOF was missing
-, which broke this test when run with mksh-50d. This commit fixes it.

Signed-off-by: Kacper Kornet &lt;draenog@pld-linux.org&gt;
Acked-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 908a3203632a02568df230c0fccf9a2cd8da24e6 introduced  indentation
to here documents in t3301.sh. However in one place &lt;&lt;-EOF was missing
-, which broke this test when run with mksh-50d. This commit fixes it.

Signed-off-by: Kacper Kornet &lt;draenog@pld-linux.org&gt;
Acked-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>t3301: modernize style</title>
<updated>2014-11-14T21:33:09+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=908a3203632a02568df230c0fccf9a2cd8da24e6'/>
<id>908a3203632a02568df230c0fccf9a2cd8da24e6</id>
<content type='text'>
Make this test script appear somewhat less old-fashioned:

 - Use test helper functions:
    - write_script
    - test_commit
    - test_write_lines
    - test_line_count
    - test_config
    - test_unconfig
    - test_path_is_missing

 - Remove whitespace between redirection operators and their targets.

 - Move preparation of "expect" files into tests.

 - Rename "output" files to "actual".

 - More consistent quoting, especially around commands that might
   expand to nothing.

 - More visibility of important whitespace with ${indent}.

 - Combine pairs of tests that unnecessarily split setup and verification.

Improved-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Improved-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Improved-by: Michael Blume &lt;blume.mike@gmail.com&gt;
Improved-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make this test script appear somewhat less old-fashioned:

 - Use test helper functions:
    - write_script
    - test_commit
    - test_write_lines
    - test_line_count
    - test_config
    - test_unconfig
    - test_path_is_missing

 - Remove whitespace between redirection operators and their targets.

 - Move preparation of "expect" files into tests.

 - Rename "output" files to "actual".

 - More consistent quoting, especially around commands that might
   expand to nothing.

 - More visibility of important whitespace with ${indent}.

 - Combine pairs of tests that unnecessarily split setup and verification.

Improved-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Improved-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Improved-by: Michael Blume &lt;blume.mike@gmail.com&gt;
Improved-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>notes: empty notes should be shown by 'git log'</title>
<updated>2014-11-12T19:00:22+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=8a4acd699536c518c9245714d6175aa39d13eb9d'/>
<id>8a4acd699536c518c9245714d6175aa39d13eb9d</id>
<content type='text'>
If the user has gone through the trouble of explicitly adding an empty
note, then "git log" should not silently skip it (as if it didn't exist).

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the user has gone through the trouble of explicitly adding an empty
note, then "git log" should not silently skip it (as if it didn't exist).

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: add --allow-empty, to allow storing empty notes</title>
<updated>2014-11-12T19:00:11+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=d73a5b933db1e722faa54d6709e89e2450d7c1e3'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: split create_note() to clarify add vs. remove logic</title>
<updated>2014-11-12T18:59:50+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=52694cdabbf68f19c8289416e7bb3bbef41d8d27'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: simplify early exit code in add()</title>
<updated>2014-11-12T18:58:09+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=b0de56c6a5bb41da71babafefc9207b0fc211d66'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: refactor note file path into struct note_data</title>
<updated>2014-11-10T20:08:21+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=4282af0fc91e7a2667f8cba7282a5b70347f6e6f'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: improve naming</title>
<updated>2014-11-10T20:08:21+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=bebf5c04767b3c67dadfa8b65e6f0ceb258f6b83'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>t3301: verify that 'git notes' removes empty notes by default</title>
<updated>2014-11-10T20:08:21+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=d0923b6d4c01e3c5b86d56b1741292eda7c181fe'/>
<id>d0923b6d4c01e3c5b86d56b1741292eda7c181fe</id>
<content type='text'>
Add test cases documenting the current behavior when trying to
add/append/edit empty notes. This is in preparation for adding
--allow-empty; to allow empty notes to be stored.

Improved-by: Eric Sunshine &lt;sunshine@sunshineco.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add test cases documenting the current behavior when trying to
add/append/edit empty notes. This is in preparation for adding
--allow-empty; to allow empty notes to be stored.

Improved-by: Eric Sunshine &lt;sunshine@sunshineco.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;
</pre>
</div>
</content>
</entry>
<entry>
<title>builtin/notes: fix premature failure when trying to add the empty blob</title>
<updated>2014-11-10T20:08:20+00:00</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-09T12:30:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/git.git/commit/?id=511726e4b191ad76e7b4875d8f2361b05d5cfb39'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
