<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.h, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-04-20T04:37:13Z</updated>
<entry>
<title>Merge branch 'bc/object-id'</title>
<updated>2017-04-20T04:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-20T04:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1081e4004091947b6c6a806625addd1cbba61b7'/>
<id>urn:sha1:b1081e4004091947b6c6a806625addd1cbba61b7</id>
<content type='text'>
Conversion from unsigned char [40] to struct object_id continues.

* bc/object-id:
  Documentation: update and rename api-sha1-array.txt
  Rename sha1_array to oid_array
  Convert sha1_array_for_each_unique and for_each_abbrev to object_id
  Convert sha1_array_lookup to take struct object_id
  Convert remaining callers of sha1_array_lookup to object_id
  Make sha1_array_append take a struct object_id *
  sha1-array: convert internal storage for struct sha1_array to object_id
  builtin/pull: convert to struct object_id
  submodule: convert check_for_new_submodule_commits to object_id
  sha1_name: convert disambiguate_hint_fn to take object_id
  sha1_name: convert struct disambiguate_state to object_id
  test-sha1-array: convert most code to struct object_id
  parse-options-cb: convert sha1_array_append caller to struct object_id
  fsck: convert init_skiplist to struct object_id
  builtin/receive-pack: convert portions to struct object_id
  builtin/pull: convert portions to struct object_id
  builtin/diff: convert to struct object_id
  Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ
  Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ
  Define new hash-size constants for allocating memory
</content>
</entry>
<entry>
<title>Rename sha1_array to oid_array</title>
<updated>2017-03-31T15:33:56Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:40:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=910650d2f8755359ab7b1f0e2a2d576c06a68091'/>
<id>urn:sha1:910650d2f8755359ab7b1f0e2a2d576c06a68091</id>
<content type='text'>
Since this structure handles an array of object IDs, rename it to struct
oid_array.  Also rename the accessor functions and the initialization
constant.

This commit was produced mechanically by providing non-Documentation
files to the following Perl one-liners:

    perl -pi -E 's/struct sha1_array/struct oid_array/g'
    perl -pi -E 's/\bsha1_array_/oid_array_/g'
    perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g'

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: add --no-contains option to tag/branch/for-each-ref</title>
<updated>2017-03-24T19:15:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-03-24T18:40:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac3f5a346860b824e083c5d305757c3260565475'/>
<id>urn:sha1:ac3f5a346860b824e083c5d305757c3260565475</id>
<content type='text'>
Change the tag, branch &amp; for-each-ref commands to have a --no-contains
option in addition to their longstanding --contains options.

This allows for finding the last-good rollout tag given a known-bad
&lt;commit&gt;. Given a hypothetically bad commit cf5c7253e0, the git
version to revert to can be found with this hacky two-liner:

    (git tag -l 'v[0-9]*'; git tag -l --contains cf5c7253e0 'v[0-9]*') |
        sort | uniq -c | grep -E '^ *1 ' | awk '{print $2}' | tail -n 10

With this new --no-contains option the same can be achieved with:

    git tag -l --no-contains cf5c7253e0 'v[0-9]*' | sort | tail -n 10

As the filtering machinery is shared between the tag, branch &amp;
for-each-ref commands, implement this for those commands too. A
practical use for this with "branch" is e.g. finding branches which
were branched off between v2.8.0 and v2.10.0:

    git branch --contains v2.8.0 --no-contains v2.10.0

The "describe" command also has a --contains option, but its semantics
are unrelated to what tag/branch/for-each-ref use --contains for. A
--no-contains option for "describe" wouldn't make any sense, other
than being exactly equivalent to not supplying --contains at all,
which would be confusing at best.

Add a --without option to "tag" as an alias for --no-contains, for
consistency with --with and --contains.  The --with option is
undocumented, and possibly the only user of it is
Junio (&lt;xmqqefy71iej.fsf@gitster.mtv.corp.google.com&gt;). But it's
trivial to support, so let's do that.

The additions to the the test suite are inverse copies of the
corresponding --contains tests. With this change --no-contains for
tag, branch &amp; for-each-ref is just as well tested as the existing
--contains option.

In addition to those tests, add a test for "tag" which asserts that
--no-contains won't find tree/blob tags, which is slightly
unintuitive, but consistent with how --contains works &amp; is documented.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: move ref_cbdata definition into ref-filter.c</title>
<updated>2017-03-10T19:51:30Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-09T13:27:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4d4bc41411242028d5670f8f1b305fcd1a7671ad'/>
<id>urn:sha1:4d4bc41411242028d5670f8f1b305fcd1a7671ad</id>
<content type='text'>
This is an implementation detail of how filter_refs() works,
and does not need to be exposed to the outside world. This
will become more important in future patches as we add new
private data types to 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>Merge branch 'kn/ref-filter-branch-list'</title>
<updated>2017-02-27T21:57:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-02-27T21:57:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93e8cd8b6ee766b35bfd3913f56ba86d63cb6253'/>
<id>urn:sha1:93e8cd8b6ee766b35bfd3913f56ba86d63cb6253</id>
<content type='text'>
The code to list branches in "git branch" has been consolidated
with the more generic ref-filter API.

* kn/ref-filter-branch-list: (21 commits)
  ref-filter: resurrect "strip" as a synonym to "lstrip"
  branch: implement '--format' option
  branch: use ref-filter printing APIs
  branch, tag: use porcelain output
  ref-filter: allow porcelain to translate messages in the output
  ref-filter: add an 'rstrip=&lt;N&gt;' option to atoms which deal with refnames
  ref-filter: modify the 'lstrip=&lt;N&gt;' option to work with negative '&lt;N&gt;'
  ref-filter: Do not abruptly die when using the 'lstrip=&lt;N&gt;' option
  ref-filter: rename the 'strip' option to 'lstrip'
  ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
  ref-filter: introduce refname_atom_parser()
  ref-filter: introduce refname_atom_parser_internal()
  ref-filter: make "%(symref)" atom work with the ':short' modifier
  ref-filter: add support for %(upstream:track,nobracket)
  ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
  ref-filter: introduce format_ref_array_item()
  ref-filter: move get_head_description() from branch.c
  ref-filter: modify "%(objectname:short)" to take length
  ref-filter: implement %(if:equals=&lt;string&gt;) and %(if:notequals=&lt;string&gt;)
  ref-filter: include reference to 'used_atom' within 'atom_value'
  ...
</content>
</entry>
<entry>
<title>Merge branch 'st/verify-tag'</title>
<updated>2017-01-31T21:14:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-31T21:14:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=237bdd9ddbe52eb651787af1929d8832ce37c322'/>
<id>urn:sha1:237bdd9ddbe52eb651787af1929d8832ce37c322</id>
<content type='text'>
"git tag" and "git verify-tag" learned to put GPG verification
status in their "--format=&lt;placeholders&gt;" output format.

* st/verify-tag:
  t/t7004-tag: Add --format specifier tests
  t/t7030-verify-tag: Add --format specifier tests
  builtin/tag: add --format argument for tag -v
  builtin/verify-tag: add --format to verify-tag
  ref-filter: add function to print single ref_array_item
  gpg-interface, tag: add GPG_VERIFY_OMIT_STATUS flag
</content>
</entry>
<entry>
<title>ref-filter: allow porcelain to translate messages in the output</title>
<updated>2017-01-31T20:43:04Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2017-01-10T08:49:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6eac70fa6343a31b5b310a465a442adb6731a26b'/>
<id>urn:sha1:6eac70fa6343a31b5b310a465a442adb6731a26b</id>
<content type='text'>
Introduce setup_ref_filter_porcelain_msg() so that the messages used in
the atom %(upstream:track) can be translated if needed. By default, keep
the messages untranslated, which is the right behavior for plumbing
commands. This is needed as we port branch.c to use ref-filter's
printing API's.

Written-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: add function to print single ref_array_item</title>
<updated>2017-01-18T00:10:22Z</updated>
<author>
<name>Lukas Puehringer</name>
<email>luk.puehringer@gmail.com</email>
</author>
<published>2017-01-17T23:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2111aa794bb420f767895682232b494d3461ab31'/>
<id>urn:sha1:2111aa794bb420f767895682232b494d3461ab31</id>
<content type='text'>
ref-filter functions are useful for printing git object information
using a format specifier. However, some other modules may not want to use
this functionality on a ref-array but only print a single item.

Expose a pretty_print_ref function to create, pretty print and free
individual ref-items.

Signed-off-by: Lukas Puehringer &lt;luk.puehringer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: introduce format_ref_array_item()</title>
<updated>2017-01-10T20:44:31Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2017-01-10T08:49:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=99c6a71d4f7f4197f5e8600b0edec2a6a9fd9988'/>
<id>urn:sha1:99c6a71d4f7f4197f5e8600b0edec2a6a9fd9988</id>
<content type='text'>
To allow column display, we will need to first render the output in a
string list to allow print_columns() to compute the proper size of
each column before starting the actual output. Introduce the function
format_ref_array_item() that does the formatting of a ref_array_item
to an strbuf.

show_ref_array_item() is kept as a convenience wrapper around it which
obtains the strbuf and prints it the standard output.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: move get_head_description() from branch.c</title>
<updated>2017-01-10T20:44:31Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2017-01-10T08:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d4919bb288e46c81b92d6fe02c4f4564b8477fd3'/>
<id>urn:sha1:d4919bb288e46c81b92d6fe02c4f4564b8477fd3</id>
<content type='text'>
Move the implementation of get_head_description() from branch.c to
ref-filter.  This gives a description of the HEAD ref if called. This
is used as the refname for the HEAD ref whenever the
FILTER_REFS_DETACHED_HEAD option is used. Make it public because we
need it to calculate the length of the HEAD refs description in
branch.c:calc_maxwidth() when we port branch.c to use ref-filter
APIs.

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Signed-off-by: Karthik Nayak &lt;karthik.188@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
