summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJohannes Gilger <heipei@hackvalue.de>2010-04-13 20:31:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-04-14 01:15:08 (GMT)
commit5b16360330822527eac1fa84131d185ff784c9fb (patch)
tree5683f8b5eafe8f0d1e4968a2659a5ecb61032b08 /commit.h
parentb9aa901856cee7ad16737343f6a372bb37871258 (diff)
downloadgit-5b16360330822527eac1fa84131d185ff784c9fb.zip
git-5b16360330822527eac1fa84131d185ff784c9fb.tar.gz
git-5b16360330822527eac1fa84131d185ff784c9fb.tar.bz2
pretty: Initialize notes if %N is used
When using git log --pretty='%N' without an explicit --show-notes, git would segfault. This patches fixes this behaviour by loading the needed notes datastructures if --pretty is used and the format contains %N. When --pretty='%N' is used together with --no-notes, %N won't be expanded. This is an extension to a proposed patch by Jeff King. Signed-off-by: Johannes Gilger <heipei@hackvalue.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index 3cf5166..26ec8c0 100644
--- a/commit.h
+++ b/commit.h
@@ -74,11 +74,16 @@ struct pretty_print_context
struct reflog_walk_info *reflog_info;
};
+struct userformat_want {
+ unsigned notes:1;
+};
+
extern int has_non_ascii(const char *text);
struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
extern char *reencode_commit_message(const struct commit *commit,
const char **encoding_p);
extern void get_commit_format(const char *arg, struct rev_info *);
+extern void userformat_find_requirements(const char *fmt, struct userformat_want *w);
extern void format_commit_message(const struct commit *commit,
const char *format, struct strbuf *sb,
const struct pretty_print_context *context);