3 Replies
dys ๐Ÿ™
dys ๐Ÿ™โ€ข2y ago
For anyone interested in Bash, this is the .bashrc I've been adding to for the last 15 years: https://github.com/dysbulic/tip/blob/master/config/bash There's lots of different commands in there. Probably the one I use the most is:
function t() {
if [ -z "$*" ]; then
git commit -S -a
else
echo "Commit: $*"
git commit -S -am "$*"
fi
}
function t() {
if [ -z "$*" ]; then
git commit -S -a
else
echo "Commit: $*"
git commit -S -am "$*"
fi
}
This lets me type t this is my commit message & it'll do a git commit. That & before I run that, I'll run
function d() {
(
git -c color.ui=always status -v
git -c color.ui=always diff --staged
git -c color.ui=always diff
while IFS= read -r -d $'\0' file; do
isutf8 "$file" 2>&1 > /dev/null
IS_TEXT=$?
if [ -f "$file" ]; then
echo -e "\x1B[0;31mUntracked:\x1B[0m \x1B[1;33m$file\x1B[0m"
if [ $IS_TEXT -eq 0 ]; then
awk '{ print " " $0 }' "$file"
else
echo -e " \x1B[1;35mNot Printing Binaryโ€ฆ\x1B[0m"
fi
fi
done < <(git ls-files --others --exclude-standard -z)
) | bat
}
function d() {
(
git -c color.ui=always status -v
git -c color.ui=always diff --staged
git -c color.ui=always diff
while IFS= read -r -d $'\0' file; do
isutf8 "$file" 2>&1 > /dev/null
IS_TEXT=$?
if [ -f "$file" ]; then
echo -e "\x1B[0;31mUntracked:\x1B[0m \x1B[1;33m$file\x1B[0m"
if [ $IS_TEXT -eq 0 ]; then
awk '{ print " " $0 }' "$file"
else
echo -e " \x1B[1;35mNot Printing Binaryโ€ฆ\x1B[0m"
fi
fi
done < <(git ls-files --others --exclude-standard -z)
) | bat
}
Which shows me all the changes that're going to be committed with git commit -a.
Lofty!
Lofty!OPโ€ข2y ago
would you mind if I share this at other places?
dys ๐Ÿ™
dys ๐Ÿ™โ€ข2y ago
Not at all.
Want results from more Discord servers?
Add your server