Use the default formatting for git show in case the user has set a pretty format in .gitconfig
If the user has set a pretty format in their .gitconfig, the output of git show --shortstat
may not match what is expected. Force the default formatting with git show --format=medium --shortstat
.
I have a pretty format set and ran into this error:
Checking out worktree for project 'gst-build' into '/Users/jdouglass/Repos/gst-build/gst-build-1.18' (branch origin/1.18)
Traceback (most recent call last):
File "/Users/jdouglass/Repos/gst-build/./gst-worktree.py", line 147, in <module>
if not checkout_worktree('gst-build', SCRIPTDIR, worktree_dir, options.branch, options.new_branch):
File "/Users/jdouglass/Repos/gst-build/./gst-worktree.py", line 74, in checkout_worktree
commit_message[4].strip()))
IndexError: list index out of range