Marcus Folkesson

Embedded Linux Artist

Don't forget the Jira tag in your git message

Don't forget the Jira tag in your git message I keep forgetting to add the Jira tag in my git messages. This is a problem as we use Jira for our project management and the Jira tag is used to link the commit to the issue. It is simply hard to get into my workflow for some reason. Some time ago, I wrote about pre-commit [1], a framework for managing and maintaining pre-commit hooks for git. By running hooks before any commit, many small pitfalls could be avoided - such as a missing Jira: tag! cover

TIL - Git bundle

TIL - Git bundle TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post The git bundle [1] subcommand has been around for many years but is something I came across quite recently. The command allows you to create, unpack, and manipulate bundles files, which are used to share git repositories without an active server. Think of it as just a git repository packed into a tar archive with a set of handy extras. cover

Increase the quality of your commits with pre-commit

Increase the quality of your commits with pre-commit pre-commit [1] is a framework for managing and maintaining pre-commit hooks for git. By running hooks before any commit, many small pitfalls could be avoided before being pushed and will spare reviewers time and energy. Such hooks could for example check that commit messages follow a specific format or that the code pass a lint test for a specific type of file. cover

TIL - git credential storage

TIL - git credential storage TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post When using SSH as transport protocol for connecting to remotes you could use a key without need to type a username nor password. Unfortunately, this is not possible when the underlaying protocol is HTTPS as it requires a username and password for every connection made.

Git version in cmake

Git version in CMake All applications have versions. The version should somehow be exposed in the application to make it possible to determine which application we are actually running. I've seen a plenty of variants on how this is achieved, some are good and some are really bad. Since it's such a common thing, I thought I'd show how I usually do it. I use to let CMake determine the version based on git describe and tags, the benefit's that it is part of the build process (i.e no extra step on the build server - I've seen it all...), and you will get right version information also for local builds.

TIL - git man-pages

TIL - git man-pages TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post I'm a big user of man-pages. Today I found a set of pages that I've not noticed before when I was reading man git: SEE ALSO gittutorial(7), gittutorial-2(7), giteveryday(7), gitcvs-migration(7), gitglossary(7), gitcore-tutorial(7), gitcli(7), The Git User’s Manual[1], gitworkflows(7) Especially

TIL - Git --color-moved

TIL - Git --color-moved TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Did you know that Git is able to detect moved blocks and use different colors from the usual added/removed lines? Me neither until now. The paremeter is --color-moved and has been around since v0.4.0, so there is no new feature. cover

TIL - Git jump

TIL - Git jump TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post The Git v2.40.0 was released [1] yesterday (2023-03-13) and one of the release notes that caught my eyes was this one: * "git jump" (in contrib/) learned to present the "quickfix list" to its standard output (instead of letting it consumed by the editor it invokes), and learned to also drive emacs/emacsclient. I'm familiar with the "quickfix list" in Vim as I have been using it for many years, I even wrote a small post [2] about it looong time ago. cover

Patch changelogs with git-notes

Patch changelogs with git-notes Git notes [1] is a neat function that has been around since v1.6.6. Notes is a kind of metadata that belongs to a certain commit but is stored separately (different git object) from the commit itself. The fact that it's a separate git object is important, it will therefor keep the commit hash intact, and as a bonus - it has its own diff log. Basic usage git-notes has support for add, append, copy edit, list, prune, remove and show subcommands. These subcommands is rather self-explanatory, so I will not describe them any further. cover

get_maintainers and git send-email

get_maintainers and git send-email Many with me prefer email as communication channel, especially for patches. Github, Gerrit and all other "nice" and "user friendly" tools that tries to "help" you to manage your submissions does not simply fit my workflow. As you may already know, all patches to the Linux kernel is by email. scripts/get_maintainer.pl (see [1] for more info about the process) is a handy tool that takes a patch as input and gives back a bunch of emails addresses. These email addresses is usually passed to git send-email [2] for submission.