Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
git-commit-each: handle new files.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Feb 6, 2017
1 parent 82d816d commit c5a36fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-commit-each
@@ -1,12 +1,13 @@
#!/bin/bash

# Commit all modified files in commits with one modified file per commit
for FILENAME in $(git ls-files --modified)
for FILENAME in $(git ls-files --modified --others)
do
MESSAGE="$(echo "$FILENAME" | sed -e 's|^Library/Homebrew/||' \
-e 's|^Formula/||' \
-e 's|^Casks/||' \
-e 's/\.rb//' \
-e 's/$/: /')"
git add "$FILENAME"
git commit "$FILENAME" --message="${MESSAGE}${*}"
done

0 comments on commit c5a36fc

Please sign in to comment.