Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6ca64f8

Browse files
committed
add git-resume
1 parent 748069c commit 6ca64f8

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

‎Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ BINS = \
1010
git-ptt \
1111
git-set-message \
1212
git-synth \
13-
git-pick
13+
git-pick \
14+
git-resume
1415

1516
GENERATED = \
1617
git-mark \
@@ -32,6 +33,10 @@ git-ptt: common.sh git-ptt.in.sh
3233
cat $^ > $@
3334
chmod 755 $@
3435

36+
git-resume: common.sh git-resume.in.sh
37+
cat $^ > $@
38+
chmod 755 $@
39+
3540
git-set-message: common.sh git-set-message.in.sh
3641
cat $^ > $@
3742
chmod 755 $@

‎git-resume.in.sh‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
OPTS_SPEC="\
2+
${0##*/} [-c]
3+
4+
Continue working on modified files.
5+
--
6+
h,help Show the help
7+
8+
c,commit Use HEAD instead of the index
9+
v,verbose Increase logging verbosity
10+
"
11+
12+
use_commit=0
13+
14+
eval "$(git rev-parse --parseopt -- "$@" <<<$OPTS_SPEC || echo exit $?)"
15+
16+
while (( $# > 0 )); do
17+
case 1ドル in
18+
(-c) use_commit=1
19+
shift
20+
;;
21+
22+
(-v) let verbose+=1
23+
shift
24+
;;
25+
26+
(--) shift
27+
break
28+
;;
29+
30+
(-*) DIE "unknown option: 1ドル"
31+
;;
32+
esac
33+
done
34+
35+
ref=${1:-HEAD}
36+
37+
if [[ $use_commit -eq 1 ]]; then
38+
${VISUAL:-vim} -p $(git diff-tree --no-commit-id --name-only -r $ref)
39+
elif ! git diff --quiet $ref; then
40+
${VISUAL:-vim} -p $(git diff --name-only $ref)
41+
else
42+
echo "No work to resume."
43+
fi

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /