• Uncategorized

    Skipping a GitLab Pipeline: `[skip ci]` Works, `[skip_ci]` Doesn’t

    I just found out how to prevent a pipeline from starting when pushing to GitLab by using the commit message. That saves a lot of effort. It means I don’t have to rush to manually cancel the pipeline if I forget that a push triggers it. (An idempotent CI job shouldn’t have any issues with this, but during the development phase…) GitLab lets you push a commit without triggering a pipeline – as long as you spell the magic word correctly. ## The two accepted forms GitLab recognizes exactly two keywords in the commit message: Capitalization doesn’t matter, [Skip CI] or [CI SKIP]work just as well. **Anything else is plain…

  • Git,  Korn Shell / Bash,  PowerShell,  Windows Bash

    Quick CRLF-to-LF Conversion in PowerShell Without `dos2unix`

    Although this topic has been discussed so often, I think I can still contribute something regarding CRLF/LF. You write a shell script on Windows, copy it to a Linux server, run it – and get: (Newer bash versions are even less helpful: cannot execute: required file not found.) The culprit is Windows line endings: **CRLF** (\r\n) instead of **LF** (\n). Bash treats the trailing \r as part of the command. If dos2unix is not at hand, PowerShell handles the conversion in a single line that isn’t particularly easy to remember: ## How it works – [IO.File]::ReadAllText($p) reads the whole file into a single string – line endings included. – -replace…