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

[PATCH 1/5] builtin/log: new config log.useRefFilter

From
HGHariom Verma via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 15, 2020, 10:57 UTC
Message-ID
<a5ce1235a03a49ad394da8d227f5abf52ef3179a.1592218662.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.658.git.1592218662.gitgitgadget@gmail.com>
From: Hariom Verma <hariom18599@gmail.com>

Add a new boolean config variable "log.useRefFilter" for `log` command, allowing log to switch to use ref-filters logic.

*experimental*
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Heba Waly <heba.waly@gmail.com>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
---
 Documentation/config/log.txt | 4 ++++
 builtin/log.c                | 7 +++++++
 2 files changed, 11 insertions(+)
diff --git a/Documentation/config/log.txt b/Documentation/config/log.txt
index 208d5fdcaa6..603f635df86 100644
--- a/Documentation/config/log.txt
+++ b/Documentation/config/log.txt
@@ -48,3 +48,7 @@ log.mailmap::
 	If true, makes linkgit:git-log[1], linkgit:git-show[1], and
 	linkgit:git-whatchanged[1] assume `--use-mailmap`, otherwise
 	assume `--no-use-mailmap`. True by default.
+
+log.useRefFilter::
+	[EXPERIMENTAL] If true, forces `git log` to use ref-filter's logic.
+	Is `false` by default.
diff --git a/builtin/log.c b/builtin/log.c
index d104d5c6889..4eb13d1ef88 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -39,6 +39,9 @@
 #define MAIL_DEFAULT_WRAP 72
 #define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
 
+/* Set true to use ref-filter's logic in git log */
+static int log_use_ref_filter;
+
 /* Set a default date-time format for git log ("log.date" config variable) */
 static const char *default_date_mode = NULL;
 
@@ -489,6 +492,10 @@ static int git_log_config(const char *var, const char *value, void *cb)
 		default_show_signature = git_config_bool(var, value);
 		return 0;
 	}
+	if (!strcmp(var, "log.usereffilter")) {
+		log_use_ref_filter = git_config_bool(var, value);
+		return 0;
+	}
 
 	if (grep_config(var, value, cb) < 0)
 		return -1;
-- 
gitgitgadget
Previous: Hariom Verma via GitGitGadgetNext: Hariom Verma via GitGitGadget
Message 5 of 6 in “[GSoC][RFC] print commits using ref-filter's logic”
  1. 0/5 [GSoC][RFC] print commits using ref-filter's logicHariom Verma via GitGitGadget, Jun 15, 2020
  2. 2/5 revision: add `use_ref_filter` in struct rev_infoHariom Verma via GitGitGadget, Jun 15, 2020
  3. 3/5 pretty: introduce `get_user_format()`Hariom Verma via GitGitGadget, Jun 15, 2020
  4. 4/5 ref_format: add option to skip `\n` at eolHariom Verma via GitGitGadget, Jun 15, 2020
  5. 1/5 builtin/log: new config log.useRefFilterHariom Verma via GitGitGadget, Jun 15, 2020
  6. 5/5 pretty-lib: print commits using ref-filters logicHariom Verma via GitGitGadget, Jun 15, 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.