diff options
author | Karthik Nayak <karthik.188@gmail.com> | 2015-09-11 20:34:16 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-17 10:02:48 -0700 |
commit | 1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085 (patch) | |
tree | 8a0b9e69aadeb9f1b27fcb9a6698e82234507b98 /builtin/tag.c | |
parent | ref-filter: add option to filter out tags, branches and remotes (diff) | |
download | tgif-1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085.tar.xz |
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>
Diffstat (limited to 'builtin/tag.c')
-rw-r--r-- | builtin/tag.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index 471d6b1ab8..b0bc1c5ad4 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -185,6 +185,10 @@ static enum contains_result contains(struct commit *candidate, return contains_test(candidate, want); } +/* + * Currently modified and used in ref-filter as append_lines(), will + * eventually be removed as we port tag.c to use ref-filter APIs. + */ static void show_tag_lines(const struct object_id *oid, int lines) { int i; |