Skip to content

Commit cbfb73d

Browse files
Fredrik KuivinenJunio C Hamano
authored andcommitted
Add git-blame, a tool for assigning blame.
I have also been working on a blame program. The algorithm is pretty much the one described by Junio in his blame.perl. My variant doesn't handle renames, but it shouldn't be too hard to add that. The output is minimal, just the line number followed by the commit SHA1. An interesting observation is that the output from my git-blame and your git-annotate doesn't match on all files in the git repository. One example where several lines differ is read-cache.c. I haven't investigated it further to find out which one is correct. The code should be considered as a work in progress. It certainly has a couple of rough edges. The output looks fairly sane on the few files I have tested it on, but it wouldn't be too surprising if it gets some cases wrong. [jc: adding it to pu for wider comments. I did minimum whitespace fixups but it still needs an indent run and -Wdeclaration-after-statement fixups.] Signed-off-by: Fredrik Kuivinen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6643688 commit cbfb73d

File tree

2 files changed

+444
-1
lines changed

2 files changed

+444
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ PROGRAMS = \
158158
git-upload-pack$X git-verify-pack$X git-write-tree$X \
159159
git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \
160160
git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
161-
git-describe$X git-merge-tree$X
161+
git-describe$X git-merge-tree$X git-blame$X
162162

163163
# what 'all' will build and 'install' will install, in gitexecdir
164164
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)

0 commit comments

Comments
 (0)