Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

Re: [PATCH] log: make --abbrev-commit's ellipsis configurable

From: Jeff King <hidden>
Date: 2016-06-15 22:46:10

On Fri, Feb 13, 2009 at 02:37:39PM +0100, Thomas Rast wrote:
quoted
How about making this an option, and passing it in rev_opts instead?  This 
option could then be defaulted to in git-log, when the user said 
--abbrev-commit.
But the 'git_config(git_log_config, NULL);' that sets the new variable
to false is only called from cmd_{log,show,whatchanged,reflog}.  I
should have indicated this in the commit messaged, sorry.
We use that technique elsewhere in git, and personally I am not a fan of
it, as it comes down to setting a global variable. That worked fine when
we had a lot of one-shot programs that read the config, did a defined
piece of work, and then exited.

But more and more we are performing multiple actions in a single run
(especially as many scripts become builtin porcelains), and those
globals are applied to all actions. So a porcelain trying to do a
plumbing-ish thing can run into problems.

I can't recall the exact details, but I remember dealing with something
like this related to external diff. Using an ALLOW_EXTERNAL diffopt
ended up being more reliable, _and_ easier to read and follow in the
code.

Now I don't think this is probably a big problem for this particular
option, but I'd rather not see the technique propagated.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help