Making sure your Gerrit changes aren’t broken

It’s a bit of an embarrassment when you submit a review to Gerrit only to have it fail CI checks immediately because of something as simple as a syntax error or pep8 failure that you should have caught yourself before submitting…but you forgot to run your validations before submitting the change. In many cases you can alleviate this through the use of the git pre-commit hook, which will run every time you commit changes locally.
read more →

A collection of git tips

This is a small collection of simple git tips and tricks I use to make my life easier. Quickly amend an existing commit with new files I have this alias in place that will amend the current commit while automatically re-using the existing commit message: alias.fix=commit –amend -C HEAD With this in place, fixing a review becomes: $ vim some/file/somewhere $ git add -u $ git fix Which I find much more convenient than git commit –amend, following by saving the commit message.
read more →

Automatic git cache

This post is in response to a comment someone made on irc earlier today: [I] would really like a git lookaside cache which operated on an upstream repo, but pulled objects locally when they’re available In this post I present a proof-of-concept solution to this request. Please note that thisand isn’t something that has actually been used or tested anywhere! If you access a git repository via ssh, it’s easy to provide a wrapper for git operations via the command= option in an authorized_keys file.
read more →

Teach git about GIT_SSL_CIPHER_LIST

Someone named hithard on StackOverflow was trying to clone a git repository via https, and was running into an odd error: “Cannot communicate securely with peer: no common encryption algorithm(s).”. This was due to the fact that the server (openhatch.org) was configured to use a cipher suite that was not supported by default in the underlying SSL library (which could be either OpenSSL or NSS, depending on how git was built).
read more →

Using tools badly: time shifting git commits with Workinghours

This is a terrible hack. If you are easily offended by bad ideas implemented poorly, move along! You are working on a wonderful open source project…but you are not supposed to be working on that project! You’re supposed to be doing your real work! Unfortunately, your extra-curricular activity is well documented in the git history of your project for all to see: And now your boss knows why the TPS reports are late.
read more →