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

[PATCH] Add `log.decorate' configuration variable.

From
SDSteven Drake <sdrake@xnet.co.nz>
Date
Feb 16, 2010, 23:39 UTC
Message-ID
<alpine.LNX.2.00.1002171239430.2477@vqena.qenxr.bet.am>

This alows the 'git-log --decorate' to be enabled by default so that normal log outout contains ant ref names of commits that are shown.

Signed-off-by: Steven Drake <sdrake@xnet.co.nz>
---
 Documentation/config.txt |    7 +++++++
 builtin-log.c            |    9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 1aead58..8359eb5 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1217,6 +1217,13 @@ log.date::
 	following alternatives: {relative,local,default,iso,rfc,short}.
 	See linkgit:git-log[1].
 
+log.decorate::
+	Print out the ref names of any commits that are shown by the log
+	command. If 'short' is specified, the ref name prefixes 'refs/heads/',
+	'refs/tags/' and 'refs/remotes/' will not be printed. If 'full' is
+	specified, the full ref name (including prefix) will be printed.
+	This is the same as the log commands '--decorate' option.
+
 log.showroot::
 	If true, the initial commit will be shown as a big creation event.
 	This is equivalent to a diff against an empty tree.
diff --git a/builtin-log.c b/builtin-log.c
index 89f8d60..cd6158c 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -24,6 +24,7 @@
 static const char *default_date_mode = NULL;
 
 static int default_show_root = 1;
+static int decoration_style = 0;
 static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_pretty;
 
@@ -35,7 +36,6 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 		      struct rev_info *rev)
 {
 	int i;
-	int decoration_style = 0;
 
 	rev->abbrev = DEFAULT_ABBREV;
 	rev->commit_format = CMIT_FMT_DEFAULT;
@@ -249,6 +249,13 @@ static int git_log_config(const char *var, const char *value, void *cb)
 		return git_config_string(&fmt_patch_subject_prefix, var, value);
 	if (!strcmp(var, "log.date"))
 		return git_config_string(&default_date_mode, var, value);
+	if (!strcmp(var, "log.decorate")) {
+		if (!strcmp(value, "full"))
+			decoration_style = DECORATE_FULL_REFS;
+		else if (!strcmp(value, "short"))
+			decoration_style = DECORATE_SHORT_REFS;
+		return 0;
+	}
 	if (!strcmp(var, "log.showroot")) {
 		default_show_root = git_config_bool(var, value);
 		return 0;
-- 
1.6.6
Next: Junio C Hamano
Message 1 of 9 in “Add `log.decorate' configuration variable.”
  1. Add `log.decorate' configuration variable.Steven Drake, Feb 16, 2010
  2. Junio C HamanoFeb 17, 2010
  3. Steven DrakeFeb 17, 2010
  4. Junio C HamanoFeb 17, 2010
  5. Steven DrakeFeb 17, 2010
  6. Junio C HamanoFeb 17, 2010
  7. Bert WesargFeb 17, 2010
  8. Re* [PATCH] Add `log.decorate' configuration variable.Junio C Hamano, Feb 17, 2010
  9. Heiko VoigtFeb 17, 2010

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.