CMake/Utilities/GitSetup
Arkadiusz Drabczyk 5129e97285 setup-user: switch to git-var to check if username and e-mail are set
In git, apart from setting username and e-mail in .gitconfig it's also
possible to set username in /etc/passwd and set e-mail using EMAIL
environment variable.  The advantage of this method is that other
programs such as mutt or doxygen will pick up these settings up so
there is no need to set them separately in each program.  Current way
of checking if username and e-mail are set using git config results in
failure if they are set using this method.
2019-11-24 19:10:56 +01:00
..
.gitattributes GitSetup: Tell Git not to export .gitattributes 2017-01-30 16:53:14 -05:00
config SetupForDevelopment: Drop cmake.org remote repo configuration 2017-03-03 13:31:49 -05:00
LICENSE Merge branch 'setup' into developer-setup 2012-03-02 13:28:11 -05:00
NOTICE Merge branch 'setup' into developer-setup 2012-03-02 13:28:11 -05:00
README Merge branch 'upstream-GitSetup' into developer-setup 2017-01-30 16:45:48 -05:00
setup-hooks Merge branch 'upstream-GitSetup' into update-gitsetup 2017-11-30 14:55:34 -05:00
setup-user setup-user: switch to git-var to check if username and e-mail are set 2019-11-24 19:10:56 +01:00
tips Merge branch 'upstream-GitSetup' into update-gitsetup 2017-11-30 14:55:34 -05:00

Kitware Local Git Setup Scripts


Introduction
------------

This is a collection of local Git development setup scripts meant for
inclusion in project source trees to aid their development workflow.
Project-specific information needed by the scripts may be configured
in a "config" file added next to them in the project.


Import
------

A project may import these scripts into their source tree by
initializing a subtree merge.  Bring up a Git prompt and set the
current working directory inside a clone of the target project.
Fetch the "setup" branch from the GitSetup repository:

 $ git fetch ../GitSetup setup:setup

Prepare to merge the branch but place the content in a subdirectory.
Any prefix (with trailing '/') may be chosen so long as it is used
consistently within a project through the rest of these instructions:

 $ git merge -s ours --no-commit setup
 $ git read-tree -u --prefix=Utilities/GitSetup/ setup

Commit the merge with an informative message:

 $ git commit
 ------------------------------------------------------------------------
 Merge branch 'setup'

 Add Utilities/GitSetup/ directory using subtree merge from
 the general GitSetup repository "setup" branch.
 ------------------------------------------------------------------------

Optionally add to the project ".gitattributes" file the line

 /Utilities/GitSetup export-ignore

to exclude the GitSetup directory from inclusion by "git archive"
since it does not make sense in source tarballs.


Configuration
-------------

Read the "Project configuration instructions" comment in each script.
Add a "config" file next to the scripts with desired configuration
(optionally copy and modify "config.sample").  For example, to
configure the "setup-hooks" script:

 $ git config -f Utilities/GitSetup/config hooks.url "$url"

where "$url" is the project repository publishing the "hooks" branch.
When finished, add and commit the configuration file:

 $ git add Utilities/GitSetup/config
 $ git commit


Update
------

A project may update these scripts from the GitSetup repository.
Bring up a Git prompt and set the current working directory inside a
clone of the target project.  Fetch the "setup" branch from the
GitSetup repository:

 $ git fetch ../GitSetup setup:setup

Merge the "setup" branch into the subtree:

 $ git merge -X subtree=Utilities/GitSetup setup

where "Utilities/GitSetup" is the same prefix used during the import
setup, but without a trailing '/'.


License
-------

Distributed under the Apache License 2.0.
See LICENSE and NOTICE for details.