✨ Updated -r flag to be more featureful
This commit is contained in:
parent
4b49ffad93
commit
eb1c67002e
1 changed files with 5 additions and 5 deletions
10
scripts/bgit
10
scripts/bgit
|
|
@ -223,19 +223,19 @@ else
|
||||||
tput bold & tput setaf 7
|
tput bold & tput setaf 7
|
||||||
|
|
||||||
if [[ $revert == "y" || $revert == "yes" ]] ; then
|
if [[ $revert == "y" || $revert == "yes" ]] ; then
|
||||||
commitarray=($(git log -5 | grep commit | sed 's/commit//g'));
|
commitarray=($(git log -6 | grep commit | sed 's/commit//g'));
|
||||||
verbosecommits=$(git shortlog -5 --reverse | sed 1d);
|
verbosecommits=$(git shortlog -6 --reverse | sed 1d);
|
||||||
|
|
||||||
numcommits=5
|
numcommits=6
|
||||||
for ((i = 0; i < numcommits; i++)) do
|
for ((i = 0; i < numcommits; i++)) do
|
||||||
j=$(echo ${i} + 1 | bc)
|
j=$(echo ${i} + 1 | bc)
|
||||||
nextcommit=$(echo "${verbosecommits}" | head -n $j | tail -n 1)
|
nextcommit=$(echo "${verbosecommits}" | head -n $j | tail -n 1)
|
||||||
echo -e "${i})${nextcommit}"
|
echo -e "${i}) ${commitarray[$i]}${nextcommit}"
|
||||||
done
|
done
|
||||||
|
|
||||||
read -e -r -p "${txtwhite}Choose commit to revert back to: ${txtyellow}" version
|
read -e -r -p "${txtwhite}Choose commit to revert back to: ${txtyellow}" version
|
||||||
|
|
||||||
echo "version you wish to go back to: ${commitarray[$version]}"
|
echo "${txtblue}Reverting back to version: ${txtyellow}${commitarray[$version]}"
|
||||||
|
|
||||||
# Reset output style
|
# Reset output style
|
||||||
tput bold & tput setaf 7
|
tput bold & tput setaf 7
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue