Marcus Folkesson

Embedded Linux Artist

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.

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. 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. 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.