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

Re: allow a differn't diff.context config for git format-patch

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 23, 2019, 03:45 UTC
Message-ID
<xmqqftq95qr6.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190423030648.GA6344@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> ... I don't think it would be
> too big a problem for format-patch to learn some options to configure
> its diffs. We already have some options in format.* for various things.

I am not sure; diff.context is rather special in that the variable behind it belongs to the diff layer and is set via diff_config that is called by diff_ui_config that in turn is called by log_config which is called by format_config.

If we want to say "format.context" trumps "diff.config", then a new internal variable to receive the value of the variable must be invented and after the config gets read, cmd_format_patch() needs to do something silly like this:

                git_config(git_format_config, NULL);
        +	if (format_context != -1)
        +		diff_default_context = format_context;
                repo_init_revisions(the_repository, &rev, prefix);

committing layering violation by exposing diff_default_context variable.

Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “allow a differn't diff.context config for git format-patch”
  1. Shawn LanddenApr 14, 2019
  2. Jeff KingApr 23, 2019
  3. Junio C HamanoApr 23, 2019
  4. Jeff KingApr 23, 2019
  5. Shawn LanddenMay 12, 2019
  6. Jeff KingMay 14, 2019
  7. Jeff KingMay 14, 2019

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.