summaryrefslogtreecommitdiff
path: root/pretty.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-16 08:14:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-16 17:40:00 (GMT)
commit88c7b4c3c8d51510d20ebb9990750ad0e97afbfb (patch)
tree2bd40e97a951eaa60647ead589c77abff625f5d0 /pretty.h
parentf6c71f81f9f597d94b95828b5f70f01283a56202 (diff)
downloadgit-88c7b4c3c8d51510d20ebb9990750ad0e97afbfb.zip
git-88c7b4c3c8d51510d20ebb9990750ad0e97afbfb.tar.gz
git-88c7b4c3c8d51510d20ebb9990750ad0e97afbfb.tar.bz2
date API: create a date.h, split from cache.h
Move the declaration of the date.c functions from cache.h, and adjust the relevant users to include the new date.h header. The show_ident_date() function belonged in pretty.h (it's defined in pretty.c), its two users outside of pretty.c didn't strictly need to include pretty.h, as they get it indirectly, but let's add it to them anyway. Similarly, the change to "builtin/{fast-import,show-branch,tag}.c" isn't needed as far as the compiler is concerned, but since they all use the "DATE_MODE()" macro we now define in date.h, let's have them include it. We could simply include this new header in "cache.h", but as this change shows these functions weren't common enough to warrant including in it in the first place. By moving them out of cache.h changes to this API will no longer cause a (mostly) full re-build of the project when "make" is run. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.h')
-rw-r--r--pretty.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pretty.h b/pretty.h
index 2f16acd..f34e24c 100644
--- a/pretty.h
+++ b/pretty.h
@@ -2,6 +2,7 @@
#define PRETTY_H
#include "cache.h"
+#include "date.h"
#include "string-list.h"
struct commit;
@@ -163,4 +164,13 @@ int format_set_trailers_options(struct process_trailer_options *opts,
const char **arg,
char **invalid_arg);
+/*
+ * Like show_date, but pull the timestamp and tz parameters from
+ * the ident_split. It will also sanity-check the values and produce
+ * a well-known sentinel date if they appear bogus.
+ */
+const char *show_ident_date(const struct ident_split *id,
+ const struct date_mode *mode);
+
+
#endif /* PRETTY_H */