]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.h
ref-filter: add support for %(contents:lines=X)
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 11 Sep 2015 15:04:16 +0000 (20:34 +0530)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Sep 2015 17:02:48 +0000 (10:02 -0700)
commit1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085
tree8a0b9e69aadeb9f1b27fcb9a6698e82234507b98
parent5b4f28510f36062134390ad8818721c1d4a2760f
ref-filter: add support for %(contents:lines=X)

In 'tag.c' we can print N lines from the annotation of the tag using
the '-n<num>' 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:<suboption>" atoms from
the `valid_atom` array.

Add documentation and test for the same.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-for-each-ref.txt
builtin/tag.c
ref-filter.c
ref-filter.h
t/t6302-for-each-ref-filter.sh