Skip to content

Commit

Permalink
git
Browse files Browse the repository at this point in the history
  • Loading branch information
bhipple committed Feb 23, 2025
1 parent 1b77f20 commit b6a294b
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 264 deletions.
18 changes: 11 additions & 7 deletions bin/mk-git-aliases
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
#!/usr/bin/env bash
set -euxo pipefail

tmp=/tmp/git_aliases.zsh
tgt=$HOME/dotfiles/zsh/git_aliases.zsh

echo "# Generated by ../bin/mk-git-aliases; do not edit" > $tgt
rm -f $tmp

for c in $(git --help -a | grep '^ [a-z]' | grep -v grep | awk '{print $1}'); do
echo "alias g$c=\"git $c\"" | tee -a $tgt
echo "alias g$c=\"git $c\"" | tee -a $tmp
done

git la | grep -Ev '^g' | cut -d'=' -f1 | grep -v '-' | xargs -I{} echo 'alias g{}="git {}"' | tee -a $tgt
git la | grep -Ev '^g' | cut -d'=' -f1 | grep -v '-' | xargs -I{} echo 'alias g{}="git {}"' | tee -a $tmp

echo 'alias gg="git grep"' | tee -a $tmp
echo 'alias ggi="git grep -i"' | tee -a $tmp
echo 'alias gprs="git prs"' | tee -a $tmp
echo 'alias grf="git rf"' | tee -a $tmp

echo 'alias gg="git grep"' | tee -a $tgt
echo 'alias ggi="git grep -i"' | tee -a $tgt
echo 'alias gprs="git prs"' | tee -a $tgt
echo 'alias grf="git rf"' | tee -a $tgt
echo "# Generated by ../bin/mk-git-aliases; do not edit" > $tgt
cat $tmp | sort -u | tee -a $tgt
Loading

0 comments on commit b6a294b

Please sign in to comment.