Git VCS¶
Show all changed files¶
git diff --stat | head -n -1 | awk '{ print $1 }'
Show all files change since master branch¶
git diff --stat origin/master | head -n -1 | awk '{ print $1 }'
Copy to clipboard diff of black of changed files¶
git diff --stat | head -n -1 | awk '{ print $1}' | xargs black --diff | clipcopy
clipcopy might differ on distros and shells but basically copies stdout to cliboard.
This works nice with PyCharm. You can use “Apply Patch from Clipboard” to see diff and apply only the lines you changed/want.
In the popup you get, you can check “Analyze and apply patch from cliboard on the fly” checkbox to get this popup each time you have valid patch in clipboard.