Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: Document how to get links with git am

This adds Kees' clever apply hook to the kernel documentation so
it can be easily references when needed.

Cc: Kees Cook <keescook@chromium.org>
Link: https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2019-July/006608.html
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191118223019.81708-1-linus.walleij@linaro.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Linus Walleij and committed by
Jonathan Corbet
29108490 5ca470a0

+30
+30
Documentation/maintainer/configure-git.rst
··· 32 32 :: 33 33 34 34 export GPG_TTY=$(tty) 35 + 36 + 37 + Creating commit links to lore.kernel.org 38 + ---------------------------------------- 39 + 40 + The web site http://lore.kernel.org is meant as a grand archive of all mail 41 + list traffic concerning or influencing the kernel development. Storing archives 42 + of patches here is a recommended practice, and when a maintainer applies a 43 + patch to a subsystem tree, it is a good idea to provide a Link: tag with a 44 + reference back to the lore archive so that people that browse the commit 45 + history can find related discussions and rationale behind a certain change. 46 + The link tag will look like this: 47 + 48 + Link: https://lore.kernel.org/r/<message-id> 49 + 50 + This can be configured to happen automatically any time you issue ``git am`` 51 + by adding the following hook into your git: 52 + 53 + .. code-block:: none 54 + 55 + $ git config am.messageid true 56 + $ cat >.git/hooks/applypatch-msg <<'EOF' 57 + #!/bin/sh 58 + . git-sh-setup 59 + perl -pi -e 's|^Message-Id:\s*<?([^>]+)>?$|Link: https://lore.kernel.org/r/$1|g;' "$1" 60 + test -x "$GIT_DIR/hooks/commit-msg" && 61 + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 62 + : 63 + EOF 64 + $ chmod a+x .git/hooks/applypatch-msg