git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Johannes SixtNext: Junio C Hamano
Message 7 of 11 in “log: make --abbrev-commit's ellipsis configurable”
  1. log: make --abbrev-commit's ellipsis configurableThomas Rast, Feb 13, 2009
  2. Johannes SchindelinFeb 13, 2009
  3. Thomas RastFeb 13, 2009
  4. Johannes SchindelinFeb 13, 2009
  5. log: make --abbrev-commit's ellipsis configurableThomas Rast, Feb 13, 2009
  6. Johannes SixtFeb 13, 2009
  7. Jeff KingFeb 13, 2009
  8. Junio C HamanoFeb 13, 2009
  9. log: do not print ellipses with --abbrev-commitThomas Rast, Feb 13, 2009
  10. Jeff KingFeb 13, 2009
  11. Jakub NarebskiFeb 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.