     (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")
   )

              (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))))

;;;###autoload
(defun git-reblame ()


(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)
