Re: [PATCH v1 2/8] Add a function to update HEAD after creating a commit
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 7, 2017, 03:02 UTC
- Message-ID
- <alpine.DEB.2.21.1.1711070400160.6482@virtualbox>
- In-Reply-To
- <xmqqtvy6g5k8.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Tue, 7 Nov 2017, Junio C Hamano wrote:
Show 19 quoted lines
> Phillip Wood <phillip.wood@talktalk.net> writes:
>
> > @@ -751,6 +751,42 @@ int template_untouched(const struct strbuf *sb, const char *template_file,
> > return rest_is_empty(sb, start - sb->buf);
> > }
> >
> > +int update_head(const struct commit *old_head, const struct object_id *new_head,
> > + const char *action, const struct strbuf *msg,
> > + struct strbuf *err)
> > +{
>
> [...]
>
> I however do not think update_head() is such a good name for a
> helper function in the global scope. builtin/clone.c has a static
> one that has quite different semantics with the same name (I am not
> saying that builtin/clone.c will in the future start including the
> sequencer.h header file; I am pointing out that update_head() is not
> a good global name that will be understood by everybody).Please try to always accompany a "Don't Do That" by a "How About This Instead".
In this case, I could imagine that `update_head_with_reflog()` would be a better name. If you disagree, I invite you to propose an alternative that strikes your liking.
Ciao, Dscho