Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit d105324

Browse files
peffgitster
authored andcommitted
pretty: make show_ident_date public
We use this function internally to format "Date" lines in commit logs, but other parts of the code will want it, too. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4701026 commit d105324

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cache.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,13 @@ struct ident_split {
10451045
*/
10461046
extern int split_ident_line(struct ident_split *, const char *, int);
10471047

1048+
/*
1049+
* Like show_date, but pull the timestamp and tz parameters from
1050+
* the ident_split. It will also sanity-check the values and produce
1051+
* a well-known sentinel date if they appear bogus.
1052+
*/
1053+
const char *show_ident_date(const struct ident_split *id, enum date_mode mode);
1054+
10481055
/*
10491056
* Compare split idents for equality or strict ordering. Note that we
10501057
* compare only the ident part of the line, ignoring any timestamp.

pretty.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ static void add_rfc2047(struct strbuf *sb, const char *line, size_t len,
393393
strbuf_addstr(sb, "?=");
394394
}
395395

396-
static const char *show_ident_date(const struct ident_split *ident,
397-
enum date_mode mode)
396+
const char *show_ident_date(const struct ident_split *ident,
397+
enum date_mode mode)
398398
{
399399
unsigned long date = 0;
400400
long tz = 0;

0 commit comments

Comments
 (0)