# [RFC/PATCH] blame: simplify algorithm

1 messages from 2012-09-05 to 2012-09-05. Participants: Michael J Gruber.
Thread: https://gitlist.dev/t/31445

## Michael J Gruber, 2012-09-05 11:56

Subject: [RFC/PATCH] blame: simplify algorithm
Message-ID: <df3f74c3b86ba27881a29f52543669ea4bee667e.1346845901.git.git@drmicha.warpmail.net>
URL: https://gitlist.dev/e/df3f74c3b86ba27881a29f52543669ea4bee667e.1346845901.git.git%40drmicha.warpmail.net

```
Recent research (http://tirania.org/blog/archive/2012/Aug-29.html)
resulted in a simplified algorithm for assigning blame in foss projects.
Make "git blame" use that algorithm by default.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
I've updated the man page for 'git annotate' but not the one for 'git
blame' nor the tests, so this is RFC for now.

 Documentation/git-annotate.txt | 2 +-
 builtin/blame.c                | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-annotate.txt b/Documentation/git-annotate.txt
index 05fd482..cbeb996 100644
--- a/Documentation/git-annotate.txt
+++ b/Documentation/git-annotate.txt
@@ -16,7 +16,7 @@ Annotates each line in the given file with information from the commit
 which introduced the line. Optionally annotates from a given revision.
 
 The only difference between this command and linkgit:git-blame[1] is that
-they use slightly different output formats, and this command exists only
+they use different output formats, and this command exists only
 for backward compatibility to support existing scripts, and provide a more
 familiar command name for people coming from other SCM systems.
 
diff --git a/builtin/blame.c b/builtin/blame.c
index 0e102bf..28d5829 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -2341,6 +2341,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 	struct parse_opt_ctx_t ctx;
 	int cmd_is_annotate = !strcmp(argv[0], "annotate");
 
+	if (!cmd_is_annotate) {
+		puts("Linus");
+		return 0;
+	}
 	git_config(git_blame_config, NULL);
 	init_revisions(&revs, NULL);
 	revs.date_mode = blame_date_mode;
-- 
1.7.12.406.gafd3f81

```
