Skip to content
Snippets Groups Projects
Commit aaf5c23b authored by Taico Aerts's avatar Taico Aerts
Browse files

Merge branch '261-developer-certificate-of-origin' into 'development'

Improve Explanation for Windows/Mac Users

See merge request !199
parents d2fd9684 9f321995
Branches
Tags
2 merge requests!201Development,!199Improve Explanation for Windows/Mac Users
......@@ -195,7 +195,47 @@ Signed-off-by: User Name <email@address>
where "User Name" is the author's real (legal) name and email@address is one of the author's valid email addresses.
As explained in more details above, this is easy to fix by running once the [setup_commit_msg_hook.sh](contributing/hooks/setup_commit_msg_hook.sh) script in your repository.
As explained in more details above, this is easy to fix by running once the [setup_commit_msg_hook.sh](contributing/hooks/setup_commit_msg_hook.sh) script in the root folder of the repository. If you are familiar with terminals, you probably know how to do this. If you use a special application for making commits, such as Sourcetree or GitKraken, or if you are working with git bash, then please refer to the instructions below.
#### Windows / Git Bash ####
If you are using Git Bash / Git Shell / Git Gui for windows then you can do the following to setup the commit hook.
1. Open the parent directory of the repository in Explorer, and use right click on the queue directory, git bash here.
![Git Bash Example](docs/GitBashExample.png)
1. In the window that opens, type
`sh contributing/hooks/setup_commit_msg_hook.sh`
and press enter
1. You should see a message stating that installation is successful
#### Mac / Git ####
If you are using Git on Mac then you can do the following to setup the commit hook.
1. Open a terminal
1. Navigate to the queue folder with the cd command
1. Type
`sh contributing/hooks/setup_commit_msg_hook.sh`
and press enter
1. You should see a message stating that installation is successful
#### Sourcetree ####
If you are using sourcetree, you need to ensure that sourcetree uses the system git.
1. Install Git Bash for [Windows](https://github.com/git-for-windows/git/releases/latest) / Install git for [Mac](https://git-scm.com/download/mac)
1. **Windows**: Open Git Bash, navigate to the queue folder and run the install script, as explained under [Windows / Git Bash](#windows___git_bash) above
1. **Mac**: Open a terminal, navigate to the queue folder and run the install script, as explained under [Mac / Git](#mac___git) above
1. Open sourcetree and click the Settings icon in the top right corner.
1. Go to the Git tab and click the `Use System Git` button as shown in the screenshot
![Sourcetree Settings](docs/SourceTreeExample.png)
1. Navigate to the folder where you installed git, select the git command and press OK.
1. Your commits made in Sourcetree will automatically be signed off
#### GitKraken and Other ####
If you are using GitKraken, you can execute the following instructions. The same will also work for many other git tools. If the program you use is not listed, try follow the instructions for Git Bash (Windows) / Git (Mac) and it is likely that your commits will automatically have the sign-off message after you make them in your git application of choice.
1. Install Git Bash for [Windows](https://github.com/git-for-windows/git/releases/latest) / Install git for [Mac](https://git-scm.com/download/mac)
1. **Windows**: Open Git Bash, navigate to the queue folder and run the install script, as explained under [Windows / Git Bash](#windows___git_bash) above
1. **Mac**: Open a terminal, navigate to the queue folder and run the install script, as explained under [Mac / Git](#mac___git) above
1. Your commits made in GitKraken will automatically be signed off
## Production
Queue runs on queue.tudelft.nl (alias for queue.ewi.tudelft.nl).
......
......@@ -2,11 +2,19 @@
#
# Put this script inside the root folder of your git directory before running it.
cat >.git/hooks/commit-msg <<'EOF'
if cat >.git/hooks/commit-msg<<'EOF'
#!/bin/sh
grep "^Signed-off-by:" "$1" || {
echo >>"$1"
echo "Signed-off-by: $(git config user.name) <$(git config user.email)>" >>"$1"
}
EOF
chmod +x .git/hooks/commit-msg
\ No newline at end of file
then
chmod +x .git/hooks/commit-msg || {
echo "Installation failed: failed to adjust permissions"
exit 1
}
echo "Installed git commit hook successfully"
else
echo "Installation failed: could not write the commit hook"
fi
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
File suppressed by a .gitattributes entry, the file's encoding is unsupported, or the file size exceeds the limit.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment