From f1a5583901e051ef4627bf8be08565c4b331e99a Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Mar 2017 15:13:55 -0400 Subject: update-third-party: Add helper to disable custom gitattributes Provide a helper function that import scripts can use when the third-party project defines custom Git attributes in its top-level `.gitattributes` file. These must be commented out because Git does not support custom attributes in a subdirectory where we where the third-party project is about to be merged. --- Utilities/Scripts/update-third-party.bash | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Utilities/Scripts/update-third-party.bash b/Utilities/Scripts/update-third-party.bash index 3b8358e..670946e 100644 --- a/Utilities/Scripts/update-third-party.bash +++ b/Utilities/Scripts/update-third-party.bash @@ -52,6 +52,14 @@ git_archive () { tar -C "$extractdir" -x } +disable_custom_gitattributes() { + pushd "${extractdir}/${name}-reduced" + # Git does not allow custom attributes in a subdirectory where we + # are about to merge the `.gitattributes` file, so disable them. + sed -i '/^\[attr\]/ {s/^/#/}' .gitattributes + popd +} + die () { echo >&2 "$@" exit 1 -- cgit v0.12 From 64490637840b05da7f0829aa52cae7f3923b805e Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 24 Mar 2017 14:51:46 -0400 Subject: update-kwsys: Disable custom gitattributes during import The KWSys `.gitattributes` file now defines custom attributes. Git does not support these in a subdirectory where we are about to place the content, so comment them out during import. This also ensures that the `our-c-style` attribute on KWSys sources does not activate the `format.clang-format` attribute on the third-party import branch. --- Utilities/Scripts/update-kwsys.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/Utilities/Scripts/update-kwsys.bash b/Utilities/Scripts/update-kwsys.bash index 83da8a4..d5485aa 100755 --- a/Utilities/Scripts/update-kwsys.bash +++ b/Utilities/Scripts/update-kwsys.bash @@ -15,6 +15,7 @@ readonly paths=" extract_source () { git_archive + disable_custom_gitattributes } export HOOKS_ALLOW_KWSYS=1 -- cgit v0.12 From fda80fde76c230dda8372bf9d7208520c40f3611 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Fri, 24 Mar 2017 13:30:34 -0400 Subject: KWSys 2017-03-24 (7e9f7b7b) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 7e9f7b7bdc8ac54006a40a775867022c4d678b06 (master). Upstream Shortlog ----------------- Brad King (3): 0af48083 Drop custom Git whitespace check attribute 6365886c Define a custom Git attribute to mark sources using our C style d22c2743 clang-format.bash: Use Git attributes to mark files for formatting Egor Pugin (3): ce44c58a FStream: Export ReadBOM() from shared library 04e24b2b ConsoleBuf: Remove export macro from BasicConsoleBuf template 858d5edd Encoding: Export CommandLineArguments from shared library --- .gitattributes | 20 ++++++++++++-------- ConsoleBuf.hxx.in | 3 +-- Encoding.hxx.in | 2 +- FStream.hxx.in | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitattributes b/.gitattributes index f2da782..8ce3d68 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,18 +2,22 @@ .gitattributes -export-ignore .hooks* export-ignore +# Custom attribute to mark sources as using our C code style. +#[attr]our-c-style whitespace=tab-in-indent format.clang-format + /GitSetup export-ignore /*.sh export-ignore eol=lf /*.bash export-ignore eol=lf /.clang-format export-ignore -*.c whitespace=tab-in-indent,no-lf-at-eof -*.h whitespace=tab-in-indent,no-lf-at-eof -*.h.in whitespace=tab-in-indent,no-lf-at-eof -*.cxx whitespace=tab-in-indent,no-lf-at-eof -*.hxx whitespace=tab-in-indent,no-lf-at-eof -*.hxx.in whitespace=tab-in-indent,no-lf-at-eof -*.txt whitespace=tab-in-indent,no-lf-at-eof -*.cmake whitespace=tab-in-indent,no-lf-at-eof +*.c our-c-style +*.c.in our-c-style +*.cxx our-c-style +*.h our-c-style +*.h.in our-c-style +*.hxx our-c-style +*.hxx.in our-c-style +*.cmake whitespace=tab-in-indent *.rst whitespace=tab-in-indent conflict-marker-size=79 +*.txt whitespace=tab-in-indent diff --git a/ConsoleBuf.hxx.in b/ConsoleBuf.hxx.in index cb58865..32e680c 100644 --- a/ConsoleBuf.hxx.in +++ b/ConsoleBuf.hxx.in @@ -25,8 +25,7 @@ namespace @KWSYS_NAMESPACE@ { #if defined(_WIN32) template > -class @KWSYS_NAMESPACE@_EXPORT BasicConsoleBuf - : public std::basic_streambuf +class BasicConsoleBuf : public std::basic_streambuf { public: typedef typename Traits::int_type int_type; diff --git a/Encoding.hxx.in b/Encoding.hxx.in index 6639efd..bf93f50 100644 --- a/Encoding.hxx.in +++ b/Encoding.hxx.in @@ -13,7 +13,7 @@ class @KWSYS_NAMESPACE@_EXPORT Encoding { public: // Container class for argc/argv. - class CommandLineArguments + class @KWSYS_NAMESPACE@_EXPORT CommandLineArguments { public: // On Windows, get the program command line arguments diff --git a/FStream.hxx.in b/FStream.hxx.in index 736214f..cf331a5 100644 --- a/FStream.hxx.in +++ b/FStream.hxx.in @@ -269,7 +269,7 @@ enum BOM // If a BOM exists, the stream is advanced to after the BOM. // This function requires a seekable stream (but not a relative // seekable stream). -BOM ReadBOM(std::istream& in); +@KWSYS_NAMESPACE@_EXPORT BOM ReadBOM(std::istream& in); } } -- cgit v0.12