diff --git a/.gitattributes b/.gitattributes index 8027e271f2590997b0e5f57fa016818db2479f55..029d66a3fa532b66ef2f5d89f4fb2cfbcdaa5da9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,12 @@ .git* export-ignore .gitattributes -export-ignore +.hooks* export-ignore /GitSetup export-ignore /SetupForDevelopment.sh export-ignore eol=lf /clang-format.bash export-ignore eol=lf /.clang-format export-ignore -/CONTRIBUTING.rst conflict-marker-size=78 - *.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 @@ -16,3 +15,5 @@ *.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 + +*.rst whitespace=tab-in-indent conflict-marker-size=79 diff --git a/.hooks-config b/.hooks-config new file mode 100644 index 0000000000000000000000000000000000000000..739cdd268bbb44015171f0cc54d68c4d1f5e50bd --- /dev/null +++ b/.hooks-config @@ -0,0 +1,2 @@ +[hooks "chain"] + pre-commit = GitSetup/pre-commit diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 47dffee4ef5c30234f19955a251ec8203e0fb139..4ec64073d14b010b84660f3e84f8aff2ca917803 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,28 +1,27 @@ Contributing to KWSys ********************* -Overview -======== +Patches +======= KWSys is kept in its own Git repository and shared by several projects via copies in their source trees. Changes to KWSys should not be made directly in a host project, except perhaps in maintenance branches. -Please visit - - http://public.kitware.com/Wiki/KWSys/Git +KWSys uses `Kitware's GitLab Instance`_ to manage development and code review. +To contribute patches: -to contribute changes directly to KWSys upstream. Once changes are -reviewed, tested, and integrated there then the copies of KWSys within -dependent projects can be updated to get the changes. +#. Fork the upstream `KWSys Repository`_ into a personal account. +#. Base all new work on the upstream ``master`` branch. +#. Create commits making incremental, distinct, logically complete changes. +#. Push a topic branch to a personal repository fork on GitLab. +#. Create a GitLab Merge Request targeting the upstream ``master`` branch. -Issues -====== +Once changes are reviewed, tested, and integrated to KWSys upstream then +copies of KWSys within dependent projects can be updated to get the changes. -KWSys has no independent issue tracker. After encountering an issue -(bug) please try to submit a patch using the above instructions. -Otherwise please report the issue to the tracker for the project that -hosts the copy of KWSys in which the problem was found. +.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com +.. _`KWSys Repository`: https://gitlab.kitware.com/utils/kwsys Code Style ========== @@ -36,7 +35,6 @@ See also the `clang-format.bash`_ script. .. _`.clang-format`: .clang-format .. _`clang-format.bash`: clang-format.bash - License ======= diff --git a/GitSetup/config b/GitSetup/config index 07702142417f185f8ccc1c8aff30c19233db3137..cba4c14603144c9240ac79fc17b37189d96d07f1 100644 --- a/GitSetup/config +++ b/GitSetup/config @@ -1,6 +1,4 @@ [hooks] - url = http://public.kitware.com/GitSetup.git -[gerrit] - project = KWSys - site = http://review.source.kitware.com - pushurl = $username@review.source.kitware.com:KWSys + url = https://gitlab.kitware.com/utils/gitsetup.git +[upstream] + url = https://gitlab.kitware.com/utils/kwsys.git diff --git a/GitSetup/pre-commit b/GitSetup/pre-commit new file mode 100755 index 0000000000000000000000000000000000000000..1f1d3f52959b2c59598ccf19f94245caa9ef6614 --- /dev/null +++ b/GitSetup/pre-commit @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +egrep-q() { + egrep "$@" >/dev/null 2>/dev/null +} + +die() { + echo 'pre-commit hook failure' 1>&2 + echo '-----------------------' 1>&2 + echo '' 1>&2 + echo "$@" 1>&2 + exit 1 +} + +#----------------------------------------------------------------------------- + +# Check that developmer setup is up-to-date. +lastSetupForDevelopment=$(git config --get hooks.SetupForDevelopment || echo 0) +eval $(grep '^SetupForDevelopment_VERSION=' "${BASH_SOURCE%/*}/../SetupForDevelopment.sh") +test -n "$SetupForDevelopment_VERSION" || SetupForDevelopment_VERSION=0 +if test $lastSetupForDevelopment -lt $SetupForDevelopment_VERSION; then + die 'Developer setup in this work tree is out of date. Please re-run + + ./SetupForDevelopment.sh +' +fi diff --git a/GitSetup/setup-aliases b/GitSetup/setup-aliases index c6a3246400597176b995935d8eadc47de7ff7766..98810adcfe3774b5d331475a1cd6d6aa911b4912 100755 --- a/GitSetup/setup-aliases +++ b/GitSetup/setup-aliases @@ -1,6 +1,6 @@ #!/usr/bin/env bash echo "Adding 'git prepush' alias" && git config alias.prepush 'log --graph --stat origin/master..' && -echo "Adding 'git gerrit-push' alias" && -git config alias.gerrit-push "!bash GitSetup/git-gerrit-push" && +gerrit_disabled="KWSys no longer uses Gerrit. Please use GitLab." && +git config alias.gerrit-push '!sh -c "echo '"${gerrit_disabled}"'"' && true diff --git a/README.rst b/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..fc6b5902edcfe5a5c58d15868eef969d22d7374c --- /dev/null +++ b/README.rst @@ -0,0 +1,37 @@ +KWSys +***** + +Introduction +============ + +KWSys is the Kitware System Library. It provides platform-independent +APIs to many common system features that are implemented differently on +every platform. This library is intended to be shared among many +projects at the source level, so it has a configurable namespace. +Each project should configure KWSys to use a namespace unique to itself. +See comments in `CMakeLists.txt`_ for details. + +.. _`CMakeLists.txt`: CMakeLists.txt + +License +======= + +KWSys is distributed under the OSI-approved BSD 3-clause License. +See `Copyright.txt`_ for details. + +.. _`Copyright.txt`: Copyright.txt + +Reporting Bugs +============== + +KWSys has no independent issue tracker. After encountering an issue +(bug) please submit a patch using the instructions for `Contributing`_. +Otherwise please report the issue to the tracker for the project that +hosts the copy of KWSys in which the problem was found. + +Contributing +============ + +See `CONTRIBUTING.rst`_ for instructions to contribute. + +.. _`CONTRIBUTING.rst`: CONTRIBUTING.rst diff --git a/README.txt b/README.txt deleted file mode 100644 index b8191f7848f6a3f1ffc365acc50ef0a143b8e4c7..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,12 +0,0 @@ -KWSys provides a platform-independent API to many common system -features that are implemented differently on every platform. This -library is intended to be shared among many projects, so it has a -configurable namespace. Each project should configure KWSys to use a -namespace unique to itself. See comments in CMakeLists.txt for -details. - -You are probably reading this file in the source tree of a surrounding -project. In that case, see "../README.kwsys" for details of using -KWSys in your project. - -See CONTRIBUTING.rst for instructions to contribute KWSys changes. diff --git a/SetupForDevelopment.sh b/SetupForDevelopment.sh index 81499ad2ae5d2c75973a0ede74004ab6a0e76708..c3a2b1655bdbd3de49f9defcfaded72f53d7a19b 100755 --- a/SetupForDevelopment.sh +++ b/SetupForDevelopment.sh @@ -3,10 +3,18 @@ cd "${BASH_SOURCE%/*}" && GitSetup/setup-user && echo && GitSetup/setup-hooks && echo && -GitSetup/setup-gerrit && echo && GitSetup/setup-aliases && echo && +GitSetup/setup-upstream && echo && GitSetup/tips # Rebase master by default git config rebase.stat true git config branch.master.rebase true + +# Disable Gerrit hook explicitly so the commit-msg hook will +# not complain even if some gerrit remotes are still configured. +git config hooks.GerritId false + +# Record the version of this setup so Scripts/pre-commit can check it. +SetupForDevelopment_VERSION=2 +git config hooks.SetupForDevelopment ${SetupForDevelopment_VERSION}