Code Maven

Welcome to the Code Maven!

The main topics

Programming Exercises for any language.

Enforce fast forward as merge strategy in Git

Some people like to see lots of branches and the way they are merged together in their git history. Others like to have nice straight line.

Some companies have a development workflow in which the only way to add to the "master" branch is to send a pull-request, get it reviewed, approved and then merged into "master". For them it might be useful to enforce that merging into master can be done only with a fast-forward merge.


Enforce fast forward as merge strategy in Git


Ansible playbook: print debugging statement

A simple Ansible playbook example showing how to print debugging statements.


Ansible playbook: print debugging statement


Enforcing commit message format in Git - on the client side

By default git allows you to include anything in a commit message. This freedom is nice, but when I need to look back on the commit history it is very useful to be able to connect commits to specific issues.

This could be done by including the issue number in every commit message. (Even if in your setting it is called ticket number or bug number.). e.g. #42.

Git provides ways to enforce that you every commit has such a string in it, but this enforcement can only be done on the server. Too late if I made several commit on the client without the required part.

You can, however, ask git on your own computer to help you enforce this rule.


Enforcing commit message format in Git - on the client side


Digital Ocean Virtual Private Server Hosting