]> git.eshelyaron.com Git - emacs.git/commit
Split vc-git-dir-extra-headers into more manageable chunks
authorKévin Le Gouguec <kevin.legouguec@gmail.com>
Sun, 9 Jun 2024 17:41:41 +0000 (19:41 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 21 Aug 2024 09:56:15 +0000 (11:56 +0200)
commit17b409e08a995a6f7569d08d71467d0007231dc1
tree08c97ec8ce6feef92043644d82fa83c5a11cbfe7
parent3e6d65149f5efbc271e0d51cdd9a708da3a69be0
Split vc-git-dir-extra-headers into more manageable chunks

The current code requires a lot of eyeballing back-and-forth
to:

- check where variables are actually used, what impact changing
them can have: in actuality, there are three distinct "groups"
of headers we compute, each with their own independent state;
- understand formatting details such as "who's in charge of the
newlines".

To solve both issues, split that function into smaller ones,
each handling a "group" of headers.

The only expected "functional" change is that, by propertizing
"\nHeader: " strings, the original code sometimes applied the
vc-dir-header face to the newline preceding a header; the new
code applies no faces to these newlines.

This change would be visible to users with themes adding an
:extended background to vc-dir-header.  In practice, no in-tree
theme is impacted.

For bug#68183.

* lisp/vc/vc-git.el (vc-git-dir--branch-headers): New function
to compute "Branch", "Tracking" and "Remote".
(vc-git--cmds-in-progress): Rename to...
(vc-git-dir--in-progress-headers): ... this, and compute
headers.
(vc-git-dir--stash-headers): New function to compute the
"Stash" header.
(vc-git-dir-extra-headers): Boil down to just setting
default-directory and assembling the headers from these new
helpers.
(vc-git--out-match): New function to call 'git' and capture
specific bits of output.

(cherry picked from commit 88ac5d03586a81cc8644e75adbdb3cab9b56a1b9)
lisp/vc/vc-git.el