<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.h, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-10-20T18:36:13Z</updated>
<entry>
<title>ref-filter API user: add and use a ref_sorting_release()</title>
<updated>2021-10-20T18:36:13Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-10-20T18:27:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5fb028688f5811bd835c0bc47f8d7a379a0d152'/>
<id>urn:sha1:e5fb028688f5811bd835c0bc47f8d7a379a0d152</id>
<content type='text'>
Add a ref_sorting_release() and use it for some of the current API
users, the ref_sorting_default() function and its siblings will do a
malloc() which wasn't being free'd previously.

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: drop broken-ref code entirely</title>
<updated>2021-09-27T19:36:45Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-09-24T18:48:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d653c50364aeccb604f6b4680190824debf637a'/>
<id>urn:sha1:2d653c50364aeccb604f6b4680190824debf637a</id>
<content type='text'>
Now that none of our callers passes the INCLUDE_BROKEN flag, we can drop
it entirely, along with the code to plumb it through to the
for_each_fullref_in() functions.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: add %(rest) atom</title>
<updated>2021-07-26T19:01:26Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-07-26T03:26:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9dee075eb07713a49922f7e1f90a6a9de5c5e5f'/>
<id>urn:sha1:b9dee075eb07713a49922f7e1f90a6a9de5c5e5f</id>
<content type='text'>
%(rest) is a atom used for cat-file batch mode, which can split
the input lines at the first whitespace boundary, all characters
before that whitespace are considered to be the object name;
characters after that first run of whitespace (i.e., the "rest"
of the line) are output in place of the %(rest) atom.

In order to let "cat-file --batch=%(rest)" use the ref-filter
interface, add %(rest) atom for ref-filter.

Introduce the reject_atom() to reject the atom %(rest) for
"git for-each-ref", "git branch", "git tag" and "git verify-tag".

Reviewed-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Suggected-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Hariom Verma &lt;hariom18599@gmail.com&gt;
Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: use non-const ref_format in *_atom_parser()</title>
<updated>2021-07-26T19:01:26Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-07-26T03:26:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e85fcb355a38b5f01493efecdf0150a10ee471da'/>
<id>urn:sha1:e85fcb355a38b5f01493efecdf0150a10ee471da</id>
<content type='text'>
Use non-const ref_format in *_atom_parser(), which can help us
modify the members of ref_format in *_atom_parser().

Mentored-by: Christian Couder &lt;christian.couder@gmail.com&gt;
Mentored-by: Hariom Verma &lt;hariom18599@gmail.com&gt;
Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: get rid of show_ref_array_item</title>
<updated>2021-04-19T22:08:00Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-04-19T11:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=22f69a85edf29dba2278b55f14419e4ea48148d2'/>
<id>urn:sha1:22f69a85edf29dba2278b55f14419e4ea48148d2</id>
<content type='text'>
Inlining the exported function `show_ref_array_item()`,
which is not providing the right level of abstraction,
simplifies the API and can unlock improvements at the
former call sites.

Helped-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>branch: sort detached HEAD based on a flag</title>
<updated>2021-01-07T23:13:21Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-01-07T09:51:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2708ce62d2105c4470399a2c839b6d451c9c148f'/>
<id>urn:sha1:2708ce62d2105c4470399a2c839b6d451c9c148f</id>
<content type='text'>
Change the ref-filter sorting of detached HEAD to check the
FILTER_REFS_DETACHED_HEAD flag, instead of relying on the ref
description filled-in by get_head_description() to start with "(",
which in turn we expect to ASCII-sort before any other reference.

For context, we'd like the detached line to appear first at the start
of "git branch -l", e.g.:

    $ git branch -l
    * (HEAD detached at &lt;hash&gt;)
      master

This doesn't change that, but improves on a fix made in
28438e84e04 (ref-filter: sort detached HEAD lines firstly, 2019-06-18)
and gives the Chinese translation the ability to use its preferred
punctuation marks again.

In Chinese the fullwidth versions of punctuation like "()" are
typically written as (U+FF08 fullwidth left parenthesis), (U+FF09
fullwidth right parenthesis) instead[1]. This form is used in both
po/zh_{CN,TW}.po in most cases where "()" is translated in a string.

Aside from that improvement to the Chinese translation, it also just
makes for cleaner code that we mark any special cases in the ref_array
we're sorting with flags and make the sort function aware of them,
instead of piggy-backing on the general-case of strcmp() doing the
right thing.

