git aliases
This commit is contained in:
@@ -5,22 +5,31 @@
|
|||||||
git
|
git
|
||||||
delta
|
delta
|
||||||
|
|
||||||
# only works on spec arch, chage url for others
|
(pkgs.writeShellScriptBin "git_monitor" ''
|
||||||
# (stdenv.mkDerivation {
|
#!/bin/bash
|
||||||
# name = "easycommit";
|
|
||||||
# src = pkgs.fetchurl {
|
# List of directories to check
|
||||||
# url = "https://github.com/blackironj/easycommit/releases/download/v0.0.1/easycommit-v0.0.1-linux-amd64.tar.gz";
|
directories=(
|
||||||
# sha256 = "sha256-Ip5wfVe/RzCxGGh1YFBllAn84nD7mUXbnMko+ue/C2E=";
|
"$HOME/nix-dots"
|
||||||
# };
|
"$HOME/shared/nx-obsidian-vault"
|
||||||
# phases = ["installPhase"];
|
"$HOME/shared/HSMW/Praxis/BCAM/bolt-llmserver"
|
||||||
# installPhase = ''
|
"$HOME/shared/HSMW/Praxis/BCAM/bcam-tools"
|
||||||
# mkdir -p $out/bin
|
)
|
||||||
# tar xf $src -C $out/
|
echo ""
|
||||||
# ls -la $out
|
for dir in "''${directories[@]}"; do
|
||||||
# mv $out/easycommit $out/bin/
|
if [ -d "$dir" ]; then
|
||||||
# chmod +x $out/bin/easycommit
|
cd "$dir" || { echo "Cannot change directory to $dir"; exit 1; }
|
||||||
# '';
|
echo "$(echo $dir | rev | cut -f 1 -d'/' | rev):"
|
||||||
# })
|
gst
|
||||||
|
echo ""
|
||||||
|
cd - > /dev/null || { echo "Cannot change back to the original directory"; exit 1; }
|
||||||
|
else
|
||||||
|
echo "Directory $dir does not exist."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'')
|
||||||
|
|
||||||
|
(writeShellScriptBin "gst" "awk -vOFS='' 'NR==FNR {all[i++] = $0; difffiles[$1] = $0; next;} ! ($2 in difffiles) {print; next;} {gsub($2, difffiles[$2]); print;} END {if (NR != FNR) {exit;} for (i in all) {print all[i];}}' <(git diff --color --stat=$(($(tput cols) - 3)) HEAD | sed '$d; s/^ //') <(git -c color.status=always status -sb)")
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
{ config, pkgs, ...}:
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
waybar
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "git_monitor" ''
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# List of directories to check
|
|
||||||
directories=(
|
|
||||||
"$HOME/nix-dots"
|
|
||||||
"$HOME/shared/nx-obsidian-vault"
|
|
||||||
"$HOME/shared/HSMW/Praxis/BCAM/bolt-llmserver"
|
|
||||||
"$HOME/shared/HSMW/Praxis/BCAM/bcam-tools"
|
|
||||||
)
|
|
||||||
for dir in "''${directories[@]}"; do
|
|
||||||
echo "Checking git status in $dir"
|
|
||||||
# Check if the directory exists
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
# Change directory and run git status
|
|
||||||
cd "$dir" || { echo "Cannot change directory to $dir"; exit 1; }
|
|
||||||
git status
|
|
||||||
# Change back to the original directory
|
|
||||||
cd - > /dev/null || { echo "Cannot change back to the original directory"; exit 1; }
|
|
||||||
else
|
|
||||||
echo "Directory $dir does not exist."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
'')
|
|
||||||
|
|
||||||
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -52,6 +52,18 @@
|
|||||||
nn = "nano";
|
nn = "nano";
|
||||||
m = "micro";
|
m = "micro";
|
||||||
c = "codium";
|
c = "codium";
|
||||||
|
g = "git";
|
||||||
|
# gst = "git status";
|
||||||
|
gps = "git push";
|
||||||
|
gpl = "git pull";
|
||||||
|
gad = "git add";
|
||||||
|
gcm = "git commit -m ";
|
||||||
|
gsh = "git stash";
|
||||||
|
gsp = "git stash pop";
|
||||||
|
glg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all";
|
||||||
|
gll = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'";
|
||||||
|
gmt = "git_monitor";
|
||||||
|
|
||||||
code = "codium";
|
code = "codium";
|
||||||
# ya = "yazi"; # function
|
# ya = "yazi"; # function
|
||||||
nxfiglet = "figlet";
|
nxfiglet = "figlet";
|
||||||
|
|||||||
Reference in New Issue
Block a user