Skip to content

Commit

Permalink
docs: update demo and README (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh authored Apr 1, 2024
1 parent 24474f5 commit 8168448
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ information about the current git branch and is inspired by
[![go](https://img.shields.io/static/v1?style=flat-square&label=&message=v1.22.0&logo=go&labelColor=282828&logoColor=9dbad4&color=9dbad4)](https://go.dev/)
[![semantic-release: angular](https://img.shields.io/static/v1?style=flat-square&label=semantic-release&message=angular&logo=semantic-release&labelColor=282828&logoColor=d8869b&color=8f3f71)](https://github.com/semantic-release/semantic-release)

![git-prompt-string](https://github.com/mikesmithgh/git-prompt-string/assets/10135646/80dd6b32-8155-4a07-9801-358f413ddbe8)
![git-prompt-string](https://github.com/mikesmithgh/git-prompt-string/assets/10135646/b89014f7-1af0-4e7a-93c1-e062b2916d60)


> [!WARNING]\
> 03/25/2024: git-prompt-string (previously bgps) is actively undergoing a major rewrite
>
> This is a breaking change that will simplify and improve maintainability of git-prompt-string
> [!NOTE]\
> Looking for [bgps](https://github.com/mikesmithgh/git-prompt-string/tree/v0.0.1)? git-prompt-string is the successor of bgps.
> bgps is still available on the tag [v0.0.1](https://github.com/mikesmithgh/git-prompt-string/tree/v0.0.1)
>
> If you prefer to keep using legacy bgps, then use the tag [v0.0.1](https://github.com/mikesmithgh/git-prompt-string/tree/v0.0.1)
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -77,7 +74,7 @@ mv git-prompt-string "$HOME/bin" # replace with your preferred directory that is

### Prompt configuration

Add git-prompt-string to your prompt. For example,
See the following for examples for a reference on how you could add git-prompt-string to your prompt.

#### [bash](https://www.gnu.org/software/bash/)

Expand Down Expand Up @@ -359,4 +356,5 @@ color_merging = 'blue'
- [bash-git-prompt](https://github.com/magicmonty/bash-git-prompt) - An informative and fancy bash prompt for Git users
- [zsh-git-prompt](https://github.com/olivierverdier/zsh-git-prompt) - Informative git prompt for zsh
- [starship](https://starship.rs/) - The minimal, blazing-fast, and infinitely customizable prompt for any shell!
- You can integrate git-prompt-string with starship or use starship's builtin git configurations.

34 changes: 11 additions & 23 deletions scripts/git-prompt-string-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

# gif generated with
# ffmpeg -i git-prompt-string-demo.mov -r 5 frame%04d.png
# gifski --quality 97 --motion-quality 97 --lossy-quality 97 --width 1200 --height 627 -o git-prompt-string.gif frame*.png
# gifski --quality 99 --motion-quality 99 --lossy-quality 99 --width 1200 --height 627 -o git-prompt-string.gif frame*.png

win= # replace with kitty window ID
delay='0.2'
win="$1" # kitty window ID
char_delay='0.2'
feed_delay='2.5'

if [[ -z "$win" ]]; then
printf "Please povide kitty window ID"
Expand All @@ -27,54 +28,41 @@ function feed_no_newline() {
for ((i = 0; i < ${#str}; i++)); do
char="${str:i:1}"
kitty_send_text "$char"
sleep "$delay"
sleep "$char_delay"
done
}

function feed() {
feed_no_newline "$@"
feed_str '\n'
sleep "$feed_delay"
}

function feed_str() {
str="$1"
kitty_send_text "$str"
sleep "$delay"
sleep "$char_delay"
}

feed clear
sleep 3
feed git reset --hard 7e47962
feed vi README.md
feed '/Installation'
feed 'OTODO: add demo'
feed_str '\x1b'
feed ':wq'
feed 'sed -i "16s/$/TODO: add demo/" README.md'
feed 'touch new_file.txt'
feed 'rm -f new_file.txt'
feed git add .
feed 'git commit -m "chore: add TODO message"'
feed 'git commit -am "chore: add TODO message"'
feed git merge
feed git mergetool
feed ':%diffg REMOTE'
feed ':wqa'
feed 'git checkout --theirs README.md && git add .'
feed 'git merge --abort'
feed git rebase
feed git rebase --abort
feed 'git reset --hard @{u}'
feed cd .git
feed cd -
feed 'rm -rf tmp/bare_repo && mkdir -p tmp/bare_repo && cd tmp/bare_repo'
feed git init --bare
feed cd -
feed git bisect HEAD~3
feed Y
feed git bisect start HEAD~3
feed git bisect reset
feed git checkout -b demo_branch
feed git push -u
sleep 2.5
feed git push origin :demo_branch
sleep 2.5
feed git checkout -
feed git branch -d demo_branch
feed clear

0 comments on commit 8168448

Please sign in to comment.