Skip to content

Instantly share code, notes, and snippets.

@phette23
Last active March 24, 2026 23:22
Show Gist options
  • Select an option

  • Save phette23/4266fdb18cdf24ef9a1137f59b7eac79 to your computer and use it in GitHub Desktop.

Select an option

Save phette23/4266fdb18cdf24ef9a1137f59b7eac79 to your computer and use it in GitHub Desktop.
Koha Development Notes

Git Bz

g checkout BUG # always work from a branch, helpful if it contains the BUG number
g bz apply BUG # apply patches from BUG to current branch
g bz edit BUG # lets you obsolete patches
g bz attach BUG HEAD # attach last commit to bug as patch
g bz attach BUG HEAD~N # attach last N commits as patches

For signing off, try git alias so '!f() { git rebase --interactive --exec "git commit --amend --signoff --no-edit" HEAD~$1; }; f' which lets you sign N commits at once with g so N. Then git bz attach BUG HEAD~N to replace the existing patches.

Code Style

Perltidy creates a reformatted copy of the file with a .tdy extension.

brew install perltidy
perltidy path/to/file.pl
diff path/to/file.pl path/to/file.pl.tdy
perltidy -pro=.perltidyrc path/to/file.pl # specify a config file

I'm using a tdydiff fish shell function (see other file) which diffs changed files from git status against their tidied versions.

function tdydiff --description 'run perltidy on all new & modified Perl files, showing differences'
set files (git status --porcelain | sed 's|^...||' | grep '\.p[lm]$')
for f in $files
echo "=== $f ==="
perltidy $f
diff -u $f $f.tdy
and echo "✅ file is tidy"
rm $f.tdy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment