feat(git): remove commit subcommand & accept list of files for default behavior

This commit is contained in:
Ayo Ayco 2025-06-23 13:39:34 +02:00
parent 7140ca55e0
commit b5ced0b7ec
3 changed files with 18 additions and 18 deletions

View file

@ -1,4 +1,4 @@
# Scripts
# Ayo's Scripts
Personal BASH scripts for productivity
@ -25,10 +25,9 @@ $ vim ~/ayo.conf
1. journal - creates a new journal entry if it doesnt exist yet; opens on editor
1. append - append one thought at the end of the day's entry
1. notes - notes management
1. git (g) - git tools; default behavior is gs, gc, then gp ...
1. git (g) - args can be list of files to commit & push
1. stat (gs) - git status
2. commit (gc) - git commit (reads for message, accepts args as list of files to commit)
3. push (gp) - git push
1. push (gp) - git push
## Features
1. Autosync for notes & journal via git

13
ayo.sh
View file

@ -3,22 +3,19 @@
case $1 in
## SHORTCUTS
ja) # js - journal append
ja) # journal append
. ${HOME}/Projects/scripts/journal.sh append $2 $3 $4 $5 $6 $7 $8 $9
;;
js) # js - journal sync
js) # journal sync (same as ns)
. ${HOME}/Projects/scripts/journal.sh sync $2 $3 $4 $5 $6 $7 $8 $9
;;
ns) # js - journal sync
ns) # notes sync
. ${HOME}/Projects/scripts/notes.sh sync $2 $3 $4 $5 $6 $7 $8 $9
;;
gs) # js - journal sync
gs) # git status
. ${HOME}/Projects/scripts/git.sh stat $2 $3 $4 $5 $6 $7 $8 $9
;;
gc) # js - journal sync
. ${HOME}/Projects/scripts/git.sh commit $2 $3 $4 $5 $6 $7 $8 $9
;;
gp) # js - journal sync
gp) # git push
. ${HOME}/Projects/scripts/git.sh push $2 $3 $4 $5 $6 $7 $8 $9
;;

16
git.sh
View file

@ -21,7 +21,6 @@ gitStatus() {
gitCommit() {
{
echo "gitCommit called"
git add .
read -p "Message: " message
git commit -m "$message" $*
@ -42,15 +41,20 @@ gitPush() {
if [ "$1" = "stat" ]; then
gitStatus
elif [ "$1" = "commit" ]; then
gitCommit
elif [ "$1" = "push" ]; then
gitPush
else
gitStatus
if ! [ "$1" = "g" ]; then
echo ">>> $1"
if [ "$1" = "g" ] || [ "$1" = "git" ]; then
git reset HEAD -- .
git add .
git status
gitCommit
else
git reset HEAD -- .
git add $*
git status
gitCommit $*
fi
gitCommit
gitPush
fi