Skip to contentSkip to conversation

Make git blame date output format configurable, a la git log (take 2)

PATCH New [email protected] 1 participant 2 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make git blame date output format configurable, a la git log (take 2)

This version of the patch incorporates Junio's and Peff's suggestions ... doesn't change the default format and gets rid of alignment bugs.

#1 lore raw

PATCH 1/2 Make git blame's date output format configurable, like git log

From: Eugene Letuchy <[email protected]>

Add the following:
- git config value blame.date that expects one of the git log date formats ({relative,local,default,iso,rfc,short})
- git blame command line option --date expects one of the git log date formats ({relative,local,default,iso,rfc,short})
- documentation in blame-options.txt
- git blame uses the appropriate date.c functions and enums to make sense of the date format and provide appropriate data
- git blame continues to line up the output columns (by padding the date column up to the max width of the chosen date format)
- the date format for git blame without both blame.date and --date continues to be ISO for backwards compatibility
- git annotate ignores the date format specifiers and continues to uses the ISO format, as before

---
 Documentation/blame-options.txt |    8 +++++
 builtin-blame.c                 |   62 +++++++++++++++++++++++++++++----------
 2 files changed, 54 insertions(+), 16 deletions(-)
Documentation/blame-options.txt +8 -0
index 1ab1b96..ad00d36 100644
@@ -63,6 +63,14 @@ of lines before or after the line given by <start>.
 	tree copy has the contents of the named file (specify
 	`-` to make the command read from the standard input).
 
+--date <format>::
+	The value is one of the following alternatives:
+	{relative,local,default,iso,rfc,short}. If --date is not
+	provided, the value of the blame.date config variable is
+	used. If the blame.date config variable is also not set, the
+	iso format is used. For more information, See the discussion
+	of the --date option at linkgit:git-log[1].
+
 -M|<num>|::
 	Detect moving lines in the file as well.  When a commit
 	moves a block of lines in a file (e.g. the original file
builtin-blame.c +46 -16

101 lines not on this page · raw message

Signature · 1 line
1.6.2.rc1.14.g07c3.dirty