Re: [PATCH] log: make --abbrev-commit's ellipsis configurable
- From
Jeff King <peff@peff.net>
- Date
- Feb 13, 2009, 19:27 UTC
- Message-ID
- <20090213192724.GA6782@coredump.intra.peff.net>
- In-Reply-To
- <200902131437.49293.trast@student.ethz.ch>
On Fri, Feb 13, 2009 at 02:37:39PM +0100, Thomas Rast wrote:
Show 7 quoted lines
> > 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