From 14295a8acaf9769b81fd15385f92b6fc6780c86f Mon Sep 17 00:00:00 2001 From: kevadesu Date: Sat, 18 Jan 2025 20:48:49 +0100 Subject: [PATCH 1/5] Revert "Update version" This reverts commit c95792338e87c871b5eb7d091c6d4f5088f1e744. THIS IS THE TESTING BRANCH :fire: --- Setup.sh | 2 +- main.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Setup.sh b/Setup.sh index de05528..979ebe0 100755 --- a/Setup.sh +++ b/Setup.sh @@ -103,7 +103,7 @@ Other: Input any path" echo "Ok!" ;; esac - sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.4/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." + sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.3/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." sudo chmod +x $INSTALL_PATH/gir || echo "FAIL | Either insufficient permissions or file does not exist or sudo does not exist." } diff --git a/main.sh b/main.sh index 754fc1d..87ccb9d 100755 --- a/main.sh +++ b/main.sh @@ -136,11 +136,11 @@ $(git --version) host system kernel: $(uname -sr) learn more about this release at: -https://github.com/Icycoide/Gir/releases/tag/v0.2.4" +https://github.com/Icycoide/Gir/releases/tag/v0.2.3" } function gir.variables() { - GIR_VERSION=0.2.4 + GIR_VERSION=testing } gir.variables From a73f49c1a5edb456d7eedd532cc9d97a84214c1d Mon Sep 17 00:00:00 2001 From: kevadesu Date: Sun, 19 Jan 2025 01:29:33 +0100 Subject: [PATCH 2/5] Fixed the multiple selection bug on Hash undo dialogs --- README.md | 43 ++++++++++++++++++++++++++++++++++++++----- Setup.sh | 2 +- main.sh | 4 ++-- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5f299f3..debaeb5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,44 @@ -# Gir -Combining Oh Shit, Git!?! and Gum - +# Gir [TESTING] +A Git wrapper combining Oh Shit, Git!?! and Gum ## What is this? -With the elements of [Gum](https://github.com/charmbracelet/gum) and [Oh Shit, Git!?!](https://ohshitgit.com/), I made an attempt at making a simple shell script that can combine the two together. +This is the direct testing branch of Gir. It currently has no practical way to install. Every change gets pushed to this repo. +## No, I meant what is this project? +Oh, right! +With the elements of [Gum](https://github.com/charmbracelet/gum) and [Oh Shit, Git!?!](https://ohshitgit.com/), I made an attempt at making a simple Git wrapper that can combine the two together. There's not much else to say.......except that the Setup...at least works -To install, grab the latest Setup.sh from [the latest release](https://github.com/Icycoide/Gir/releases/latest) and run it +## Installing the Testing branch +### ⚠️ BEFORE YOU PROCEED!!!! +You are using this branch at your OWN RISK. By installing the testing branch, YOU agree to NOT blame me for any fuck-ups occuring to your Git repo. Remember, this is not a way to "get the cool updates faster", this is the CONSTRUCTION site. +### you have been warned. +If you still want to install, proceed as followed: +1. **Clone the repository** +```bash +git clone https://github.com/Icycoide/Gir +``` +Make sure you remember where you put the repository! + +2. **Switch to testing branch** +```bash +git checkout testing +``` + +3. **Create a symlink to the file in the repository** +```bash +sudo ln -s /path/to/git/repository/main.sh /path/to/destination/for/binary/gir +``` + +## Updating +Updating is as simple as going to the source repository and running the following (assuming you didn't fuck up anything, in which case you'd have to reset to remote): +```bash +git pull +``` + +## (on the Testing branch only) Git won't let me do this without specifying -f! How do I make Gir force something?? +You launch Gir with the environment variable GIR_FORCEALL set to either 1, TRUE or true. Observe the example below: +```bash +GIR_FORCEALL=TRUE /path/to/executable/gir +``` This is licensed under the MIT license diff --git a/Setup.sh b/Setup.sh index 979ebe0..de05528 100755 --- a/Setup.sh +++ b/Setup.sh @@ -103,7 +103,7 @@ Other: Input any path" echo "Ok!" ;; esac - sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.3/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." + sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.4/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." sudo chmod +x $INSTALL_PATH/gir || echo "FAIL | Either insufficient permissions or file does not exist or sudo does not exist." } diff --git a/main.sh b/main.sh index 87ccb9d..33a297a 100755 --- a/main.sh +++ b/main.sh @@ -111,12 +111,12 @@ function gir.wrongbranch() { } function gir.undocommit() { - SEL_HASH=$(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) + SEL_HASH=$(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) git revert $SEL_HASH } function gir.undofile() { - git checkout $(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) -- $(gum file --show-help --all --file --directory --height=5 --selected.foreground="#fe640b" --cursor.foreground="#fe640b" --directory.foreground="#fe640b") + git checkout $(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) -- $(gum file --show-help --all --file --directory --height=5 --selected.foreground="#fe640b" --cursor.foreground="#fe640b" --directory.foreground="#fe640b") git commit -m "$(gum input --width 50 --placeholder "Summary of changes (wow you didnt even have to copy-paste to undo)")" \ -m "$(gum write --width 80 --placeholder "Details of changes")" } From 30ee585bd0034eb1629e2fe62a09fc2d00695d8f Mon Sep 17 00:00:00 2001 From: kevadesu Date: Sun, 19 Jan 2025 01:40:07 +0100 Subject: [PATCH 3/5] Fixed up colours, and more idk --- main.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.sh b/main.sh index 33a297a..31cdd19 100755 --- a/main.sh +++ b/main.sh @@ -29,15 +29,15 @@ function gir.main() { gum pager < $(gum file --height=5 --selected.foreground="#fe640b" --all --cursor.foreground="#fe640b" --directory.foreground="#fe640b") ;; "Add files to commit") - git add $(ls | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") + git add $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") ;; "Remove files from commit") case $GIR_FORCEALL in 1|TRUE|true) - git rm $(ls | gum filter --selected-indicator.foreground="#d20f39" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Remove files" --prompt="| " --indicator="> " --selected-prefix "REMOVE " --unselected-prefix " KEEP " --placeholder "Press TAB to select, Enter to confirm...") -f + git rm $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#d20f39" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Remove files" --prompt="| " --indicator="> " --selected-prefix "REMOVE " --unselected-prefix " KEEP " --placeholder "Press TAB to select, Enter to confirm...") -f ;; *) - git rm $(ls | gum filter --selected-indicator.foreground="#d20f39" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Remove files" --prompt="| " --indicator="> " --selected-prefix "REMOVE " --unselected-prefix " KEEP " --placeholder "Press TAB to select, Enter to confirm...") + git rm $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#d20f39" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Remove files" --prompt="| " --indicator="> " --selected-prefix "REMOVE " --unselected-prefix " KEEP " --placeholder "Press TAB to select, Enter to confirm...") ;; esac ;; @@ -55,7 +55,7 @@ function gir.main() { git stash ;; "Switch branch") - git checkout $(git branch | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select branch to switch to" --prompt="| " --indicator="> " | sed 's/* //g' | sed 's/ //g') + git checkout $(git branch | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select branch to switch to" --prompt="| " --indicator="> " | sed 's/* //g' | sed 's/ //g') ;; "(Re)initialise repository") git init @@ -91,7 +91,7 @@ function gir.timemachine() { function gir.tecommit() { gum confirm "Are you sure you want to amend the last commit? It is not recommended to do this with public commits" --selected.background="#fe640b" --prompt.foreground="#fe640b" || kill -INT $$ - git add $(ls | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") + git add $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") git commit --amend --no-edit } @@ -106,17 +106,17 @@ function gir.wrongbranch() { CORRECT_BRANCH=$(gum input --placeholder "Input the name of the correct branch") gum spin --spinner minidot --title "Running git checkout..." -- git checkout $CORRECT_BRANCH git stash pop - git add $(ls | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") + git add $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") git commit -m } function gir.undocommit() { - SEL_HASH=$(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) + SEL_HASH=$(git log --oneline | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) git revert $SEL_HASH } function gir.undofile() { - git checkout $(git log --oneline | gum filter --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) -- $(gum file --show-help --all --file --directory --height=5 --selected.foreground="#fe640b" --cursor.foreground="#fe640b" --directory.foreground="#fe640b") + git checkout $(git log --oneline | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select hash to undo" --prompt="| " --indicator="> " | cut -d' ' -f1) -- $(gum file --show-help --all --file --directory --height=5 --selected.foreground="#fe640b" --cursor.foreground="#fe640b" --directory.foreground="#fe640b") git commit -m "$(gum input --width 50 --placeholder "Summary of changes (wow you didnt even have to copy-paste to undo)")" \ -m "$(gum write --width 80 --placeholder "Details of changes")" } @@ -136,7 +136,7 @@ $(git --version) host system kernel: $(uname -sr) learn more about this release at: -https://github.com/Icycoide/Gir/releases/tag/v0.2.3" +https://github.com/Icycoide/Gir/releases/tag/v0.2.4" } function gir.variables() { From fa004b0c17dd6553ac7232a3512600fab44eb7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brotmetchaes=20=C2=B7=20kevadesu?= <76264518+kevadesu@users.noreply.github.com> Date: Sun, 19 Jan 2025 01:11:08 +0000 Subject: [PATCH 4/5] Final touches before merging Testing --- Setup.sh | 2 +- main.sh | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Setup.sh b/Setup.sh index de05528..b172633 100755 --- a/Setup.sh +++ b/Setup.sh @@ -103,7 +103,7 @@ Other: Input any path" echo "Ok!" ;; esac - sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.4/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." + sudo wget -O $INSTALL_PATH/gir https://github.com/Icycoide/Gir/releases/download/v0.2.5/main.sh || echo "FAIL | Either failed download or invalid path or sudo does not exist." sudo chmod +x $INSTALL_PATH/gir || echo "FAIL | Either insufficient permissions or file does not exist or sudo does not exist." } diff --git a/main.sh b/main.sh index 31cdd19..ec951c6 100755 --- a/main.sh +++ b/main.sh @@ -2,7 +2,7 @@ function gir.main() { clear - MENU_CHOICE=$(gum filter --header.foreground="#fe640b" --unselected-prefix.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --prompt="| " --indicator=">" --header="Repository: $PWD ($(git branch | grep "*" | sed 's/* //g'))" --placeholder="Option" "Time Machine" "Add addition to last commit" "Edit last commit's message" "Correct an edit to a different branch" "Diff with fancy flag" "Undo file" "Undo commit" "Read file" "Add files to commit" "Remove files from commit" "Commit" "Push changes" "Pull changes" "Stash changes" "Switch branch" "(Destructive) Reset to remote state" "(Re)initialise repository" "Information about current repo" "About" "Quit") + MENU_CHOICE=$(gum filter --header.foreground="#fe640b" --unselected-prefix.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --prompt="| " --indicator=">" --header="Repository: $PWD ($(git branch | grep "*" | sed 's/* //g'))" --placeholder="Option" "Time Machine" "Add addition to last commit" "Edit last commit's message" "Correct an edit to a different branch" "Diff with fancy flag" "Undo file" "Undo commit" "Read file" "Add files to commit" "Remove files from commit" "Commit" "Push changes" "Pull changes" "Stash changes" "Switch branch" "Make new branch" "(Destructive) Reset to remote state" "(Re)initialise repository" "Information about current repo" "About" "Quit") case $MENU_CHOICE in "Time Machine") gir.timemachine @@ -55,7 +55,10 @@ function gir.main() { git stash ;; "Switch branch") - git checkout $(git branch | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --header "Select branch to switch to" --prompt="| " --indicator="> " | sed 's/* //g' | sed 's/ //g') + git checkout $(git branch | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-strict --header "Select branch to switch to" --prompt="| " --indicator="> " | sed 's/* //g' | sed 's/ //g') + ;; + "Make new branch") + git checkout -b $(gum input --cursor.foreground="#fe640b" --placeholder "Enter the name of the new branch (no spaces, only hyphens) or leave empty to cancel. (Basing off $(git branch | grep "*"))") ;; "(Re)initialise repository") git init @@ -103,8 +106,7 @@ function gir.editcommit() { function gir.wrongbranch() { gum spin --spinner minidot --title "Undoing last commit..." -- git reset HEAD~ --soft git stash - CORRECT_BRANCH=$(gum input --placeholder "Input the name of the correct branch") - gum spin --spinner minidot --title "Running git checkout..." -- git checkout $CORRECT_BRANCH + git checkout $(git branch | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-strict --header "Select the correct branch to commit to" --prompt="| " --indicator="> " | sed 's/* //g' | sed 's/ //g') git stash pop git add $(ls | gum filter --header.foreground="#fe640b" --selected-indicator.foreground="#fe640b" --indicator.foreground="#fe640b" --match.foreground="#fe640b" --no-limit --header "Add files" --prompt="| " --indicator="> " --selected-prefix "YES " --unselected-prefix " NO " --placeholder "Press TAB to select, Enter to confirm...") git commit -m @@ -136,7 +138,7 @@ $(git --version) host system kernel: $(uname -sr) learn more about this release at: -https://github.com/Icycoide/Gir/releases/tag/v0.2.4" +https://github.com/Icycoide/Gir/releases/tag/v0.2.5" } function gir.variables() { From 951a58cb9ad3875a08a3c1744e05ecb25c9b1d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brotmetchaes=20=C2=B7=20kevadesu?= <76264518+kevadesu@users.noreply.github.com> Date: Sun, 19 Jan 2025 01:15:02 +0000 Subject: [PATCH 5/5] Preparing to mergeee --- README.md | 43 +++++-------------------------------------- main.sh | 4 ++-- 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index debaeb5..5f299f3 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,11 @@ -# Gir [TESTING] -A Git wrapper combining Oh Shit, Git!?! and Gum +# Gir +Combining Oh Shit, Git!?! and Gum + ## What is this? -This is the direct testing branch of Gir. It currently has no practical way to install. Every change gets pushed to this repo. -## No, I meant what is this project? -Oh, right! -With the elements of [Gum](https://github.com/charmbracelet/gum) and [Oh Shit, Git!?!](https://ohshitgit.com/), I made an attempt at making a simple Git wrapper that can combine the two together. +With the elements of [Gum](https://github.com/charmbracelet/gum) and [Oh Shit, Git!?!](https://ohshitgit.com/), I made an attempt at making a simple shell script that can combine the two together. There's not much else to say.......except that the Setup...at least works -## Installing the Testing branch -### ⚠️ BEFORE YOU PROCEED!!!! -You are using this branch at your OWN RISK. By installing the testing branch, YOU agree to NOT blame me for any fuck-ups occuring to your Git repo. Remember, this is not a way to "get the cool updates faster", this is the CONSTRUCTION site. -### you have been warned. -If you still want to install, proceed as followed: -1. **Clone the repository** -```bash -git clone https://github.com/Icycoide/Gir -``` -Make sure you remember where you put the repository! - -2. **Switch to testing branch** -```bash -git checkout testing -``` - -3. **Create a symlink to the file in the repository** -```bash -sudo ln -s /path/to/git/repository/main.sh /path/to/destination/for/binary/gir -``` - -## Updating -Updating is as simple as going to the source repository and running the following (assuming you didn't fuck up anything, in which case you'd have to reset to remote): -```bash -git pull -``` - -## (on the Testing branch only) Git won't let me do this without specifying -f! How do I make Gir force something?? -You launch Gir with the environment variable GIR_FORCEALL set to either 1, TRUE or true. Observe the example below: -```bash -GIR_FORCEALL=TRUE /path/to/executable/gir -``` +To install, grab the latest Setup.sh from [the latest release](https://github.com/Icycoide/Gir/releases/latest) and run it This is licensed under the MIT license diff --git a/main.sh b/main.sh index ec951c6..40afa0e 100755 --- a/main.sh +++ b/main.sh @@ -138,11 +138,11 @@ $(git --version) host system kernel: $(uname -sr) learn more about this release at: -https://github.com/Icycoide/Gir/releases/tag/v0.2.5" +https://github.com/Icycoide/Gir/releases/tag/v$GIR_VERSION" } function gir.variables() { - GIR_VERSION=testing + GIR_VERSION=0.2.5 } gir.variables