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

[PATCH] Add grep.fullName config variable

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Mar 17, 2014, 19:16 UTC
Message-ID
<874n2w3abu.fsf@igel.home>
This configuration variable sets the default for the --full-name option.
Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 Documentation/git-grep.txt | 3 +++
 grep.c                     | 5 +++++
 2 files changed, 8 insertions(+)
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index f837334..31811f1 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -53,6 +53,9 @@ grep.extendedRegexp::
 	option is ignored when the 'grep.patternType' option is set to a value
 	other than 'default'.
 
+grep.fullName::
+	If set to true, enable '--full-name' option by default.
+
 
 OPTIONS
 -------
diff --git a/grep.c b/grep.c
index c668034..ece04bf 100644
--- a/grep.c
+++ b/grep.c
@@ -86,6 +86,11 @@ int grep_config(const char *var, const char *value, void *cb)
 		return 0;
 	}
 
+	if (!strcmp(var, "grep.fullname")) {
+		opt->relative = !git_config_bool(var, value);
+		return 0;
+	}
+
 	if (!strcmp(var, "color.grep"))
 		opt->color = git_config_colorbool(var, value);
 	else if (!strcmp(var, "color.grep.context"))
-- 
1.9.0

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Next: Junio C Hamano
Message 1 of 7 in “Add grep.fullName config variable”
  1. Add grep.fullName config variableAndreas Schwab, Mar 17, 2014
  2. Junio C HamanoMar 17, 2014
  3. Andreas SchwabMar 18, 2014
  4. Junio C HamanoMar 18, 2014
  5. Andreas SchwabMar 18, 2014
  6. Junio C HamanoMar 18, 2014
  7. Andreas SchwabMar 18, 2014

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.