emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/diff-hl e969210 2/3: More checks and messages


From: ELPA Syncer
Subject: [elpa] externals/diff-hl e969210 2/3: More checks and messages
Date: Sat, 30 Oct 2021 22:57:18 -0400 (EDT)

branch: externals/diff-hl
commit e9692108c4b9cd9726fc585515b65f33783501da
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    More checks and messages
    
    #71
---
 diff-hl.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/diff-hl.el b/diff-hl.el
index f4491f9..415b760 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -666,6 +666,9 @@ its end position."
 
 (defun diff-hl-stage-current-hunk ()
   (interactive)
+  (let ((backend (vc-backend buffer-file-name)))
+    (unless (eq backend 'Git)
+      (user-error "Only Git supports staging; this file is controlled by %s" 
backend)))
   (diff-hl-find-current-hunk)
   (let* ((line (line-number-at-pos))
          (file buffer-file-name)
@@ -705,7 +708,10 @@ its end position."
               (setq success t))
           (delete-file patchfile))))
     (when success
-      (message "Hunk staged")
+      (if diff-hl-show-staged-changes
+          (message (concat "Hunk staged; customize 
`diff-hl-show-staged-changes'"
+                           " to highlight only unstages changes"))
+        (message "Hunk staged"))
       (unless diff-hl-show-staged-changes
         (diff-hl-update)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]