1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00

chore: format everything

This commit is contained in:
oddlama 2024-11-26 13:34:55 +01:00
parent deca311c68
commit 7ccd7856ee
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
162 changed files with 4750 additions and 3718 deletions

View file

@ -2,7 +2,8 @@
lib,
pkgs,
...
}: {
}:
{
home.packages = with pkgs; [
git-filter-repo
git-fuzzy
@ -66,25 +67,30 @@
gca = "git commit -v -S --amend";
gcl = "git clone";
gcr = "git commit-reuse-message -v -S";
gf = lib.getExe (pkgs.writeShellApplication {
name = "git-fixup-fzf";
runtimeInputs = [pkgs.fzf pkgs.gnugrep];
text = ''
if ! commit=$(set +o pipefail; git log --graph --color=always --format="%C(auto)%h%d %s %C(reset)%C(bold)%cr" "$@" \
| fzf --ansi --multi --no-sort --reverse --print-query --expect=ctrl-d --toggle-sort=\`); then
echo aborted
exit 0
fi
gf = lib.getExe (
pkgs.writeShellApplication {
name = "git-fixup-fzf";
runtimeInputs = [
pkgs.fzf
pkgs.gnugrep
];
text = ''
if ! commit=$(set +o pipefail; git log --graph --color=always --format="%C(auto)%h%d %s %C(reset)%C(bold)%cr" "$@" \
| fzf --ansi --multi --no-sort --reverse --print-query --expect=ctrl-d --toggle-sort=\`); then
echo aborted
exit 0
fi
sha=$(grep -o '^[^a-z0-9]*[a-z0-9]\{7\}[a-z0-9]*' <<< "$commit" | grep -o '[a-z0-9]\{7\}[a-z0-9]*')
if [[ -z "$sha" ]]; then
echo "Found no checksum for selected commit. Aborting."
exit 1
fi
sha=$(grep -o '^[^a-z0-9]*[a-z0-9]\{7\}[a-z0-9]*' <<< "$commit" | grep -o '[a-z0-9]\{7\}[a-z0-9]*')
if [[ -z "$sha" ]]; then
echo "Found no checksum for selected commit. Aborting."
exit 1
fi
git fixup "$sha" "$@"
'';
});
git fixup "$sha" "$@"
'';
}
);
gp = "git push";
gpf = "git push --force";
gs = "git s";