-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Wirth
committed
Sep 25, 2018
1 parent
d4f9d97
commit c81a83c
Showing
3 changed files
with
58 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function rebase () { | ||
|
||
if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]] || [[ "$1" == "" ]]; then | ||
echo "usage: rebase [base [top]]" | ||
echo "where [top] defaults to the current branch" | ||
return | ||
fi | ||
|
||
START=`currentBranch` | ||
|
||
TOP=$2 | ||
BASE=$1 | ||
echo maybe $TOP | ||
# fall back if second arg is not defined | ||
if [[ "$2" == "" ]]; | ||
TOP=$START | ||
if | ||
echo yes $TOP | ||
echo rebasing $TOP onto $BASE | ||
|
||
git checkout $BASE | ||
git pull | ||
echo checking out $TOP | ||
git checkout $TOP | ||
git rebase $BASE | ||
git checkout $START | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/zsh | ||
|
||
MAX_HITS=30 | ||
|
||
YELLOW=`tput setaf 3` | ||
WHITE=`tput setaf 7` | ||
|
||
function rgki () { | ||
local counter=1 | ||
# populate array with the first MAX_HITS hits | ||
hits=("${(@f)$(rg -l $1 | tail +2 | head -n $MAX_HITS)}"); | ||
|
||
# print file list with newline before and after | ||
printf "\n" | ||
for hit in "${hits[@]}";do | ||
echo ${counter}$YELLOW ${hit} $WHITE | ||
counter=$((counter+1)) | ||
done | ||
|
||
printf "\nwhich file? " | ||
|
||
# get the file by number | ||
read whichfile | ||
kak ${hits[$whichfile]} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters