[PATCH 3/5] pretty: introduce `get_user_format()`
- From
- Hariom Verma via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jun 15, 2020, 10:57 UTC
- Message-ID
- <b568d097159ff9d89bc4fc7c9076d9a8a1e29a1e.1592218662.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.658.git.1592218662.gitgitgadget@gmail.com>
From: Hariom Verma <hariom18599@gmail.com>
In the quest of porting pretty formats to use ref-filters logic, user_format must need to interact with other functions too. So, to get user_format, introduced `const char *get_user_format()`.
Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Heba Waly <heba.waly@gmail.com> Signed-off-by: Hariom Verma <hariom18599@gmail.com> --- pretty.c | 5 +++++ pretty.h | 3 +++ 2 files changed, 8 insertions(+)
diff --git a/pretty.c b/pretty.c index 2a3d46bf42f..3767c144b0a 100644 --- a/pretty.c +++ b/pretty.c @@ -2016,3 +2016,8 @@ void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit, pp.fmt = fmt; pretty_print_commit(&pp, commit, sb); } + +const char *get_user_format(void) +{ + return user_format; +} diff --git a/pretty.h b/pretty.h index 071f2fb8e44..517450f72f8 100644 --- a/pretty.h +++ b/pretty.h @@ -139,4 +139,7 @@ const char *format_subject(struct strbuf *sb, const char *msg, /* Check if "cmit_fmt" will produce an empty output. */ int commit_format_is_empty(enum cmit_fmt); +/* Returns user_format */ +const char *get_user_format(void); + #endif /* PRETTY_H */
-- gitgitgadget