@matheusbsbs / matheus-bagliano / commits / b52ba1a5d6
Fork 0

git-blame: Add Emacs Lisp file headers and GNU GPL boilerplate

Add Emacs Lisp file headers, according to "Coding Conventions" chapter in Emacs Lisp Reference Manual and Elisp Area Convetions for EmacsWiki: http://www.emacswiki.org/cgi-bin/wiki/ElispAreaConventions Those include: copyright notice, GNU GPL boilerplate, description and instalation instructions as provided in email and in commit message introducing git-blame.el, compatibility notes from another email by David Kågedal about what to change to use it in GNU Emacs 20, and "git-blame ends here" to detect if file was truncated. First line includes setting file encoding via first line local variable values (file variables). Added comment to "(require 'cl)" to note why it is needed; "Coding Conventions" advises to avoid require the `cl' package of Common Lisp extensions at run time. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Feb 9, 2007 at 09:19 UTC b52ba1a5d6c18250f497d3aba03943442766d9e1
1 file changed +72 -3
contrib/emacs/git-blame.el
+72 -3
@@ -1,8 +1,73 @@
1 -;;; git-blame.el
2 -;; David Kågedal <davidk@lysator.liu.se>
1 +;;; git-blame.el --- Minor mode for incremental blame for Git -*- coding: utf-8 -*-
2 +;;
3 +;; Copyright (C) 2007 David Kågedal
4 +;;
5 +;; Authors: David Kågedal <davidk@lysator.liu.se>
6 +;; Created: 31 Jan 2007
7 ;; Message-ID: <87iren2vqx.fsf@morpheus.local>
8 +;; License: GPL
9 +;; Keywords: git, version control, release management
10 +;;
11 +;; Compatibility: Emacs21
12 +
13 +
14 +;; This file is *NOT* part of GNU Emacs.
15 +;; This file is distributed under the same terms as GNU Emacs.
16 +
17 +;; This program is free software; you can redistribute it and/or
18 +;; modify it under the terms of the GNU General Public License as
19 +;; published by the Free Software Foundation; either version 2 of
20 +;; the License, or (at your option) any later version.
21 +
22 +;; This program is distributed in the hope that it will be
23 +;; useful, but WITHOUT ANY WARRANTY; without even the implied
24 +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
25 +;; PURPOSE. See the GNU General Public License for more details.
26 +
27 +;; You should have received a copy of the GNU General Public
28 +;; License along with this program; if not, write to the Free
29 +;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 +;; MA 02111-1307 USA
31 +
32 +;; http://www.fsf.org/copyleft/gpl.html
33 +
34 +
35 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36 +;;
37 +;;; Commentary:
38 +;;
39 +;; Here is an Emacs implementation of incremental git-blame. When you
40 +;; turn it on while viewing a file, the editor buffer will be updated by
41 +;; setting the background of individual lines to a color that reflects
42 +;; which commit it comes from. And when you move around the buffer, a
43 +;; one-line summary will be shown in the echo area.
44 +
45 +;;; Installation:
46 +;;
47 +;; 1) Load into emacs: M-x load-file RET git-blame.el RET
48 +;; 2) Open a git-controlled file
49 +;; 3) Blame: M-x git-blame-mode
50 +
51 +;;; Compatibility:
52 +;;
53 +;; It requires GNU Emacs 21. If you'are using Emacs 20, try
54 +;; changing this:
55 +;;
56 +;; (overlay-put ovl 'face (list :background
57 +;; (cdr (assq 'color (cddddr info)))))
58 +;;
59 +;; to
60 +;;
61 +;; (overlay-put ovl 'face (cons 'background-color
62 +;; (cdr (assq 'color (cddddr info)))))
63 +
64 +
65 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
66 +;;
67 +;;; Code:
68 +
69 +(require 'cl) ; to use `push', `pop'
70
5 -(require 'cl)
71 (defun color-scale (l)
72 (let* ((colors ())
73 r g b)
@@ -178,3 +243,7 @@
243 (shell-command
244 (format "git log -1 --pretty=oneline %s" (or hash
245 (git-blame-current-commit)))))
246 +
247 +(provide 'git-blame)
248 +
249 +;;; git-blame.el ends here