Skip to content

Commit

Permalink
Change git edit-files so, if passed no arguments, it will edit your c…
Browse files Browse the repository at this point in the history
…urrently modified files, instead of editing all files modified in $(git qparent)..HEAD.
  • Loading branch information
jlebar committed Jul 31, 2012
1 parent a9c1fc4 commit f57bf87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -68,7 +68,7 @@ rebase your current branch without moving the commits to a new upstream base.
## git-edit-files

Open all the files modified in the specified rev range in your `$EDITOR`. (If
no rev range is specified, open the files modified in your current branch.)
no rev range is specified, open the files modified in your current checkout.)

## git-qapplied

Expand Down
4 changes: 2 additions & 2 deletions git-edit-files
Expand Up @@ -3,12 +3,12 @@
if [[ "$1" == "--help" ]]; then
echo "Usage: $0 [GIT_REV]
Invoke \$EDITOR on the files modified in the given revision.
If no revision is given, invoke \$EDITOR on the files modified in the current branch."
If no revision is given, invoke \$EDITOR on the files modified in git status."
exit 1
fi

if [[ "$1" == "" ]]; then
revs="$(git merge-base $(git-tracks -d) HEAD)..HEAD"
$EDITOR $(git diff --name-only)
else
if ! echo "$1" | grep -q '\.\.'; then
revs="$1^..$1"
Expand Down

0 comments on commit f57bf87

Please sign in to comment.