Skip to content

Commit

Permalink
Add a script to help repro #16
Browse files Browse the repository at this point in the history
  • Loading branch information
banga committed Dec 28, 2023
1 parent 3be4e5d commit 771ba23
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/**
build/**
.DS_Store
git-test
.DS_Store
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"[properties]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
}
29 changes: 29 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# A script to quickly generate a random diff and display it. Hopefully this will
# help repro https://github.com/banga/git-split-diffs/issues/16.

set -e
set -x

cd git-test

git init
touch src.ts

choice=$((RANDOM % 2))

case $choice in
0)
echo 'Appending some lines'
cat ../src/context.ts >>src.ts
;;
1)
echo 'Deleting half the lines'
sed -i '' -n 'p;n' src.ts
;;
esac

git commit -am "$(date)"
git show

cd -

0 comments on commit 771ba23

Please sign in to comment.