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 /Documentation/git-for-each-ref.txt | |
parent | 5b4f28510f36062134390ad8818721c1d4a2760f (diff) | |
download | git-1bb38e5a6a8fb6cf9b882a1a7038d649ceba0085.tar.gz |
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 'Documentation/git-for-each-ref.txt')
-rw-r--r-- | Documentation/git-for-each-ref.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt index 3a271bf8af..324ad2c739 100644 --- a/Documentation/git-for-each-ref.txt +++ b/Documentation/git-for-each-ref.txt @@ -150,7 +150,8 @@ The complete message in a commit and tag object is `contents`. Its first line is `contents:subject`, where subject is the concatenation of all lines of the commit message up to the first blank line. The next line is 'contents:body', where body is all of the lines after the first -blank line. Finally, the optional GPG signature is `contents:signature`. +blank line. The optional GPG signature is `contents:signature`. The +first `N` lines of the message is obtained using `contents:lines=N`. For sorting purposes, fields with numeric values sort in numeric order (`objectsize`, `authordate`, `committerdate`, `taggerdate`). |