What is the best way (if any) to modify a particular file under our repository within a post_commit hook?
eg: I want to append a checksum line to a somefile.conf file
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t do this in a hook — do it in a separate change, that other users of that branch can then pull down into their working copy. It doesn’t need to be more complicated than this (in pseudocode):
It’s not uncommon for build scripts (running under cron or triggered by a Makefile) to make periodic revisions to a repository, for example regenerating files based on other files. Sometimes these are checked into the repository and sometimes they aren’t, depending on who consumes these files and how.