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

[PATCH v5 3/4] merge: introduce per-branch-configuration helper function

From
Jared Hance <jaredhance@gmail.com>
Date
Feb 10, 2011, 23:52 UTC
Message-ID
<1297381964-7137-4-git-send-email-jaredhance@gmail.com>
In-Reply-To
<1297381964-7137-1-git-send-email-jaredhance@gmail.com>

Create a function that will hold configuration code for configuration values that are specified per branch, as suggested by Junio.

Signed-off-by: Jared Hance <jaredhance@gmail.com>
---
 builtin/merge.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index cd23880..71b392d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -522,8 +522,20 @@ static int per_branch_config(const char *k, const char *v, void *cb)
 		parse_options(argc, argv, NULL, builtin_merge_options,
 			      builtin_merge_usage, 0);
 		free(buf);
+
+		return 0;
 	}
 
+	return 1; /* not what I handle */
+}
+
+static int git_merge_config(const char *k, const char *v, void *cb)
+{
+	int status = per_branch_config(k, v, cb);
+
+	if (status <= 0)
+		return status;
+
 	if (!strcmp(k, "merge.diffstat") || !strcmp(k, "merge.stat"))
 		show_diffstat = git_config_bool(k, v);
 	else if (!strcmp(k, "pull.twohead"))
-- 
1.7.4
Previous: Junio C HamanoNext: Jared Hance
Message 6 of 8 in “Updated patch series for default upstream merge”
  1. 0/4 Updated patch series for default upstream mergeJared Hance, Feb 10, 2011
  2. 1/4 merge: update the usage information to be more modernJared Hance, Feb 10, 2011
  3. Drew NorthupFeb 12, 2011
  4. 2/4 merge: introduce setup_merge_commit helper functionJared Hance, Feb 10, 2011
  5. Junio C HamanoFeb 11, 2011
  6. 3/4 merge: introduce per-branch-configuration helper functionJared Hance, Feb 10, 2011
  7. 4/4 merge: add support for merging from upstream by defaultJared Hance, Feb 10, 2011
  8. Junio C HamanoFeb 11, 2011

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.