Skip to content

Commit 771ba23

Browse files
committed
Add a script to help repro #16
1 parent 3be4e5d commit 771ba23

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/**
22
build/**
3-
.DS_Store
3+
git-test
4+
.DS_Store

.vscode/settings.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
22
"editor.formatOnSave": true,
3-
"editor.defaultFormatter": "esbenp.prettier-vscode"
4-
}
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"[shellscript]": {
5+
"editor.defaultFormatter": "foxundermoon.shell-format"
6+
},
7+
"[ignore]": {
8+
"editor.defaultFormatter": "foxundermoon.shell-format"
9+
},
10+
"[properties]": {
11+
"editor.defaultFormatter": "foxundermoon.shell-format"
12+
}
13+
}

scripts/test.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
# A script to quickly generate a random diff and display it. Hopefully this will
3+
# help repro https://github.com/banga/git-split-diffs/issues/16.
4+
5+
set -e
6+
set -x
7+
8+
cd git-test
9+
10+
git init
11+
touch src.ts
12+
13+
choice=$((RANDOM % 2))
14+
15+
case $choice in
16+
0)
17+
echo 'Appending some lines'
18+
cat ../src/context.ts >>src.ts
19+
;;
20+
1)
21+
echo 'Deleting half the lines'
22+
sed -i '' -n 'p;n' src.ts
23+
;;
24+
esac
25+
26+
git commit -am "$(date)"
27+
git show
28+
29+
cd -

0 commit comments

Comments
 (0)