<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.h, branch v2.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-09-25T15:54:54Z</updated>
<entry>
<title>branch.c: use 'ref-filter' APIs</title>
<updated>2015-09-25T15:54:54Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-23T18:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aedcb7dc75e5c260f20bebe14925f3ac4841b03d'/>
<id>urn:sha1:aedcb7dc75e5c260f20bebe14925f3ac4841b03d</id>
<content type='text'>
Make 'branch.c' use 'ref-filter' APIs for iterating through refs
sorting. This removes most of the code used in 'branch.c' replacing it
with calls to the 'ref-filter' library.

Make 'branch.c' use the 'filter_refs()' function provided by 'ref-filter'
to filter out tags based on the options set.

We provide a sorting option provided for 'branch.c' by using the
sorting options provided by 'ref-filter'. Also by default, we sort by
'refname'.  Since 'HEAD' is alphabatically before 'refs/...' we end up
with an array consisting of the 'HEAD' ref then the local branches and
finally the remote-tracking branches.

Also remove the 'ignore' variable from ref_array_item as it was
previously used for the '--merged' option and now that is handled by
ref-filter.

Modify some of the tests in t1430 to check the stderr for a warning
regarding the broken ref. This is done as ref-filter throws a warning
for broken refs rather than directly printing them.

Add tests and documentation for the same.

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>branch.c: use 'ref-filter' data structures</title>
<updated>2015-09-25T15:54:54Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-23T18:11:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1511b22d40d102f397104858a617aa1662bb1c98'/>
<id>urn:sha1:1511b22d40d102f397104858a617aa1662bb1c98</id>
<content type='text'>
Make 'branch.c' use 'ref-filter' data structures and make changes to
support the new data structures. This is a part of the process of
porting 'branch.c' to use 'ref-filter' APIs.

This is a temporary step before porting 'branch.c' to use 'ref-filter'
completely. As this is a temporary step, most of the code introduced
here will be removed when 'branch.c' is ported over 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>
<entry>
<title>ref-filter: add option to match literal pattern</title>
<updated>2015-09-17T17:02:49Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-10T15:48:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bef0e12becd72b94d6bb9e48859742f55a4afb53'/>
<id>urn:sha1:bef0e12becd72b94d6bb9e48859742f55a4afb53</id>
<content type='text'>
Since 'ref-filter' only has an option to match path names add an
option for plain fnmatch pattern-matching.

This is to support the pattern matching options which are used in `git
tag -l` and `git branch -l` where we can match patterns like `git tag
-l foo*` which would match all tags which has a "foo*" pattern.

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 support to sort by version</title>
<updated>2015-09-17T17:02:49Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-10T15:48:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90c004085cfe65e1b290e5b5fc05817ec2c596a6'/>
<id>urn:sha1:90c004085cfe65e1b290e5b5fc05817ec2c596a6</id>
<content type='text'>
Add support to sort by version using the "v:refname" and
"version:refname" option. This is achieved by using the 'versioncmp()'
function as the comparing function for qsort.

This option is included to support sorting by versions in `git tag -l`
which will eventually be ported to use ref-filter APIs.

Add documentation and tests for the same.

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 support for %(contents:lines=X)</title>
<updated>2015-09-17T17:02:48Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-11T15:04:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085'/>
<id>urn:sha1:1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085</id>
<content type='text'>
In 'tag.c' we can print N lines from the annotation of the tag using
the '-n&lt;num&gt;' option. Copy code from 'tag.c' to 'ref-filter' and
modify it to support appending of N lines from the annotation of tags
to the given strbuf.

Implement %(contents:lines=X) where X lines of the given object are
obtained.

While we're at it, remove unused "contents:&lt;suboption&gt;" atoms from
the `valid_atom` array.

Add documentation and test for the same.

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 option to filter out tags, branches and remotes</title>
<updated>2015-09-17T17:02:48Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-09-10T15:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5b4f28510f36062134390ad8818721c1d4a2760f'/>
<id>urn:sha1:5b4f28510f36062134390ad8818721c1d4a2760f</id>
<content type='text'>
Add a function called 'for_each_fullref_in()' to refs.{c,h} which
iterates through each ref for the given path without trimming the path
and also accounting for broken refs, if mentioned.

Add 'filter_ref_kind()' in ref-filter.c to check the kind of ref being
handled and return the kind to 'ref_filter_handler()', where we
discard refs which we do not need and assign the kind to needed refs.

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 `struct atom_value` to ref-filter.c</title>
<updated>2015-09-17T17:02:48Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-08-22T03:39:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a25761a5eb01d797f85621b5844a4eea5a02377'/>
<id>urn:sha1:3a25761a5eb01d797f85621b5844a4eea5a02377</id>
<content type='text'>
Since atom_value is only required for the internal working of
ref-filter it doesn't belong in the public header.

Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&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: implement '--contains' option</title>
<updated>2015-08-03T17:25:28Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-07-07T16:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee2bd06b0f735a00ce0216ca1d3391b13722d987'/>
<id>urn:sha1:ee2bd06b0f735a00ce0216ca1d3391b13722d987</id>
<content type='text'>
'tag -l' and 'branch -l' have two different ways of finding
out if a certain ref contains a commit. Implement both these
methods in ref-filter and give the caller of ref-filter API
the option to pick which implementation to be used.

'branch -l' uses 'is_descendant_of()' from commit.c which is
left as the default implementation to be used.

'tag -l' uses a more specific algorithm since ffc4b80. This
implementation is used whenever the 'with_commit_tag_algo' bit
is set in 'struct ref_filter'.

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: implement '--merged' and '--no-merged' options</title>
<updated>2015-08-03T17:25:28Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-07-07T16:06:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35257aa01203bae74f9fb856fb02c10c4b3836e6'/>
<id>urn:sha1:35257aa01203bae74f9fb856fb02c10c4b3836e6</id>
<content type='text'>
In 'branch -l' we have '--merged' option which only lists refs (branches)
merged into the named commit and '--no-merged' option which only lists
refs (branches) not merged into the named commit. Implement these two
options in ref-filter.{c,h} so that other commands can benefit from this.

Based-on-patch-by: Jeff King &lt;peff@peff.net&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 parse_opt_merge_filter()</title>
<updated>2015-08-03T17:25:28Z</updated>
<author>
<name>Karthik Nayak</name>
<email>karthik.188@gmail.com</email>
</author>
<published>2015-07-07T16:06:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5afcb90560586765bf21fb09959a8b4497804639'/>
<id>urn:sha1:5afcb90560586765bf21fb09959a8b4497804639</id>
<content type='text'>
Add 'parse_opt_merge_filter()' to parse '--merged' and '--no-merged'
options and write macros for the same.

This is copied from 'builtin/branch.c' which will eventually be removed
when we port 'branch.c' to use ref-filter APIs.

Based-on-patch-by: Jeff King &lt;peff@peff.net&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>
</feed>
