Re: [PATCH 5/6] git-reflog: add create and exists functions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 25, 2015, 18:35 UTC
- Message-ID
- <xmqq381fzlei.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <xmqqioabzoz2.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> 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.