From 1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085 Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Fri, 11 Sep 2015 20:34:16 +0530 Subject: 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' 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:" atoms from the `valid_atom` array. Add documentation and test for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano --- ref-filter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ref-filter.h') diff --git a/ref-filter.h b/ref-filter.h index 0913ba99d6..ab76b22de6 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -59,7 +59,8 @@ struct ref_filter { struct commit *merge_commit; unsigned int with_commit_tag_algo : 1; - unsigned int kind; + unsigned int kind, + lines; }; struct ref_filter_cbdata { -- cgit v1.2.3