Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to add license header info #475

Closed
wants to merge 1 commit into from
Closed

Script to add license header info #475

wants to merge 1 commit into from

Conversation

amygdala
Copy link
Contributor

@amygdala amygdala commented Dec 6, 2010

Here is the official pull req. for the precommit script which checks for and adds header information as necessary.
Here is the information about it:
http://groups.google.com/group/thinkupapp/msg/281302a1d585f1ae?hl=en

In brief, the idea is that if the script finds and modifies any files that are missing header info, the commit does not go through, and the user checks the new mods to make sure things are okay and 'adds' those files again. The second commit should then complete.

I have tested it on osx, and it should run the same on linux. It does require that python be installed, of course.

I have not tested it on Windows, as I am not set up to easily do that.
However, setup is probably a bit different on Windows, in particular the content of the .git/hooks/pre-commit file (see link above). It would also be good to double check that there are no script path name issues in windows. [However, there should not be].

Would one of you be set up to do a windows test?

@ginatrapani
Copy link
Member

I can test this on Windows, if not this week then early next. Will report back as soon as I do.

@ginatrapani
Copy link
Member

Just confirmed this works on Windows (using Cygwin w/ Python and git installed). Nice work, Amy. I'll add notes to README.md on usage and merge into master.

@ginatrapani
Copy link
Member

Done:
f2924b3

Two notes: I had to replace os.rename with shutil.move because it was throwing an error on Cygwin/Windows. shutil.move works everywhere, error free. Also, I added lic_header.py to .gitignore so no one checks in their modified script. The pre-commit hook file is the same on Windows, works the same way.

Grateful to have this, thanks again.

@amygdala
Copy link
Contributor Author

shutil.move works everywhere, error free.

Great, thanks very much for figuring that one out.

unruthless pushed a commit to unruthless/ThinkUp that referenced this pull request Apr 27, 2011
…s, can be used as a git pre-commit hook

* Replaced use of os.rename to shutil.move to avoid this error on Windows/Cygwin: http://bytes.com/topic/python/answers/41652-errno-18-invalid-cross-device-link-using-os-rename
* Added lic_header.py to .gitignore
* Added usage instructions to README.md
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants