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

[PATCH 1/5] MyFirstObjectWalk: use additional arg in config_fn_t

From
Dirk Gouders <dirk@gouders.net>
Date
Mar 11, 2024, 10:11 UTC
Message-ID
<15b74566e07a39902556cd620e5cd6df1da3c7df.1710192973.git.dirk@gouders.net>
In-Reply-To
<cover.1710192973.git.dirk@gouders.net>

Commit a4e7e317 (config: add ctx arg to config_fn_t) added a fourth argument to config_fn_t but did not change relevant function calls in Documentation/MyFirstObjectWalk.txt.

Fix those calls and the example git_walken_config() to use that additional argument.

Fixes: a4e7e317 (config: add ctx arg to config_fn_t)
Cc: Glen Choo <glencbz@gmail.com>
Signed-off-by: Dirk Gouders <dirk@gouders.net>
---
 Documentation/MyFirstObjectWalk.txt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
index c68cdb11b9..cceac2df95 100644
--- a/Documentation/MyFirstObjectWalk.txt
+++ b/Documentation/MyFirstObjectWalk.txt
@@ -210,13 +210,14 @@ We'll also need to include the `config.h` header:
 
 ...
 
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+			     const struct config_context *ctx, void *cb)
 {
 	/*
 	 * For now, we don't have any custom configuration, so fall back to
 	 * the default config.
 	 */
-	return git_default_config(var, value, cb);
+	return git_default_config(var, value, ctx, cb);
 }
 ----
 
@@ -389,10 +390,11 @@ modifying `rev_info.grep_filter`, which is a `struct grep_opt`.
 First some setup. Add `grep_config()` to `git_walken_config()`:
 
 ----
-static int git_walken_config(const char *var, const char *value, void *cb)
+static int git_walken_config(const char *var, const char *value,
+			     const struct config_context *ctx, void *cb)
 {
-	grep_config(var, value, cb);
-	return git_default_config(var, value, cb);
+	grep_config(var, value, ctx, cb);
+	return git_default_config(var, value, ctx, cb);
 }
 ----
 
-- 
2.43.0
Previous: Dirk GoudersNext: Junio C Hamano
Message 2 of 11 in “Fixes for Documentation/MyFirstObjectWalk.txt”
  1. 0/5 Fixes for Documentation/MyFirstObjectWalk.txtDirk Gouders, Mar 11, 2024
  2. 1/5 MyFirstObjectWalk: use additional arg in config_fn_tDirk Gouders, Mar 11, 2024
  3. Junio C HamanoMar 12, 2024
  4. 2/5 MyFirstObjectWalk: fix misspelled "builtins/"Dirk Gouders, Mar 11, 2024
  5. 3/5 MyFirstObjectWalk: fix filtered object walkDirk Gouders, Mar 11, 2024
  6. 4/5 MyFirstObjectWalk: fix description for counting omitted objectsDirk Gouders, Mar 11, 2024
  7. 5/5 MyFirstObjectWalk: add stderr to pipe processingDirk Gouders, Mar 11, 2024
  8. Junio C HamanoMar 12, 2024
  9. Dirk GoudersMar 12, 2024
  10. Junio C HamanoMar 12, 2024
  11. Junio C HamanoMar 12, 2024

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.