<commit_before>= Redmine Github Hook

This plugin allows you to update your local Git repositories in Redmine when changes have been pushed to Github.

== Description

Redmine <http://redmine.org> has supported Git repositories for a long time, allowing you to browse your code and view your changesets directly in Redmine. For this purpose, Redmine relies on local clones of the Git repositories.

If your shared repository is on a remote machine - for example on Github - this unfortunately means a bit of legwork to keep the local, Redmine-accessible repository up-to-date. The common approach is to set up a cronjob that pulls in any changes with regular intervals and updates Redmine with them.

That approach works perfectly fine, but is a bit heavy-handed and cumbersome. The Redmine Github Hook plugin allows Github to notify your Redmine installation when changes have been pushed to a repository, triggering an update of your local repository and Redmine data only when it is actually necessary.


== Installation

1. Installing the plugin
   1. Install the json gem <http://json.rubyforge.org/> on the machine where Redmine is running.
   2. Follow the plugin installation procedure at http://www.redmine.org/wiki/redmine/Plugins.
   3. Restart your Redmine.
   4. If you already have a local Git repository set up and working from Redmine go to step 3, otherwise continue at step 2.

2. Adding a Git repository to a project (note, this should work whether you want to use Redmine Github Hook or not). Either follow the instructions at http://www.redmine.org/wiki/redmine/HowTo_keep_in_sync_your_git_repository_for_redmine or the ones below:
   1. Go to the directory on your Redmine machine where you want to keep your repository, for example /home/redmine/repositories/.
   2. Get a clone of the repository into that location: git clone git://github.com/koppen/redmine_github_hook.git. This creates a .git directory at /home/redmine/repositories/redmine_github_hook/.git.
   3. Open Redmine in your browser and navigate to the Settings for the project you want to add a Git repository to.
   4. Under the Repository tab, choose Git as your SCM and enter the full path to the .git directory from step 2; /home/redmine/repositories/redmine_github_hook/.git/ . Click "Create".
   5. Click the new "Repository" link in the main navigation to verify that your repository integration works - this might take a while as Redmine is fetching all commits.

3. Connecting Github to Redmine
   1. Go to the repository Admin interface on Github.
   2. Under "Service Hooks" add a new "Post-Receive URL" of the format: "[redmine_installation_url]/github_hook" (for example "http://example.com/github_hook").
      1. By default, Github Hook assumes your Github repository name is the same as the project identifier in your Redmine installation. If this is not the case, you can specify the actual Redmine project identifier in the Post-Receive URL by using the format "[redmine_installation_url]/github_hook?project_id=[identifier]" (for example "http://example.com/github_hook?project_id=my_project").

That's it. Github will now send a HTTP POST to the Redmine Github Hook plugin whenever changes are pushed to Github. The plugin then takes care of pulling the changes to the local repository and updating the Redmine database with them.


== Assumptions

* Redmine 1.1 running on a *nix-like system. It will probably work on older versions as well.
* Git 1.5 or higher available on the commandline.


== License

Copyright (c) 2009 <NAME>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
<commit_msg>Get rid of our own instructions for adding a git repo to Redmine. Just use Redmines instructions to avoid confusion<commit_after>= Redmine Github Hook

This plugin allows you to update your local Git repositories in Redmine when changes have been pushed to Github.

== Description

Redmine <http://redmine.org> has supported Git repositories for a long time, allowing you to browse your code and view your changesets directly in Redmine. For this purpose, Redmine relies on local clones of the Git repositories.

If your shared repository is on a remote machine - for example on Github - this unfortunately means a bit of legwork to keep the local, Redmine-accessible repository up-to-date. The common approach is to set up a cronjob that pulls in any changes with regular intervals and updates Redmine with them.

That approach works perfectly fine, but is a bit heavy-handed and cumbersome. The Redmine Github Hook plugin allows Github to notify your Redmine installation when changes have been pushed to a repository, triggering an update of your local repository and Redmine data only when it is actually necessary.


== Installation

1. Installing the plugin
   1. Install the json gem <http://json.rubyforge.org/> on the machine where Redmine is running.
   2. Follow the plugin installation procedure at http://www.redmine.org/wiki/redmine/Plugins.
   3. Restart your Redmine.
   4. If you already have a local Git repository set up and working from Redmine go to step 3, otherwise continue at step 2.

2. Adding a Git repository to a project (note, this should work whether you want to use Redmine Github Hook or not). Simplyfollow the instructions at http://www.redmine.org/wiki/redmine/HowTo_keep_in_sync_your_git_repository_for_redmine

3. Connecting Github to Redmine
   1. Go to the repository Admin interface on Github.
   2. Under "Service Hooks" add a new "Post-Receive URL" of the format: "[redmine_installation_url]/github_hook" (for example "http://example.com/github_hook").
      1. By default, Github Hook assumes your Github repository name is the same as the project identifier in your Redmine installation. If this is not the case, you can specify the actual Redmine project identifier in the Post-Receive URL by using the format "[redmine_installation_url]/github_hook?project_id=[identifier]" (for example "http://example.com/github_hook?project_id=my_project").

That's it. Github will now send a HTTP POST to the Redmine Github Hook plugin whenever changes are pushed to Github. The plugin then takes care of pulling the changes to the local repository and updating the Redmine database with them.


== Assumptions

* Redmine 1.1 running on a *nix-like system. It will probably work on older versions as well.
* Git 1.5 or higher available on the commandline.


== License

Copyright (c) 2009 <NAME>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

{'fraction_non_alphanumeric': 0.04996003197442046, 'fraction_numerical': 0.0061284305888622435, 'mean_word_length': 4.389088298636037, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5057166', 'n_tokens_mistral': 1931, 'n_tokens_neox': 1840, 'n_words': 1080}