As seen in the amended tests this made reverse sorting a bit more
consistent. Before this we'd sometimes sort this message in the
middle, now it's consistently at the beginning or end, depending on
whether we're doing a normal or reverse sort. Having it at the end
doesn't make much sense either, but at least it behaves consistently
now. A follow-up commit will make this behavior under reverse sorting
even better.

I'm removing the "TRANSLATORS" comments that were in the old code
while I'm at it. Those were added in d4919bb288e (ref-filter: move
get_head_description() from branch.c, 2017-01-10). I think it's
obvious from context, string and translation memory in typical
translation tools that these are the same or similar string.

1. https://en.wikipedia.org/wiki/Chinese_punctuation#Marks_similar_to_European_punctuation

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_sorting flags to a bitfield</title>
<updated>2021-01-07T23:13:21Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-01-07T09:51:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c269a7b162027d0465d52203e778903a2ddbdbf'/>
<id>urn:sha1:7c269a7b162027d0465d52203e778903a2ddbdbf</id>
<content type='text'>
Change the reverse/ignore_case/version sort flags in the ref_sorting
struct into a bitfield. Having three of them was already a bit
unwieldy, but it would be even more so if another flag needed a
function like ref_sorting_icase_all() introduced in
76f9e569adb (ref-filter: apply --ignore-case to all sorting keys,
2020-05-03).

A follow-up change will introduce such a flag, so let's move this over
to a bitfield. Instead of using the usual '#define' pattern I'm using
the "enum" pattern from builtin/rebase.c's b4c8eb024af (builtin
rebase: support --quiet, 2018-09-04).

Perhaps there's a more idiomatic way of doing the "for each in list
amend mask" pattern than this "mask/on" variable combo. This function
doesn't allow us to e.g. do any arbitrary changes to the bitfield for
multiple flags, but I think in this case that's fine. The common case
is that we're calling this with a list of one.

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: make internal reachable-filter API more precise</title>
<updated>2020-09-18T22:41:55Z</updated>
<author>
<name>Aaron Lipman</name>
<email>alipman88@gmail.com</email>
</author>
<published>2020-09-18T21:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a1b19aa5d43c46fc570f6946ab5ad001dccc8cdf'/>
<id>urn:sha1:a1b19aa5d43c46fc570f6946ab5ad001dccc8cdf</id>
<content type='text'>
The internal reachable-filter API is a bit loose and imprecise; it
also bleeds unnecessarily into the public header. Tighten the API
by:

* renaming do_merge_filter() to reach_filter()

* separating parameters to explicitly identify what data is used
  by the function instead of passing an entire ref_filter_cbdata
  struct

* renaming and moving internal constants from header to source
  file

Signed-off-by: Aaron Lipman &lt;alipman88@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: allow merged and no-merged filters</title>
<updated>2020-09-16T19:38:10Z</updated>
<author>
<name>Aaron Lipman</name>
<email>alipman88@gmail.com</email>
</author>
<published>2020-09-16T02:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21bf933928c02372633b88aa6c4d9d71271d42b3'/>
<id>urn:sha1:21bf933928c02372633b88aa6c4d9d71271d42b3</id>
<content type='text'>
Enable ref-filter to process multiple merged and no-merged filters, and
extend functionality to git branch, git tag and git for-each-ref. This
provides an easy way to check for branches that are "graduation
candidates:"

$ git branch --no-merged master --merged next

If passed more than one merged (or more than one no-merged) filter, refs
must be reachable from any one of the merged commits, and reachable from
none of the no-merged commits.

Signed-off-by: Aaron Lipman &lt;alipman88@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/for-each-ref-multi-key-sort-fix'</title>
<updated>2020-05-08T21:25:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-05-08T21:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6de1630898838b62b97617323a07eb6fe9618a7e'/>
<id>urn:sha1:6de1630898838b62b97617323a07eb6fe9618a7e</id>
<content type='text'>
"git branch" and other "for-each-ref" variants accepted multiple
--sort=&lt;key&gt; options in the increasing order of precedence, but it
had a few breakages around "--ignore-case" handling, and tie-breaking
with the refname, which have been fixed.

* jk/for-each-ref-multi-key-sort-fix:
  ref-filter: apply fallback refname sort only after all user sorts
  ref-filter: apply --ignore-case to all sorting keys
</content>
</entry>
</feed>
