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

[PATCH 1/2] am: pay attention to user-defined context size

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 20, 2019, 18:53 UTC
Message-ID
<e1870f3fee8be6ebbecdd618ae1803afb878e67e.1576868036.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.680.git.git.1576868036.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>

am previously only checked gpg-related config options and the default config options while ignoring any diff-related options. This meant that when users tried to set diff.context to something larger than the default value of 3, it was ignored. Pay attention to the diff settings too.

In combination with commit 09ac67a1839e ("format-patch: move
git_config() before repo_init_revisions()", 2019-12-09), which is part
of the dl/format-patch-notes-config-fixup topic, this fixes
   git -c diff.context=5 rebase
to actually use five lines of context.
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 builtin/am.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/am.c b/builtin/am.c
index 8181c2aef3..d4d131b7ee 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2136,7 +2136,7 @@ static int git_am_config(const char *k, const char *v, void *cb)
 	if (status)
 		return status;
 
-	return git_default_config(k, v, NULL);
+	return git_diff_ui_config(k, v, NULL);
 }
 
 int cmd_am(int argc, const char **argv, const char *prefix)
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Junio C Hamano
Message 2 of 10 in “Rebase am fixes”
  1. 0/2 Rebase am fixesElijah Newren via GitGitGadget, Dec 20, 2019
  2. 1/2 am: pay attention to user-defined context sizeElijah Newren via GitGitGadget, Dec 20, 2019
  3. Junio C HamanoDec 20, 2019
  4. Elijah NewrenDec 20, 2019
  5. Elijah NewrenDec 20, 2019
  6. Junio C HamanoDec 20, 2019
  7. Elijah NewrenDec 21, 2019
  8. 2/2 rebase: fix saving of --signoff state for am-based rebasesElijah Newren via GitGitGadget, Dec 20, 2019
  9. Junio C HamanoDec 20, 2019
  10. Johannes SchindelinJan 1, 2020

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.