couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <...@git.apache.org>
Subject [GitHub] couchdb pull request: Fauxton: highlight databases with more delet...
Date Sat, 15 Mar 2014 14:29:48 GMT
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb/pull/181#issuecomment-37727091
  
    I'm so sorry!
    
    Ok, that are two times more than needed, I wrote a precommit-hook. Feel free to use it,
just add it as executable (`chmod +x $FILENAME`) as `couchdb/.git/hooks/pre-commit`:
    
    ```bash
    #!/bin/sh
    
    files=$(git diff-index --name-status --cached HEAD | grep -v ^D | cut -c3-)
    
    # initial commit - files is null
    if [ -z "$files" ]
    then
      files=$(git diff --cached --root --name-status | grep -v ^D | cut -c3-)
    fi
    
    if [ -n "$files" ]
    then
      for f in $files
      do
        # or still unstaged No newline at end of file
        unstaged=$(git diff $f | grep ${f:4} src/Makefile.am)
        if [ -n "$unstaged" ]
        then
          echo "Errors in file Makefile.am:"
          echo "Unstaged file has info for Makefile.am"
          exit 1
        fi
        unstaged=""
        # return error if not in Makefile.am
        if [ "$(grep ${f:4} src/Makefile.am)" == '' ]
        then
          echo "Error: file not added to Makefile.am"
          exit 1
        fi
      done
      exit 0
    fi
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message