branch: elpa/magit
commit b6764999b520519734782da2c91fd153e7fe9ec4
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-insert-diff-filter-header: Add user documentation
    
    And mention the key binding that shows that documentation.
    
    Closes #5121.
---
 docs/CHANGELOG.4     |  2 ++
 lisp/magit-status.el | 19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/docs/CHANGELOG.4 b/docs/CHANGELOG.4
index b0125c391b..19d6277710 100644
--- a/docs/CHANGELOG.4
+++ b/docs/CHANGELOG.4
@@ -34,6 +34,8 @@
 - ~magit-process-kill~ now first tries to interrupt the process.
   If that fails, a second invocation instead kill it.  #5086
 
+- Added help text for the ~Filter!~ status section.  #5121
+
 * v4.6.0    2026-07-01
 
 The primary focus of this release are blob-visiting buffers.  For
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 356c5d40e4..dce8c36b7f 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -573,7 +573,21 @@ the status buffer causes this section to disappear again."
     (setq magit-this-error nil)))
 
 (defun magit-insert-diff-filter-header ()
-  "Insert a header line showing the effective diff filters."
+  "Insert a header line showing the effective diff filters.
+
+If any diff filters are in effect in the status buffer, they are
+shown on a line beginning with \"Filter! ...\" as a reminder, so you
+won't end up wondering why certain changes, which you expect to be
+displayed, are not actually displayed.
+
+Filters either come from arguments, which can be changed using \
+\\<magit-status-mode-map>\\[magit-diff-refresh],
+or from Git variables, which are configured outside of Magit.
+
+If you do not want this reminder to be shown, remove it like so:
+
+  (remove-hook \\='magit-status-headers-hook
+               \\='magit-insert-diff-filter-header)"
   (let ((ignore-modules (magit-ignore-submodules-p)))
     (when (or ignore-modules
               magit-buffer-diff-files)
@@ -586,7 +600,8 @@ the status buffer causes this section to disappear again."
             (insert " -- ")))
         (when magit-buffer-diff-files
           (insert (string-join magit-buffer-diff-files " ")))
-        (insert ?\n)))))
+        (insert (substitute-command-keys " \
+[\\[magit-diff-refresh] to change, \\[magit-describe-section] for 
help]\n"))))))
 
 ;;;; Reference Headers
 

Reply via email to