I make heavy use of of hooks in git, especially post-receive, to
do different kind of things (deploying the blog, running some scripts, updating
some checked out repos).
From time to time when I create new hooks they fail due to some weird reasons.
It’s hard to investigate because of the slightly different shell environment
the hooks use. But once pushed post-receive hooks won’t run again, so just
changing the hook won’t help.
There is an easy solution: pre-receive.
I came across this on Stack Overflow but I keep forgetting it, so here it is.
Add a pre-receive file in the hooks directory, make it executable and for
testing let it exit with a non-zero status:
If the pre-receive hook exits with success (exit 0) the non-existing-branch
will be created, just keep that in mind.
Now you’re free to throw whatever debug code you need into that pre-receive
file and see the output locally.
A few days ago antirez finally merged the SCAN algorithm written by
Pieter Noordhuis. With it it’s now possible
to iterate the whole keyspace (or specific values in a set/sorted set/hash)
without a huge performance impact on the rest of the server (as KEYS would do
blocking on huge datasets).
Read more about the usage in antirez’ blog or read the implementation
and explanation on github (I need to do that as well).
For end users the usage is documented.
After the code was finally merged into unstable and 2.8 I sat down bringing
that feature into the redis client library and with that also into
The client code is rather simple and was quickly merged (461dd43)
and is now also used in try.redis.
A small thing I discovered playing around and testing the new code was a
crashing bug (#1354) with numeric values, but this was fixed as
well. Another thing was that the 2.8 was not compiling after the fix was added,
due to some new code only in the unstable branch. In absence of an official CI
server for redis (we once had one, but it’s currently disabled
and will be back soon™) I went ahead and started the CI server on my own server:
Friday and Saturday I attended gitmerge, a free Git user conference
Friday was filled with lots of lightning talks with lots of interesting ideas,
projects and stories. I tried to collect most of the projects or slides in a
link list on pinboard. More info about each project can be found in
the git repo from the userday.
Saturday was planned as hackday. @mislav wanted to improve hub, a
wrapper for git. He listed the planned features in ticket #1. I
tried to help with that, but most mentioned issues were a little over my head
without ever have looked at the source. After a lot of code reading I could
atleast fix a little bug and comment on another issue.
To wrap things up, git merge was a nice little conference, showing off
interesting projects and ideas and I had a few little talks with nice people.
(Oh, and of course visiting Berlin is always nice)