From b52ba1a5d6c18250f497d3aba03943442766d9e1 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 9 Feb 2007 09:19:28 +0100 Subject: [PATCH 01/10] git-blame: Add Emacs Lisp file headers and GNU GPL boilerplate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 75 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index 62cf24c996..ba9d8a6cde 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -1,8 +1,73 @@ -;;; git-blame.el -;; David Kågedal +;;; git-blame.el --- Minor mode for incremental blame for Git -*- coding: utf-8 -*- +;; +;; Copyright (C) 2007 David Kågedal +;; +;; Authors: David Kågedal +;; Created: 31 Jan 2007 ;; Message-ID: <87iren2vqx.fsf@morpheus.local> +;; License: GPL +;; Keywords: git, version control, release management +;; +;; Compatibility: Emacs21 + + +;; This file is *NOT* part of GNU Emacs. +;; This file is distributed under the same terms as GNU Emacs. + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2 of +;; the License, or (at your option) any later version. + +;; This program is distributed in the hope that it will be +;; useful, but WITHOUT ANY WARRANTY; without even the implied +;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +;; PURPOSE. See the GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public +;; License along with this program; if not, write to the Free +;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, +;; MA 02111-1307 USA + +;; http://www.fsf.org/copyleft/gpl.html + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Commentary: +;; +;; Here is an Emacs implementation of incremental git-blame. When you +;; turn it on while viewing a file, the editor buffer will be updated by +;; setting the background of individual lines to a color that reflects +;; which commit it comes from. And when you move around the buffer, a +;; one-line summary will be shown in the echo area. + +;;; Installation: +;; +;; 1) Load into emacs: M-x load-file RET git-blame.el RET +;; 2) Open a git-controlled file +;; 3) Blame: M-x git-blame-mode + +;;; Compatibility: +;; +;; It requires GNU Emacs 21. If you'are using Emacs 20, try +;; changing this: +;; +;; (overlay-put ovl 'face (list :background +;; (cdr (assq 'color (cddddr info))))) +;; +;; to +;; +;; (overlay-put ovl 'face (cons 'background-color +;; (cdr (assq 'color (cddddr info))))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;;; Code: + +(require 'cl) ; to use `push', `pop' -(require 'cl) (defun color-scale (l) (let* ((colors ()) r g b) @@ -178,3 +243,7 @@ (shell-command (format "git log -1 --pretty=oneline %s" (or hash (git-blame-current-commit))))) + +(provide 'git-blame) + +;;; git-blame.el ends here From f6f125fbaa79c097f10afdbd7103ec068df10397 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Fri, 9 Feb 2007 09:19:59 +0100 Subject: [PATCH 02/10] git-blame: Change installation instructions Change installation instructions to using either "(require 'git-blame)" or appropriate autoload instruction in GNU Emacs init file, .emacs This required adding "(provide 'git-blame)" at the end of git-blame.el and adding [preliminary] docstring to `git-blame-mode' function for consistency (to mark function as interactive in `autoload' we have to provide docstring as DOCSTRING is third arg, and INTERACTIVE fourth, and both are optional). `git-blame-mode' is marked to autoload. While at it ensure that we add `git-blame-mode' to `minor-mode-alist' only once (in a way that does not depend on `cl' package). Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index ba9d8a6cde..56a548b4a8 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -44,9 +44,20 @@ ;;; Installation: ;; -;; 1) Load into emacs: M-x load-file RET git-blame.el RET -;; 2) Open a git-controlled file -;; 3) Blame: M-x git-blame-mode +;; To use this package, put it somewhere in `load-path' (or add +;; directory with git-blame.el to `load-path'), and add the following +;; line to your .emacs: +;; +;; (require 'git-blame) +;; +;; If you do not want to load this package before it is necessary, you +;; can make use of the `autoload' feature, e.g. by adding to your .emacs +;; the following lines +;; +;; (autoload 'git-blame-mode "git-blame" +;; "Minor mode for incremental blame for Git." t) +;; +;; Then first use of `M-x git-blame-mode' would load the package. ;;; Compatibility: ;; @@ -102,8 +113,12 @@ (defvar git-blame-mode nil) (make-variable-buffer-local 'git-blame-mode) -(push (list 'git-blame-mode " blame") minor-mode-alist) +(unless (assq 'git-blame-mode minor-mode-alist) + (setq minor-mode-alist + (cons (list 'git-blame-mode " blame") + minor-mode-alist))) +;;;###autoload (defun git-blame-mode (&optional arg) (interactive "P") (if arg From 9f85fb324dc21b595a77313936b39930437209e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A5gedal?= Date: Fri, 9 Feb 2007 09:20:38 +0100 Subject: [PATCH 03/10] Handle uncommitted changes and cache descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Kågedal Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index 56a548b4a8..c99437e5e5 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -187,8 +187,10 @@ (res-line (string-to-number (match-string 3))) (num-lines (string-to-number (match-string 4)))) (setq git-blame-current - (git-blame-new-commit - hash src-line res-line num-lines))) + (if (string= hash "0000000000000000000000000000000000000000") + nil + (git-blame-new-commit + hash src-line res-line num-lines)))) (delete-region (point) (match-end 0)) t) ((looking-at "filename \\(.+\\)\n") @@ -220,6 +222,7 @@ (unless color (setq color git-blame-ancient-color)) (setq info (list hash src-line res-line num-lines + (git-describe-commit hash) (cons 'color color)))) (puthash hash info git-blame-cache)) (goto-line res-line) @@ -233,7 +236,8 @@ (overlay-put ovl 'git-blame info) (overlay-put ovl 'help-echo hash) (overlay-put ovl 'face (list :background - (cdr (assq 'color (cddddr info))))) + (cdr (assq 'color (nthcdr 5 info))))) + ;; the point-entered property doesn't seem to work in overlays ;;(overlay-put ovl 'point-entered ;; `(lambda (x y) (git-blame-identify ,hash))) (let ((modified (buffer-modified-p))) @@ -253,11 +257,21 @@ (car info) (error "No commit info")))) +(defun git-describe-commit (hash) + (with-temp-buffer + (call-process "git" nil t nil + "log" "-1" "--pretty=oneline" + hash) + (buffer-substring (point-min) (1- (point-max))))) + +(defvar git-blame-last-identification nil) +(make-variable-buffer-local 'git-blame-last-identification) (defun git-blame-identify (&optional hash) (interactive) - (shell-command - (format "git log -1 --pretty=oneline %s" (or hash - (git-blame-current-commit))))) + (let ((info (gethash (or hash (git-blame-current-commit)) git-blame-cache))) + (when (and info (not (eq info git-blame-last-identification))) + (message "%s" (nth 4 info)) + (setq git-blame-last-identification info)))) (provide 'git-blame) From fa882116006e0403bb1b74973bb5f3f34f1cf523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A5gedal?= Date: Fri, 9 Feb 2007 09:21:03 +0100 Subject: [PATCH 04/10] git-blame.el: improve color handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Kågedal Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index c99437e5e5..7ffc153bda 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -95,16 +95,10 @@ colors)) (defvar git-blame-dark-colors - (color-scale '("00" "04" "08" "0c" - "10" "14" "18" "1c" - "20" "24" "28" "2c" - "30" "34" "38" "3c"))) + (color-scale '("0c" "04" "24" "1c" "2c" "34" "14" "3c"))) (defvar git-blame-light-colors - (color-scale '("c0" "c4" "c8" "cc" - "d0" "d4" "d8" "dc" - "e0" "e4" "e8" "ec" - "f0" "f4" "f8" "fc"))) + (color-scale '("c4" "d4" "cc" "dc" "f4" "e4" "fc" "ec"))) (defvar git-blame-ancient-color "dark green") @@ -127,13 +121,15 @@ (make-local-variable 'git-blame-overlays) (make-local-variable 'git-blame-colors) (make-local-variable 'git-blame-cache) - (let ((bgmode (cdr (assoc 'background-mode (frame-parameters))))) - (if (eq bgmode 'dark) - (setq git-blame-colors git-blame-dark-colors) - (setq git-blame-colors git-blame-light-colors))) + (git-blame-cleanup) (if git-blame-mode - (git-blame-run) - (git-blame-cleanup))) + (progn + (let ((bgmode (cdr (assoc 'background-mode (frame-parameters))))) + (if (eq bgmode 'dark) + (setq git-blame-colors git-blame-dark-colors) + (setq git-blame-colors git-blame-light-colors))) + (setq git-blame-cache (make-hash-table :test 'equal)) + (git-blame-run)))) (defun git-blame-run () (let* ((display-buf (current-buffer)) From f0f39bb4c4ba36a07d7a6f034ba12f2ca0522db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A5gedal?= Date: Fri, 9 Feb 2007 09:21:32 +0100 Subject: [PATCH 05/10] git-blame.el: blame unsaved changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make git-blame use the current buffer contents for the blame, instead of the saved file. This makes the blame correct even if there are unsaved changes. Also added a git-reblame command. Signed-off-by: David Kågedal Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 65 ++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index 7ffc153bda..f1839647bc 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -102,8 +102,17 @@ (defvar git-blame-ancient-color "dark green") -(defvar git-blame-overlays nil) -(defvar git-blame-cache nil) +(defvar git-blame-proc nil + "The running git-blame process") +(make-variable-buffer-local 'git-blame-proc) + +(defvar git-blame-overlays nil + "The git-blame overlays used in the current buffer.") +(make-variable-buffer-local 'git-blame-overlays) + +(defvar git-blame-cache nil + "A cache of git-blame information for the current buffer") +(make-variable-buffer-local 'git-blame-cache) (defvar git-blame-mode nil) (make-variable-buffer-local 'git-blame-mode) @@ -118,9 +127,7 @@ (if arg (setq git-blame-mode (eq arg 1)) (setq git-blame-mode (not git-blame-mode))) - (make-local-variable 'git-blame-overlays) (make-local-variable 'git-blame-colors) - (make-local-variable 'git-blame-cache) (git-blame-cleanup) (if git-blame-mode (progn @@ -131,24 +138,37 @@ (setq git-blame-cache (make-hash-table :test 'equal)) (git-blame-run)))) +;;;###autoload +(defun git-reblame () + "Recalculate all blame information in the current buffer" + (unless git-blame-mode + (error "git-blame is not active")) + (interactive) + (git-blame-cleanup) + (git-blame-run)) + (defun git-blame-run () - (let* ((display-buf (current-buffer)) - (blame-buf (get-buffer-create - (concat " git blame for " (buffer-name)))) - (proc (start-process "git-blame" blame-buf - "git" "blame" "--incremental" - (file-name-nondirectory buffer-file-name)))) - (mapcar 'delete-overlay git-blame-overlays) - (setq git-blame-overlays nil) - (setq git-blame-cache (make-hash-table :test 'equal)) - (with-current-buffer blame-buf - (erase-buffer) - (make-local-variable 'git-blame-file) - (make-local-variable 'git-blame-current) - (setq git-blame-file display-buf) - (setq git-blame-current nil)) - (set-process-filter proc 'git-blame-filter) - (set-process-sentinel proc 'git-blame-sentinel))) + (if git-blame-proc + ;; Should maybe queue up a new run here + (message "Already running git blame") + (let ((display-buf (current-buffer)) + (blame-buf (get-buffer-create + (concat " git blame for " (buffer-name))))) + (setq git-blame-proc + (start-process "git-blame" blame-buf + "git" "blame" + "--incremental" "--contents" "-" + (file-name-nondirectory buffer-file-name))) + (with-current-buffer blame-buf + (erase-buffer) + (make-local-variable 'git-blame-file) + (make-local-variable 'git-blame-current) + (setq git-blame-file display-buf) + (setq git-blame-current nil)) + (set-process-filter git-blame-proc 'git-blame-filter) + (set-process-sentinel git-blame-proc 'git-blame-sentinel) + (process-send-region git-blame-proc (point-min) (point-max)) + (process-send-eof git-blame-proc)))) (defun git-blame-cleanup () "Remove all blame properties" @@ -159,6 +179,9 @@ (set-buffer-modified-p modified))) (defun git-blame-sentinel (proc status) + (with-current-buffer (process-buffer proc) + (with-current-buffer git-blame-file + (setq git-blame-proc nil))) ;;(kill-buffer (process-buffer proc)) (message "git blame finished")) From 96df551cb89264ed88b717b9ace8ad3edc0e09a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A5gedal?= Date: Fri, 9 Feb 2007 09:21:51 +0100 Subject: [PATCH 06/10] git-blame.el: Doc fixes and cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Kågedal Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index f1839647bc..7daa4e6993 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -123,6 +123,7 @@ ;;;###autoload (defun git-blame-mode (&optional arg) + "Minor mode for displaying Git blame" (interactive "P") (if arg (setq git-blame-mode (eq arg 1)) @@ -170,20 +171,25 @@ (process-send-region git-blame-proc (point-min) (point-max)) (process-send-eof git-blame-proc)))) +(defun remove-git-blame-text-properties (start end) + (let ((modified (buffer-modified-p)) + (inhibit-read-only t)) + (remove-text-properties start end '(point-entered nil)) + (set-buffer-modified-p modified))) + (defun git-blame-cleanup () "Remove all blame properties" (mapcar 'delete-overlay git-blame-overlays) (setq git-blame-overlays nil) - (let ((modified (buffer-modified-p))) - (remove-text-properties (point-min) (point-max) '(point-entered nil)) - (set-buffer-modified-p modified))) + (remove-git-blame-text-properties (point-min) (point-max))) (defun git-blame-sentinel (proc status) (with-current-buffer (process-buffer proc) (with-current-buffer git-blame-file (setq git-blame-proc nil))) ;;(kill-buffer (process-buffer proc)) - (message "git blame finished")) + ;;(message "git blame finished") + ) (defvar in-blame-filter nil) From d2589855df9141ed5885ebd2fe868619d53fa15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=A5gedal?= Date: Fri, 9 Feb 2007 09:22:19 +0100 Subject: [PATCH 07/10] git-blame.el: Autoupdate while editing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the support for automatically updating the buffer while editing. A configuration variable git-blame-autoupdate controls whether this should be enabled or not. Signed-off-by: David Kågedal Signed-off-by: Junio C Hamano --- contrib/emacs/git-blame.el | 95 ++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 9 deletions(-) diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index 7daa4e6993..64ad50b327 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -102,6 +102,9 @@ (defvar git-blame-ancient-color "dark green") +(defvar git-blame-autoupdate t + "*Automatically update the blame display while editing") + (defvar git-blame-proc nil "The running git-blame process") (make-variable-buffer-local 'git-blame-proc) @@ -114,6 +117,14 @@ "A cache of git-blame information for the current buffer") (make-variable-buffer-local 'git-blame-cache) +(defvar git-blame-idle-timer nil + "An idle timer that updates the blame") +(make-variable-buffer-local 'git-blame-cache) + +(defvar git-blame-update-queue nil + "A queue of update requests") +(make-variable-buffer-local 'git-blame-update-queue) + (defvar git-blame-mode nil) (make-variable-buffer-local 'git-blame-mode) (unless (assq 'git-blame-mode minor-mode-alist) @@ -129,6 +140,9 @@ (setq git-blame-mode (eq arg 1)) (setq git-blame-mode (not git-blame-mode))) (make-local-variable 'git-blame-colors) + (if git-blame-autoupdate + (add-hook 'after-change-functions 'git-blame-after-change nil t) + (remove-hook 'after-change-functions 'git-blame-after-change t)) (git-blame-cleanup) (if git-blame-mode (progn @@ -137,7 +151,8 @@ (setq git-blame-colors git-blame-dark-colors) (setq git-blame-colors git-blame-light-colors))) (setq git-blame-cache (make-hash-table :test 'equal)) - (git-blame-run)))) + (git-blame-run)) + (cancel-timer git-blame-idle-timer))) ;;;###autoload (defun git-reblame () @@ -148,18 +163,24 @@ (git-blame-cleanup) (git-blame-run)) -(defun git-blame-run () +(defun git-blame-run (&optional startline endline) (if git-blame-proc ;; Should maybe queue up a new run here (message "Already running git blame") (let ((display-buf (current-buffer)) (blame-buf (get-buffer-create - (concat " git blame for " (buffer-name))))) + (concat " git blame for " (buffer-name)))) + (args '("--incremental" "--contents" "-"))) + (if startline + (setq args (append args + (list "-L" (format "%d,%d" startline endline))))) + (setq args (append args + (list (file-name-nondirectory buffer-file-name)))) (setq git-blame-proc - (start-process "git-blame" blame-buf - "git" "blame" - "--incremental" "--contents" "-" - (file-name-nondirectory buffer-file-name))) + (apply 'start-process + "git-blame" blame-buf + "git" "blame" + args)) (with-current-buffer blame-buf (erase-buffer) (make-local-variable 'git-blame-file) @@ -183,10 +204,28 @@ (setq git-blame-overlays nil) (remove-git-blame-text-properties (point-min) (point-max))) +(defun git-blame-update-region (start end) + "Rerun blame to get updates between START and END" + (let ((overlays (overlays-in start end))) + (while overlays + (let ((overlay (pop overlays))) + (if (< (overlay-start overlay) start) + (setq start (overlay-start overlay))) + (if (> (overlay-end overlay) end) + (setq end (overlay-end overlay))) + (setq git-blame-overlays (delete overlay git-blame-overlays)) + (delete-overlay overlay)))) + (remove-git-blame-text-properties start end) + ;; We can be sure that start and end are at line breaks + (git-blame-run (1+ (count-lines (point-min) start)) + (count-lines (point-min) end))) + (defun git-blame-sentinel (proc status) (with-current-buffer (process-buffer proc) (with-current-buffer git-blame-file - (setq git-blame-proc nil))) + (setq git-blame-proc nil) + (if git-blame-update-queue + (git-blame-delayed-update)))) ;;(kill-buffer (process-buffer proc)) ;;(message "git blame finished") ) @@ -241,7 +280,8 @@ (save-excursion (set-buffer git-blame-file) (let ((info (gethash hash git-blame-cache)) - (inhibit-point-motion-hooks t)) + (inhibit-point-motion-hooks t) + (inhibit-modification-hooks t)) (when (not info) (let ((color (pop git-blame-colors))) (unless color @@ -298,6 +338,43 @@ (message "%s" (nth 4 info)) (setq git-blame-last-identification info)))) +;; (defun git-blame-after-save () +;; (when git-blame-mode +;; (git-blame-cleanup) +;; (git-blame-run))) +;; (add-hook 'after-save-hook 'git-blame-after-save) + +(defun git-blame-after-change (start end length) + (when git-blame-mode + (git-blame-enq-update start end))) + +(defvar git-blame-last-update nil) +(make-variable-buffer-local 'git-blame-last-update) +(defun git-blame-enq-update (start end) + "Mark the region between START and END as needing blame update" + ;; Try to be smart and avoid multiple callouts for sequential + ;; editing + (cond ((and git-blame-last-update + (= start (cdr git-blame-last-update))) + (setcdr git-blame-last-update end)) + ((and git-blame-last-update + (= end (car git-blame-last-update))) + (setcar git-blame-last-update start)) + (t + (setq git-blame-last-update (cons start end)) + (setq git-blame-update-queue (nconc git-blame-update-queue + (list git-blame-last-update))))) + (unless (or git-blame-proc git-blame-idle-timer) + (setq git-blame-idle-timer + (run-with-idle-timer 0.5 nil 'git-blame-delayed-update)))) + +(defun git-blame-delayed-update () + (setq git-blame-idle-timer nil) + (if git-blame-update-queue + (let ((first (pop git-blame-update-queue)) + (inhibit-point-motion-hooks t)) + (git-blame-update-region (car first) (cdr first))))) + (provide 'git-blame) ;;; git-blame.el ends here From ad34a028c126fde97359c9d67e8d634043670a21 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 9 Feb 2007 12:18:28 -0500 Subject: [PATCH 08/10] remove mailmap.linux This file is incomplete, unmaintained, and it doesn't belong in the GIT package anyway. A more complete version is already included in the Linux -mm tree and is about to make its way into mainline RSN. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- contrib/mailmap.linux | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 contrib/mailmap.linux diff --git a/contrib/mailmap.linux b/contrib/mailmap.linux deleted file mode 100644 index e4907f80f1..0000000000 --- a/contrib/mailmap.linux +++ /dev/null @@ -1,42 +0,0 @@ -# -# Even with git, we don't always have name translations. -# So have an email->real name table to translate the -# (hopefully few) missing names -# -# repo-abbrev: /pub/scm/linux/kernel/git/ -# -Adrian Bunk -Andreas Herrmann -Andrew Morton -Andrew Vasquez -Christoph Hellwig -Corey Minyard -David Woodhouse -Domen Puncer -Douglas Gilbert -Ed L Cashin -Evgeniy Polyakov -Felix Moeller -Frank Zago -Greg Kroah-Hartman -James Bottomley -James Bottomley -Jeff Garzik -Jens Axboe -Kay Sievers -Mitesh shah -Morten Welinder -Morten Welinder -Morten Welinder -Morten Welinder -Nguyen Anh Quynh -Paolo 'Blaisorblade' Giarrusso -Peter A Jonsson -Ralf Wildenhues -Rudolf Marek -Rui Saraiva -Sachin P Sant -Santtu Hyrkk,Av(B -Simon Kelley -Tejun Heo -Tony Luck From 02f571c73bfdf1d950848ed24229caea438f1f72 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 9 Feb 2007 15:41:35 -0800 Subject: [PATCH 09/10] git-fetch: document automatic tag following. Signed-off-by: Junio C Hamano --- Documentation/git-fetch.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 7ecf2408d6..5fbeab76b7 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -20,6 +20,14 @@ The ref names and their object names of fetched refs are stored in `.git/FETCH_HEAD`. This information is left for a later merge operation done by "git merge". +When stores the fetched result in tracking branches, +the tags that point at these branches are automatically +followed. This is done by first fetching from the remote using +the given s, and if the repository has objects that are +pointed by remote tags that it does not yet have, then fetch +those missing tags. If the other end has tags that point at +branches you are not interested in, you will not get them. + OPTIONS ------- From cc46a74398e6a542d61d8fa0b197b7dedcd7f301 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 9 Feb 2007 16:22:42 -0800 Subject: [PATCH 10/10] wt_status_prepare(): clean up structure initialization. Otherwise it would be a pain to add members to it. Signed-off-by: Junio C Hamano --- wt-status.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/wt-status.c b/wt-status.c index 5567868008..2879c3d5ec 100644 --- a/wt-status.c +++ b/wt-status.c @@ -47,17 +47,10 @@ void wt_status_prepare(struct wt_status *s) unsigned char sha1[20]; const char *head; + memset(s, 0, sizeof(*s)); head = resolve_ref("HEAD", sha1, 0, NULL); s->branch = head ? xstrdup(head) : NULL; - s->reference = "HEAD"; - s->amend = 0; - s->verbose = 0; - s->untracked = 0; - - s->commitable = 0; - s->workdir_dirty = 0; - s->workdir_untracked = 0; } static void wt_status_print_cached_header(const char *reference)