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)