git/list[1] front-page[2] threads[3] people[4] search[5] about
 

diff: Add support for man(7) pages

From
ACAlejandro Colomar <alx.manpages@gmail.com>
Date
Oct 20, 2022, 12:19 UTC
Message-ID
<ce09bfae-091f-7c62-5e40-2784906d5370@gmail.com>
Hi!

I added the following to my gitconfig and attributes files to improve diffs in manual pages. Would you mind adding support for them in git(1)?

Thanks,
Alex

P.S.: The extension I used in the attributes file is imperfect, since a glob wouldn't allow me as much precission as a regex. With a regex, it would be written as '\.[1-9][[:lower:]]*$'.

---
     git: diff "man": Correctly interpret man(7) pages.
     Signed-off-by: Alejandro Colomar <alx@kernel.org>
diff --git a/home/user/.config/git/attributes 
b/home/user/.config/git/attributes
new file mode 100644
index 0000000..652558f
--- /dev/null
+++ b/home/user/.config/git/attributes
@@ -0,0 +1 @@
+*.[1-9]* diff=man
diff --git a/home/user/.gitconfig b/home/user/.gitconfig
index 72ddc50..adb6cbb 100644
--- a/home/user/.gitconfig
+++ b/home/user/.gitconfig
@@ -27,3 +27,5 @@
         signingKey = A9348594CE31283A826FBDD8D57633D441E25BB5
  [diff]
         algorithm = histogram
+[diff "man"]
+       xfuncname = "^\\.S[SH] .*$"
-- 
<http://www.alejandro-colomar.es/>
Message 1 of 1 in “diff: Add support for man(7) pages”
  1. Alejandro ColomarOct 20, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.