Skip to content

Instantly share code, notes, and snippets.

@scottsb
Forked from timsweb/pre-commit
Last active July 15, 2017 15:42
Show Gist options
  • Select an option

  • Save scottsb/f144abaae78912f9d9733d419759524d to your computer and use it in GitHub Desktop.

Select an option

Save scottsb/f144abaae78912f9d9733d419759524d to your computer and use it in GitHub Desktop.

Revisions

  1. scottsb revised this gist Jul 15, 2017. 1 changed file with 1 addition and 6 deletions.
    7 changes: 1 addition & 6 deletions pre-commit
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,5 @@
    #!/bin/sh

    if git-rev-parse --verify HEAD >/dev/null 2>&1; then
    against=HEAD
    else
    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
    fi

    for FILE in `git diff --cached --name-only` ; do
    # Check if the file contains 'debugger'
    grep -qE '^[ \t]*xdebug_break()' $FILE
    @@ -15,4 +9,5 @@ for FILE in `git diff --cached --name-only` ; do
    exit 1
    fi
    done

    exit
  2. @timsweb timsweb created this gist Jul 9, 2013.
    18 changes: 18 additions & 0 deletions pre-commit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/bin/sh

    if git-rev-parse --verify HEAD >/dev/null 2>&1; then
    against=HEAD
    else
    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
    fi

    for FILE in `git diff --cached --name-only` ; do
    # Check if the file contains 'debugger'
    grep -qE '^[ \t]*xdebug_break()' $FILE
    if [[ $? -eq 0 ]]
    then
    echo $FILE ' contains xdebug_break()! To commit retry with --no-verify'
    exit 1
    fi
    done
    exit