OK, so in this new version, I first make the change and *then* fix the indentation. Firstly, I think this is easier to follow (commit messages are also improved). Secondly, this gives the committers the option of just stopping after the first commit if they wish to live with the bad indentation. The third, again optional, commit is the .git-blame-ignore-revs file Douglas proposed, which should allow preventing the previous commit from messing up `git blame`. Do note, as mentioned in the patch, that it will need to be fixed up as applying patches with a different committer does change the commit hash. Between the option of not applying patch 2 and 3, not applying just patch 3, or applying all 3 patches, I hope there is something you all find acceptable :). John
list at johnericson.me
2021-Jul-06 14:10 UTC
[PATCH v2 1/3] Support finding Kerberos via pkg-config
From: John Ericson <git at JohnEricson.me> This makes cross compilation easier. N.B. the code that is now in the `else` branch should be indented a level, but this is not done as it made the diff very hard to read. The indentation will be fixed in a subsequent commit. --- configure.ac | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/configure.ac b/configure.ac index 3a14c2a7..a79be815 100644 --- a/configure.ac +++ b/configure.ac @@ -4580,6 +4580,44 @@ AC_ARG_WITH([kerberos5], AC_DEFINE([KRB5], [1], [Define if you want Kerberos 5 support]) KRB5_MSG="yes" + AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no]) + use_pkgconfig_for_krb5+ if test "x$PKGCONFIG" != "xno"; then + AC_MSG_CHECKING([if $PKGCONFIG knows about kerberos5]) + if "$PKGCONFIG" krb5; then + AC_MSG_RESULT([yes]) + use_pkgconfig_for_krb5=yes + else + AC_MSG_RESULT([no]) + fi + fi + if test "x$use_pkgconfig_for_krb5" = "xyes"; then + K5CFLAGS=`$PKGCONFIG --cflags krb5` + K5LIBS=`$PKGCONFIG --libs krb5` + CPPFLAGS="$CPPFLAGS $K5CFLAGS" + + AC_MSG_CHECKING([for gssapi support]) + if "$PKGCONFIG" krb5-gssapi; then + AC_MSG_RESULT([yes]) + AC_DEFINE([GSSAPI], [1], + [Define this if you want GSSAPI + support in the version 2 protocol]) + GSSCFLAGS="`$PKGCONFIG --cflags krb5-gssapi`" + GSSLIBS="`$PKGCONFIG --libs krb5-gssapi`" + CPPFLAGS="$CPPFLAGS $GSSCFLAGS" + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([whether we are using Heimdal]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> + ]], [[ char *tmp = heimdal_version; ]])], + [ AC_MSG_RESULT([yes]) + AC_DEFINE([HEIMDAL], [1], + [Define this if you are using the Heimdal + version of Kerberos V5]) ], + [AC_MSG_RESULT([no]) + ]) + else AC_PATH_TOOL([KRB5CONF], [krb5-config], [$KRB5ROOT/bin/krb5-config], [$KRB5ROOT/bin:$PATH]) @@ -4655,6 +4693,7 @@ AC_ARG_WITH([kerberos5], AC_CHECK_HEADER([gssapi_krb5.h], , [ CPPFLAGS="$oldCPP" ]) + fi fi if test -n "${rpath_opt}" ; then LDFLAGS="$LDFLAGS ${rpath_opt}${KRB5ROOT}/lib" -- 2.31.1
list at johnericson.me
2021-Jul-06 14:10 UTC
[PATCH v2 2/3] Re-indent code after the previous change
From: John Ericson <git at JohnEricson.me> This commit does nothing but fix the indentation problems caused by the last commit. It is separate so it can be ignored for git blame. --- configure.ac | 136 +++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/configure.ac b/configure.ac index a79be815..83719193 100644 --- a/configure.ac +++ b/configure.ac @@ -4618,82 +4618,82 @@ AC_ARG_WITH([kerberos5], [AC_MSG_RESULT([no]) ]) else - AC_PATH_TOOL([KRB5CONF], [krb5-config], - [$KRB5ROOT/bin/krb5-config], - [$KRB5ROOT/bin:$PATH]) - if test -x $KRB5CONF ; then - K5CFLAGS="`$KRB5CONF --cflags`" - K5LIBS="`$KRB5CONF --libs`" - CPPFLAGS="$CPPFLAGS $K5CFLAGS" - - AC_MSG_CHECKING([for gssapi support]) - if $KRB5CONF | grep gssapi >/dev/null ; then - AC_MSG_RESULT([yes]) - AC_DEFINE([GSSAPI], [1], - [Define this if you want GSSAPI - support in the version 2 protocol]) - GSSCFLAGS="`$KRB5CONF --cflags gssapi`" - GSSLIBS="`$KRB5CONF --libs gssapi`" - CPPFLAGS="$CPPFLAGS $GSSCFLAGS" - else - AC_MSG_RESULT([no]) - fi - AC_MSG_CHECKING([whether we are using Heimdal]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> - ]], [[ char *tmp = heimdal_version; ]])], - [ AC_MSG_RESULT([yes]) - AC_DEFINE([HEIMDAL], [1], - [Define this if you are using the Heimdal - version of Kerberos V5]) ], - [AC_MSG_RESULT([no]) - ]) - else - CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" - LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" - AC_MSG_CHECKING([whether we are using Heimdal]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> - ]], [[ char *tmp = heimdal_version; ]])], + AC_PATH_TOOL([KRB5CONF], [krb5-config], + [$KRB5ROOT/bin/krb5-config], + [$KRB5ROOT/bin:$PATH]) + if test -x $KRB5CONF ; then + K5CFLAGS="`$KRB5CONF --cflags`" + K5LIBS="`$KRB5CONF --libs`" + CPPFLAGS="$CPPFLAGS $K5CFLAGS" + + AC_MSG_CHECKING([for gssapi support]) + if $KRB5CONF | grep gssapi >/dev/null ; then + AC_MSG_RESULT([yes]) + AC_DEFINE([GSSAPI], [1], + [Define this if you want GSSAPI + support in the version 2 protocol]) + GSSCFLAGS="`$KRB5CONF --cflags gssapi`" + GSSLIBS="`$KRB5CONF --libs gssapi`" + CPPFLAGS="$CPPFLAGS $GSSCFLAGS" + else + AC_MSG_RESULT([no]) + fi + AC_MSG_CHECKING([whether we are using Heimdal]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> + ]], [[ char *tmp = heimdal_version; ]])], [ AC_MSG_RESULT([yes]) - AC_DEFINE([HEIMDAL]) - K5LIBS="-lkrb5" - K5LIBS="$K5LIBS -lcom_err -lasn1" - AC_CHECK_LIB([roken], [net_write], - [K5LIBS="$K5LIBS -lroken"]) - AC_CHECK_LIB([des], [des_cbc_encrypt], - [K5LIBS="$K5LIBS -ldes"]) - ], [ AC_MSG_RESULT([no]) - K5LIBS="-lkrb5 -lk5crypto -lcom_err" - ]) - AC_SEARCH_LIBS([dn_expand], [resolv]) + AC_DEFINE([HEIMDAL], [1], + [Define this if you are using the Heimdal + version of Kerberos V5]) ], + [AC_MSG_RESULT([no]) + ]) + else + CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" + LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" + AC_MSG_CHECKING([whether we are using Heimdal]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <krb5.h> + ]], [[ char *tmp = heimdal_version; ]])], + [ AC_MSG_RESULT([yes]) + AC_DEFINE([HEIMDAL]) + K5LIBS="-lkrb5" + K5LIBS="$K5LIBS -lcom_err -lasn1" + AC_CHECK_LIB([roken], [net_write], + [K5LIBS="$K5LIBS -lroken"]) + AC_CHECK_LIB([des], [des_cbc_encrypt], + [K5LIBS="$K5LIBS -ldes"]) + ], [ AC_MSG_RESULT([no]) + K5LIBS="-lkrb5 -lk5crypto -lcom_err" + ]) + AC_SEARCH_LIBS([dn_expand], [resolv]) - AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], - [ AC_DEFINE([GSSAPI]) - GSSLIBS="-lgssapi_krb5" ], - [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], + AC_CHECK_LIB([gssapi_krb5], [gss_init_sec_context], [ AC_DEFINE([GSSAPI]) - GSSLIBS="-lgssapi" ], - [ AC_CHECK_LIB([gss], [gss_init_sec_context], + GSSLIBS="-lgssapi_krb5" ], + [ AC_CHECK_LIB([gssapi], [gss_init_sec_context], [ AC_DEFINE([GSSAPI]) - GSSLIBS="-lgss" ], - AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) + GSSLIBS="-lgssapi" ], + [ AC_CHECK_LIB([gss], [gss_init_sec_context], + [ AC_DEFINE([GSSAPI]) + GSSLIBS="-lgss" ], + AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail])) + ]) ]) - ]) - AC_CHECK_HEADER([gssapi.h], , - [ unset ac_cv_header_gssapi_h - CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" - AC_CHECK_HEADERS([gssapi.h], , - AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail]) - ) - ] - ) + AC_CHECK_HEADER([gssapi.h], , + [ unset ac_cv_header_gssapi_h + CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" + AC_CHECK_HEADERS([gssapi.h], , + AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail]) + ) + ] + ) - oldCPP="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" - AC_CHECK_HEADER([gssapi_krb5.h], , - [ CPPFLAGS="$oldCPP" ]) + oldCPP="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" + AC_CHECK_HEADER([gssapi_krb5.h], , + [ CPPFLAGS="$oldCPP" ]) - fi + fi fi if test -n "${rpath_opt}" ; then LDFLAGS="$LDFLAGS ${rpath_opt}${KRB5ROOT}/lib" -- 2.31.1
list at johnericson.me
2021-Jul-06 14:10 UTC
[PATCH v2 3/3] Add .git-blame-ignore-revs file as suggested on mailing list
From: John Ericson <git at JohnEricson.me> This allows indentation fixes to not wreck `git blame` so badly. Committer note: Fix commit hash after applying prefix patch, or this will not work. --- .git-blame-ignore-revs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..05e87075 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,12 @@ +# Since version 2.23 (released in August 2019), git-blame has a feature +# to ignore or bypass certain commits. +# +# This file contains a list of commits that are not likely what you +# are looking for in a blame, such as mass reformatting or renaming. +# You can set this file as a default ignore file for blame by running +# the following command. +# +# $ git config blame.ignoreRevsFile .git-blame-ignore-revs + +# Re-indent code after the previous change +0c31352463c505092d197bce3186f3ec715c4271 -- 2.31.1