diff options
author | Daiki Ueno <dueno@redhat.com> | 2020-03-16 17:16:08 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2020-05-30 12:34:57 +0200 |
commit | e3bb315530455462a6d78b954b452f2a7ae09e09 (patch) | |
tree | 703c285df864f40a87f6250906a6fe773cb023d1 | |
parent | 6df0dab742b4ee5bd3fa55680657326305bde8cc (diff) | |
download | gnutls-tmp-abi-check.tar.gz |
devel: provide external git diff driver for *.abi files [ci skip]tmp-abi-check
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>
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | CONTRIBUTING.md | 8 | ||||
-rwxr-xr-x | devel/git-abidiff-gnutls | 16 |
3 files changed, 25 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..d58d318a6c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# See devel/git-abidiff-gnutls for making this useful. +devel/*.abi diff=abi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96fb7ff0cc..b3bf9b6b5b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 index 0000000000..a5507360d0 --- /dev/null +++ b/devel/git-abidiff-gnutls @@ -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" || : |