-
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
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
home/private_dot_local/bin/executable_git-clean-disposable
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,15 @@ | ||
#!/bin/sh | ||
|
||
root="$(git rev-parse --show-toplevel)" | ||
|
||
ret=0 | ||
cd "$root" && { | ||
for pathspec in db/schema.rb Gemfile*.lock; do | ||
if [ -e "$pathspec" ]; then | ||
git checkout HEAD -- "$pathspec" || { ret=$?; break; } | ||
fi | ||
done | ||
# shellcheck disable=SC2164 | ||
cd - >/dev/null | ||
} | ||
exit $ret |
19 changes: 19 additions & 0 deletions
19
home/private_dot_local/bin/executable_git-config-branch-all-rebase
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,19 @@ | ||
#!/bin/sh | ||
|
||
usage="$(basename "$0") [true|false]" | ||
|
||
value='true' | ||
|
||
case $# in | ||
0) ;; | ||
1) value='false' ;; | ||
*) echo "$usage" >&2; exit 2 ;; | ||
esac | ||
|
||
for branch in $(git branch --list | cut -c 3-); do | ||
if git branch --remotes | cut -c 3- | grep -q "^origin/$branch$" \ | ||
&& [ "$(git config branch."$branch".rebase)" != 'true' ]; then | ||
echo setting branch "$branch" to rebase | ||
git config branch."$branch".rebase "$value" | ||
fi | ||
done |
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,10 @@ | ||
#!/bin/sh | ||
|
||
grep_output="$(git grep "$@")" || exit | ||
|
||
printf %s "$grep_output" \ | ||
| cut -d' ' -f1 \ | ||
| tr : ' ' \ | ||
| while read file line; do | ||
git blame "$file" -L "$line",+1 --show-name | ||
done |
12 changes: 12 additions & 0 deletions
12
home/private_dot_local/bin/executable_git-push-current-branch
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,12 @@ | ||
#!/bin/sh | ||
|
||
current_branch="$(git symbolic-ref --short HEAD)" | ||
|
||
[ -z "$current_branch" ] && exit 1 | ||
|
||
# FIXME: ensure only one branch | ||
|
||
remote=origin | ||
[ $# -ge 1 ] && remote="$1" | ||
|
||
git push -u "$remote" "$current_branch" |
12 changes: 12 additions & 0 deletions
12
home/private_dot_local/bin/executable_git-push-current-tag
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,12 @@ | ||
#!/bin/sh | ||
|
||
current_tag="$(git tag --points-at HEAD)" | ||
|
||
[ -z "$current_tag" ] && exit 1 | ||
|
||
# FIXME: ensure only one tag | ||
|
||
remote=origin | ||
[ $# -ge 1 ] && remote="$1" | ||
|
||
git push --no-verify "$remote" "$current_tag" |