Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (10 sloc) 486 Bytes
#!/usr/bin/env bash
# git-open-all: open all files changed in the current branch in the user's $EDITOR
set -eo pipefail
[[ -n "${EDITOR}" ]] || { >&2 echo "Refusing to continue without EDITOR."; exit; }
current=$(git rev-parse --abbrev-ref HEAD)
base=${1:-master}
merge_base=$(git merge-base "${current}" "${base}")
# TODO: Instead of filtering renamed files, open their new path.
git diff -z --diff-filter "r" --name-only "${current}" "${merge_base}" \
| xargs -0 "${EDITOR}"