5 #define REFLOG_EXPIRE_TOTAL (1 << 0)
6 #define REFLOG_EXPIRE_UNREACH (1 << 1)
8 struct reflog_expire_entry_option
{
9 struct reflog_expire_entry_option
*next
;
10 timestamp_t expire_total
;
11 timestamp_t expire_unreachable
;
12 char pattern
[FLEX_ARRAY
];
15 struct reflog_expire_options
{
16 struct reflog_expire_entry_option
*entries
, **entries_tail
;
19 timestamp_t default_expire_total
;
20 timestamp_t expire_total
;
21 timestamp_t default_expire_unreachable
;
22 timestamp_t expire_unreachable
;
25 #define REFLOG_EXPIRE_OPTIONS_INIT(now) { \
26 .default_expire_total = now - 30 * 24 * 3600, \
27 .default_expire_unreachable = now - 90 * 24 * 3600, \
31 * Parse the reflog expire configuration. This should be used with
34 int reflog_expire_config(const char *var
, const char *value
,
35 const struct config_context
*ctx
, void *cb
);
37 void reflog_clear_expire_config(struct reflog_expire_options
*opts
);
40 * Adapt the options so that they apply to the given refname. This applies any
41 * per-reference reflog expiry configuration that may exist to the options.
43 void reflog_expire_options_set_refname(struct reflog_expire_options
*cb
,
46 struct expire_reflog_policy_cb
{
51 } unreachable_expire_kind
;
52 struct commit_list
*mark_list
;
53 unsigned long mark_limit
;
54 struct reflog_expire_options opts
;
55 struct commit
*tip_commit
;
56 struct commit_list
*tips
;
57 unsigned int dry_run
:1;
60 int reflog_delete(const char *rev
, enum expire_reflog_flags flags
,
62 void reflog_expiry_cleanup(void *cb_data
);
63 void reflog_expiry_prepare(const char *refname
, const struct object_id
*oid
,
65 int should_expire_reflog_ent(struct object_id
*ooid
, struct object_id
*noid
,
66 const char *email
, timestamp_t timestamp
, int tz
,
67 const char *message
, void *cb_data
);
68 int count_reflog_ent(struct object_id
*ooid
, struct object_id
*noid
,
69 const char *email
, timestamp_t timestamp
, int tz
,
70 const char *message
, void *cb_data
);
71 int should_expire_reflog_ent_verbose(struct object_id
*ooid
,
72 struct object_id
*noid
,
74 timestamp_t timestamp
, int tz
,
75 const char *message
, void *cb_data
);