]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
devel: provide external git diff driver for *.abi files [ci skip]
authorDaiki Ueno <dueno@redhat.com>
Mon, 16 Mar 2020 16:16:08 +0000 (17:16 +0100)
committerDaiki Ueno <ueno@gnu.org>
Sat, 30 May 2020 10:34:57 +0000 (12:34 +0200)
This adds an external diff driver for *.abi files, that shows only
interesting changes in those files.  This would be useful when adding
a new API.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
.gitattributes [new file with mode: 0644]
CONTRIBUTING.md
devel/git-abidiff-gnutls [new file with mode: 0755]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..d58d318
--- /dev/null
@@ -0,0 +1,2 @@
+# See devel/git-abidiff-gnutls for making this useful.
+devel/*.abi diff=abi
index 96fb7ff0cc7ac3810c28ddb3dd24cd71d8e5c5ff..b3bf9b6b5bc9935594679b98adb3f7e599b77996 100644 (file)
@@ -158,7 +158,7 @@ As such, some questions to answer before adding a new API:
 
 
 The make rule 'abi-check' verifies that the ABI remained compatible since
-the last tagged release. It relies on the git tree and abi-compliance-checker.
+the last tagged release. It relies on the git tree and libabigail.
 
 The above do not apply to the C++ library; this library's ABI should not
 be considered stable.
@@ -403,6 +403,12 @@ or adding new command line options to tools you need to run 'make
 files-update', review the output (when feasible) and commit it separately,
 e.g., with a message: "auto-generated files update".
 
+ The 'files-update' rule also regenerates the ABI dump files (.abi), used by
+the 'abi-check' rule to ensure library ABI compatibility. To make it easier
+to track actual changes to be made in those files, a git external diff
+driver is provided as `devel/git-abidiff-gnutls`. See the comment in the
+file for the instruction.
+
 
 # Guile bindings:
 
diff --git a/devel/git-abidiff-gnutls b/devel/git-abidiff-gnutls
new file mode 100755 (executable)
index 0000000..a550736
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# This is a diff driver that works on the .abi files during GnuTLS
+# development.  To use, copy this file to ~/.local/bin and issue the
+# following command to update your git configuration:
+#
+#   git config diff.abi.command ~/.local/bin/git-abidiff-gnutls
+
+top_srcdir=$(git rev-parse --show-toplevel)
+bold=$(tput bold)
+normal=$(tput sgr0)
+
+echo "${bold}$1${normal}"
+abidiff --suppressions "$top_srcdir/devel/libgnutls.abignore" \
+       --hd2 "$top_srcdir/lib/includes/gnutls/" \
+       "$2" "$5" || :