Thread (1 message) 1 message, 1 author, 2016-06-16

Re: [PATCH] builtin/commit.c: memoize git-path for COMMIT_EDITMSG

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:35

Matthieu Moy [off-list ref] writes:
quoted
More importantly, when is this function evaluated and returned value
used to fill commit_editmsg_path[]?
I may have missed something, but I'd say "never", as the code is not
compilable at least with my gcc:
It was a rhetorical question ;-)  But "the more important part" was
that initialization by calling non-trivial function is not a good
idea even in C++ where it is allowed, as you said below.
And indeed, this construct is a huge source of trouble, as it would mean
that git_path_commit_editmsg() is called 1) unconditionnally, and 2)
before entering main().
Indeed.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help