iamstoick / drupal-pre-commit

A Drupal pre-commit hook to filter php, js, and css syntax errors. This script also checks the file(s) to make sure that the Drupal coding standard is being followed.
Other
38 stars 24 forks source link

Only check staged files? #5

Open mariacha opened 10 years ago

mariacha commented 10 years ago

I'd like to only check staged files (ones that are actively being committed) instead of all files that show up using git status.

Is the prefered method for this to change this line: LIST=$( git status | grep -e "$grep_include" | egrep -v "$egrep_exclude" )

to: LIST=$( git diff --name-only --cached | grep -e "$grep_include" | egrep -v "$egrep_exclude" )

or is there an option for this somewhere?

iamstoick commented 9 years ago

@ranelpadon can you please look into this request?