aboutsummaryrefslogtreecommitdiff
path: root/grep.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-09-29 11:41:27 +0700
committerJunio C Hamano <gitster@pobox.com>2012-09-29 11:40:58 -0700
commitad4813b3c2513c5dc7e84305ab8a393b32124977 (patch)
tree336f7cc4fdf78e070f8342eeee8a3f11b343012a /grep.h
parent652398a88e7c3d18b6820a2ae369b05d26dc757f (diff)
downloadgit-ad4813b3c2513c5dc7e84305ab8a393b32124977.tar.gz
git-ad4813b3c2513c5dc7e84305ab8a393b32124977.tar.xz
grep: prepare for new header field filter
grep supports only author and committer headers, which have the same special treatment that later headers may or may not have. Check for field type and only strip_timestamp() when the field is either author or committer. GREP_HEADER_FIELD_MAX is put in the grep_header_field enum to be calculated automatically, correctly, as long as it's at the end of the enum. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
-rw-r--r--grep.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/grep.h b/grep.h
index 8a28a676f..d54adbe56 100644
--- a/grep.h
+++ b/grep.h
@@ -29,9 +29,11 @@ enum grep_context {
enum grep_header_field {
GREP_HEADER_AUTHOR = 0,
- GREP_HEADER_COMMITTER
+ GREP_HEADER_COMMITTER,
+
+ /* Must be at the end of the enum */
+ GREP_HEADER_FIELD_MAX
};
-#define GREP_HEADER_FIELD_MAX (GREP_HEADER_COMMITTER + 1)
struct grep_pat {
struct grep_pat *next;