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

git add -p doesn't respect diff.context

From
Mike Hommey <mh@glandium.org>
Date
Jan 20, 2016, 06:35 UTC
Message-ID
<20160120063523.GA26490@glandium.org>
Hi,

When doing git add -p, the default of 3 context lines is used, ignoring the diff.context.

git add -p is using git-diff-files, and diff.context is being read in
git_diff_ui_config, so the comment above that function applies:
/*
 * These are to give UI layer defaults.
 * The core-level commands such as git-diff-files should
 * never be affected by the setting of diff.renames
 * the user happens to have in the configuration file.
 */

I guess the question is whether it's diff-files or add -p that should honor diff.context. Or should it have its own separate config?

Mike
Next: Jeff King
Message 1 of 2 in “git add -p doesn't respect diff.context”
  1. Mike HommeyJan 20, 2016
  2. Jeff KingFeb 4, 2016

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.