Object Audit with Java and Javers

Just a quick snippet Maven Integration pom.xml <dependency> <groupId>org.javers</groupId> <artifactId>javers-core</artifactId> <version>${javers.version}</version> </dependency> Calculate Changes in Object Graph package io.hascode; import org.javers.core.Changes; import org.javers.core.Javers; import org.javers.core.JaversBuilder; import org.javers.core.diff.Diff; public <T> Changes diff(T snapshot, T latest) { Javers javers = JaversBuilder.javers().build(); Diff diff = javers.compare(snapshot, latest); return diff.getChanges(); } Resources Javers Website

September 18, 2023 · 1 min · 50 words · Micha Kops

Git Snippets

Show commits from another branch not contained in current branch git cherry -v otherbranch + f7d6a569bb6912aac97fce9ac92c4302863fb0d9 thecommit Cherry pick without commit git cherry-pick -n HASH Using vimdiff for diff set it via git config git config --global diff.tool vimdiff git config --global merge.tool vimdiff set it via ~/.gitconfig [diff] tool = vimdiff [merge] tool = vimdiff Using vscode as diff and mergetool You need to have the shell integration installed (code binary in PATH) ...

March 1, 2010 · 4 min · 827 words · Micha Kops

Linux Snippets

These are not only linux snippets but also bash snippets and snippets using tools that run under Linux, *nix or sometimes even MacOSX, I should reorder this article someday ;) Settings for more reliable bash scripts set -euo pipefail this gives us …​ -e: exit script if a single command fails -u: exit script if an unset variable is used -o pipefail: return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status ...

March 1, 2010 · 15 min · 3006 words · Micha Kops