I wanted to use Subversion to checkout one of my GitHub repo branches, because an svn checkout only downloads the files it needs, not a full copy of every file ever added. But I discovered that GitHub sunset Subversion integration earlier this year. Sad face. Still, I suppose the economics justify that decision. As a consequence of my research, which was a bit sketchy because there is still heaps of documentation out there referring to the GitHub features which no longer exist, I did happen to learn about:
Tag Archives: svn
Exclude hidden .svn files from grep query
To exclude .svn directories from a recursive grep, use the –exclude option, for example:
$ grep --exclude='*.svn*' -R 'your.*search' .
Preserving file modification time in Subversion (svn)
Today I found this thread from which I learned:
svn co --config-option config:miscellany:use-commit-times=yes https://example.com/svn/repo/proj
You can also set the option in your svn config, but you probably don’t want to do that.
svn propset svn:executable on my-script
To mark a file in svn as executable:
svn propset svn:executable ON my-script
How to escape @ characters in Subversion file names?
Found how to escape @ characters in Subversion managed file names?. The short answer is that you add an extra ‘@’ character at the end of the file name…
Setting svn:ignore from the command line
Today I had to lookup how to set svn:ignore from the command line:
$ svn propset svn:ignore [file|folder] [path]
Exclude .svn directories from grep
Today I learned how to Exclude .svn directories from grep:
grep -R --exclude-dir=".svn" search .
Error: post-commit hook failed (exit code 255) with no output
In subversion I was getting the error “post-commit hook failed (exit code 255) with no output” after trying to configure my post-commit hook to send email notifications. At first I thought the problem must have been related to the mailer, but I ran the mail command manually and it worked fine. Eventually I figured out that the problem was that the hooks/post-commit file hadn’t been marked executable. So it was a simple chmod +x to fix the problem.
SVNIndexXSLT
Today I learned about the SVNIndexXSLT Apache directive that lets you configure an XSLT stylesheet for your Subversion repository. Also found a whole web-site ReposStyle which makes me laugh — seems like overkill having a whole web-site for a repository stylesheet…
How To Set Cron to Run Every 5 Minutes
Thanks to this handy document How To Set Cron to Run Every 5 Minutes I now my crontab configured so that my jj5-test repo gets updated every five minutes. It’s the sort of thing I generally do in a post-commit hook, but in this case that won’t work owing to the way the servers are configured (the files are in my account and not owned by the www-data user the commit-hook runs as).
So to configure cron I issued the command:
$ crontab -e
And then to update my svn working copy:
# m h dom mon dow command */5 * * * * cd /home/jj5/web/test && svn update > /dev/null