Skip to content

Commit 3c814e9

Browse files
committed
*-command+, git-*+
1 parent 5f0e505 commit 3c814e9

15 files changed

+92
-2
lines changed

bashx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT=$1
4+
5+
shift #strip 1st arg
6+
7+
bash -x $(which $SCRIPT) $@

cp-command

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# ta
4+
SCRIPT_EDITOR="silent.sh textadept"
5+
6+
script_path=$1
7+
8+
if [[ -z "${script_path}" ]]; then
9+
echo "File path argument not set. Exitting"
10+
exit
11+
fi
12+
13+
script_path="$(which ${script_path})"
14+
15+
if [[ ! -f "${script_path}" ]] ; then
16+
echo "File at ${script_path} doesn't exists. Exitting"
17+
exit
18+
fi
19+
20+
script_path=$(readlink -f "$script_path")
21+
22+
echo "New script path (press ctrl+c to exit):"
23+
read -re -p '> ' -i "${script_path}" new_script_path
24+
25+
set -x
26+
cp -i "$script_path" "$new_script_path"
27+
${SCRIPT_EDITOR} "$new_script_path"

git-author

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
AUTHOR_QUERY=$1
4+
5+
if [[ -z "${AUTHOR_QUERY}" ]]; then
6+
exit
7+
fi
8+
9+
git shortlog -s --all | cut -c8- | sort | grep "${AUTHOR_QUERY}" | head -n 1

git-compare-branch-file

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/bin/bash
2-
git difftool -y ..$1 $2
2+
3+
set -x
4+
5+
git difftool -y $1:$2 $2

git-compare-rev-dir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git difftool --dir-diff $@

git-compare-rev-file

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
git difftool -y $1 -- $2

git-compare-staged-deprecated

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git difftool --staged --dir-diff

git-compare-workdir

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
git difftool --dir-diff HEAD

git-grep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
git log -S "$1" --source --all --date-order

git-stash-apply-one

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
FILE="$1"
4+
STASH_NUM="$2"
5+
6+
if [[ -z $STASH_NUM ]]; then
7+
STASH_NUM=0
8+
fi
9+
10+
#git diff stash@{$STASH_NUM}^1 stash@{$STASH_NUM}
11+
#git diff stash@{$STASH_NUM}^1 stash@{$STASH_NUM} -- ${FILE}
12+
13+
git checkout stash@{$STASH_NUM} -- ${FILE}

rename-command

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
rename-file $(which $1)

ta-command

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#!/bin/bash
2-
ta $(which $@)
2+
3+
#ta $(which $@)
4+
silent.sh textadept $(which $@)

tig-all

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
tig --all --date-order $@

tig-by

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
AUTHOR=$(git-author $1)
4+
echo "Showing all commits by $AUTHOR"
5+
tig --all --date-order --author="$AUTHOR"

tig-grep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -x
3+
4+
git log -S "$1" --source --all --date-order | tig

0 commit comments

Comments
 (0)