Update README.md
[sm64pc.git] / tools / create_patch.sh
blobea75d9cca6f58114a50920074bf0890a6d3199da
1 #!/bin/sh
3 # create_patch.sh - Creates an enhancement patch based on the current Git changes
6 if [ "$#" -ne 1 ]
7 then
8 echo "Usage: $0 patch_file"
9 echo ' Creates a patch file based on the changes made to the current directory'
10 exit 1
13 # Make sure this is a git repository
14 if [ ! -d .git ]
15 then
16 echo 'Error: The current directory is not a Git repository.'
17 exit 1
20 # 'git diff' is stupid and doesn't show new untracked files, so we must add them first.
21 git add .
22 # Generate the patch.
23 git diff -p --staged > "$1"
24 # Undo the 'git add'.
25 git reset