Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a README file.

  • Loading branch information...
commit aca6e0b4dca092c931320af147038ec897e2c9a1 1 parent 25bd2bd
Moritz Bunkus mbunkus authored

Showing 1 changed file with 141 additions and 0 deletions. Show diff stats Hide diff stats

  1. +141 0 README
141 README
... ... @@ -0,0 +1,141 @@
  1 +mo-git-blame -- An interactive, interative 'git blame' mode for Emacs
  2 +
  3 +Copyright
  4 +---------
  5 +
  6 +Copyright (C) 2009 Moritz Bunkus <moritz@bunkus.org>
  7 +
  8 +mo-git-blame is free software; you can redistribute it and/or modify
  9 +it under the terms of the GNU General Public License as published by
  10 +the Free Software Foundation; either version 3, or (at your option)
  11 +any later version.
  12 +
  13 +mo-git-blame is distributed in the hope that it will be useful, but
  14 +WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16 +General Public License for more details.
  17 +
  18 +You should have received a copy of the GNU General Public License
  19 +along with GNU Emacs; see the file COPYING. If not, write to the Free
  20 +Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  21 +02111-1307, USA.
  22 +
  23 +Installation
  24 +------------
  25 +
  26 +Put this file somewhere in your load-path or add the directory it
  27 +is in to it, e.g.:
  28 +
  29 +(add-to-list 'load-path "~/.emacs.d/mo-git-blame")
  30 +
  31 +Then add two autoload definitions:
  32 +
  33 +(autoload 'mo-git-blame-file "mo-git-blame" nil t)
  34 +(autoload 'mo-git-blame-current "mo-git-blame" nil t)
  35 +
  36 +Optionally bind keys to these functions, e.g.
  37 +
  38 +(global-set-key [?\C-c ?g ?c] 'mo-git-blame-current)
  39 +(global-set-key [?\C-c ?g ?f] 'mo-git-blame-file)
  40 +
  41 +Usage
  42 +-----
  43 +
  44 +There are two ways to invoke it: `mo-git-blame-file' which lets you
  45 +select a file for which 'git blame' should be called and
  46 +`mo-git-blame-current' which does the same for the current buffer's
  47 +associated file.
  48 +
  49 +Once the mode starts it splits the window vertically. The left one
  50 +is filled with the blame output while the right one is filled with the
  51 +content at the current revision. Syntax highlighting is enabled for
  52 +the content window. The content buffer's name will contain the file
  53 +name and the current revision.
  54 +
  55 +mo-git-blame works with three different buffers:
  56 +
  57 +1. the `blame' buffer which contains the output of `git blame' and
  58 +which is the main buffer from which actions can be invoked
  59 +
  60 +2. the `content' buffer which shows the file content at the current
  61 +revision. This buffer has syntax highlighting turned on. Only a few
  62 +actions can be invoked from this buffer (e.g. `q' for exiting
  63 +mo-git-blame).
  64 +
  65 +3. the `output' buffer which contains the output of several git
  66 +commands, e.g. 'git show' or 'git cat-file'.
  67 +
  68 +Normally the `blame' and the `content' buffer are shown
  69 +side-by-side. If the user requests additional information then the
  70 +`output' buffer is shown instead of the `content' buffer. The user can
  71 +return to the `content' buffer with <TAB>.
  72 +
  73 +You can invoke several actions from the blame buffer with single key
  74 +strokes. These include but are not limited to:
  75 +
  76 +b -- Call 'git blame' for the file for the revision listed in the
  77 + current line. Sets the content buffer to contain the file
  78 + content at the new revision.
  79 +c -- Call 'git cat-file blob ...' for the revision listed in the
  80 + current line and show the output in the `output' buffer. The
  81 + output will not have syntax highlighting.
  82 +i -- Display the current state information (current revision, git
  83 + repository path etc) in the right window.
  84 +l -- Call 'git log' for the revision listed in the current line and
  85 + show the output in the `output' buffer.
  86 +L -- Call 'git log' for the current revision and show the output in
  87 + the `output' buffer.
  88 +o -- Overwrite the file with the content of the revision listed in
  89 + the current line. Asks for confirmation before actually
  90 + overwriting the file.
  91 +O -- Overwrite the file with the content of the current
  92 + revision. Asks for confirmation before actually overwriting the
  93 + file.
  94 +q -- Exit mo-git-blame and kill all its buffers.
  95 +s -- Call 'git show' for the revision listed in the current line and
  96 + show the output in the `output' buffer.
  97 +S -- Call 'git show' for the current revision and show the output in
  98 + the `output' buffer.
  99 +TAB -- Re-display the `content' buffer in the right window if it has
  100 + replaced with the `output' buffer.
  101 +RET -- Same as `s'.
  102 +
  103 +Customizing
  104 +-----------
  105 +
  106 +There are several variables that can be customized. They belong to the
  107 +group `mo-git-blame' and can be customized with
  108 +
  109 +(customize-group 'mo-git-blame)
  110 +
  111 +These variables include:
  112 +
  113 +* `mo-git-blame-git-executable' defaults to `git' and should point to
  114 + your `git' executable if it is not in your path.
  115 +* `mo-git-blame-blame-window-width' defaults to 45 and determines the
  116 + initial width of the `blame' window.
  117 +* `mo-git-blame-use-ido' determines whether or not the `ido' package
  118 + is used for various interactive lookups.
  119 +
  120 +Bugs, feature requests, contact
  121 +-------------------------------
  122 +
  123 +You can reach me via email at Moritz Bunkus <moritz@bunkus.org>. I'm
  124 +always grateful for bug reports and usually open to feature
  125 +suggestions as far as my time permits.
  126 +
  127 +You can also file bug reports in my Bugzilla. I actively use Bugzilla
  128 +and prefer this method to direct emails. Bugzilla can be found at
  129 +
  130 +https://www.bunkus.org/bugzilla/
  131 +
  132 +Patches, source code
  133 +--------------------
  134 +
  135 +The latest version can always be retrieved from my Git repository:
  136 +
  137 +git clone git://git.bunkus.org/mo-git-blame.git
  138 +
  139 +If you want to send patches: Yes! By all means! Please do so! Please
  140 +note that I'm using wide windows and do not like forced wrapping
  141 +around 80 columns. I also don't like tabs. Thanks.

0 comments on commit aca6e0b

Please sign in to comment.
Something went wrong with that request. Please try again.