Altering a Gerrit change (git-review workflow)

I don’t use git-review for Gerrit interactions. This is primarily because back in 2012/2013 I couldn’t get git-review installed, and someone presented me with an alternative that worked. Years later I realized that this was actually the documented way of pushing changes to Gerrit.

As a little introduction to what this workflow looks, and a comparison with git-review I have created 2 overview posts altering a gerrit change on the Wikimedia gerrit install. I’m not trying to convince you, either way, is better, merely show the similarities/difference and what is happening behind the scenes.

Be sure to take a look at the other post “Altering a Gerrit change (git workflow)

One prerequisite of this workflow is that you have git-review installed and a .gitreview file in your repository!

I’ll be taking a change from the middle of last year, rebasing it, making a change, and pushing it back for review. Fundamentally the 2 approaches do the same thing, just one (git-review) requires an external tool.

Read more

Altering a Gerrit change (git workflow)

I don’t use git-review for Gerrit interactions. This is primarily because back in 2012/2013 I couldn’t get git-review installed, and someone presented me with an alternative that worked. Years later I realized that this was actually the documented way of pushing changes to Gerrit.

As a little introduction to what this workflow looks, and a comparison with git-review I have created 2 overview posts altering a gerrit change on the Wikimedia gerrit install. I’m not trying to convince you, either way, is better, merely show the similarities/difference and what is happening behind the scenes.

Be sure to take a look at the other post “Altering a Gerrit change (git-review workflow)

I’ll be taking a change from the middle of last year, rebasing it, making a change, and pushing it back for review. Fundamentally the 2 approaches do the same thing, just one (git-review) requires an external tool.

Read more

Small commits

There are many blog posts and articles out there about making small git commits. I’m sure most people (including me) bring up the same few topics around why small commits are good and why we should all probably be making smaller commits.

In this post, I’ll look at some of the key topics from my perspective, and try to tie these topics to concrete examples from repositories that I have worked on. The topics are in no particular order, so be sure to give them all a read.

One thing to note is that “small” doesn’t necessarily mean small in terms of lines of code. Small here is also relative. Also, small commits can benefit you in many different places, but to stand the test of time they must end up in your main branch.

Git features during development

Git only takes full responsibility for your data when you commit

Commit Often, Perfect Later, Publish Once: Git Best Practices

Read more

Pushing patches to sr.ht git repos

I recently wrote a blog post using the taavi/laravel-socialite-mediawiki PHP library which is hosted on sr.ht.

sr.ht, or sourcehut is “is a collection of tools useful for software development”, including git repository hosting.

I had to make a change to the library, and this was my first time contributing to a sr.ht repository. The workflow was quite different from what I am used to and required quite some Googling before I came up with something that I was happy with. So here goes my workflow.

Workflow

Firstly, if you haven’t used sr.ht before you’ll need to create an account and set up some way of pushing code (SSH keys etc). There are some fairly good docs for this already for Setting up your account and first git repository, but you can stop at Creating a git repository.

Once you have an account set up you need to find the sr.ht repository that you want to work with. In my case that is at the URL https://git.sr.ht/~taavi/laravel-socialite-mediawiki

You can find a clone URL over on the right-hand side of the repo page, and you want to go ahead and clone the repo.

git clone https://git.sr.ht/~taavi/laravel-socialite-mediawikiCode language: PHP (php)

You then also want to fork the repo into your own sr.ht account. The button is also on the right.

(You can also use your local clone to send a git email, but I didn’t want to install this tooling)

Screenshot of a sr.ht repository with the clone information highlighted

Read more

My Git Aliases

Overtime key presses really add up, especially when you use certain tools all throughout the day.

Here are the bash and git aliases that I use for git to avoid doing some of these keypresses.

I’m not sure how many times a day I use these shortcuts, or how many key presses I skip, but I’m fairly sure my keyboard is thanking me.

Read more

gitgraph.js and codepen.io for git visualization

I was looking for a new tool for easily visualizing git branches and workflows to try and visually show how Gerrit works (in terms of git basics) to clear up some confusions. I spent a short while reading stackoverflow, although most of the suggestions weren’t really any good as I didn’t want to visualize a real repository, but a fake set of hypothetical branches and commits.

I was suggested Graphviz by a friend, and quickly found webgraphviz.com which was going in the right direction, but this would require me to learn how to write DOT graph files.

Eventually I found gitgraph.js, which is a small JavaScript library for visualizing branching ‘things’, such as git, well, mainly git, hence the name and produce graphics such as the one below.

Read more

My Joomla Component development workflow

Joomla20Symbol20Color20FLATMy first and currently only Joomla component development was for the SWA UK website. The component manages memberships, events, tickets, results and more and is a rewrite of a previous component for Joomla 1.

But in this post lets ignore what the component does and instead concentrate the development workflow that is used. After lots of research at the beginning of development I decided to ignore other  methods of developing a component and this is what I ended up coming up with.

Read more