Re: [PATCH 5/6] git-reflog: add create and exists functions
From: David Turner <hidden>
Date: 2016-06-15 23:05:32
On Thu, 2015-06-25 at 11:35 -0700, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:quoted
Now, going back to 4/6, I think create_reflog() function as an external API has a few problems. * Its name does not tell us what should happen when a reflog already exists for the refname the caller asked to "create" reflog for. I understand that this only makes sure it exists and does not destroy existing one. Its old name, log_ref_setup(), did not have this problem, but now it does. ... * Add a thin-wrapper for callers that do not care about the path to the log file, e.g. int vivify_reflog(const char *refname, struct strbuf *err) {As usual, I am aware that I am not good at naming things (but I can tell when somebody uses a bad name), and "vivify" may be a horrible name for that. A reroll with a better name is very much welcomed. Perhaps prepare-reflog? I dunno.
I'll try safe_create_reflog, by analogy to safe_create_leading_dirs.