GithubHelp home page GithubHelp logo

git-rook's People

Contributors

masukomi avatar mtdowling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

domainfun

git-rook's Issues

test failures on osx

running make test before adding to my path produced the following 2 errors.

 ✗ can install hooks to current repo
   (in test file test/git-rook.bats, line 41)
     `[ $status -eq 0 ]' failed
   Initialized empty Git repository in /private/var/folders/b5/4344qh3518nf3dp58nnphd8r0000gn/T/test-repo/.git/
   /Users/masukomi/workspace/reference/bash/git-rook
   /Users/masukomi/workspace/reference/bash/git-rook
 ✗ can install hooks to specific repo
   (in test file test/git-rook.bats, line 50)
     `[ $status -eq 0 ]' failed
   Initialized empty Git repository in /private/var/folders/b5/4344qh3518nf3dp58nnphd8r0000gn/T/test-repo/.git/
   /Users/masukomi/workspace/reference/bash/git-rook
   /Users/masukomi/workspace/reference/bash/git-rook

The problem is a result of this section in install_hook

if [ -f "${dest}" ]; then
    [ "${FORCE}" -eq 0 ] && fail "${dest} exists (use -f to force)" && exit 1
    echo " ! Overwriting ${dest}"
  fi

If your git template directory has any hooks in it already, then running git init will copy those down into the current repo. Obviously the intersection of these two things isn't the greatest use-case. I think the solution is to have git-rook's initialize functionality check if there is a git template directory specified via any of the 3 ways specified in the docs, and if so, check if there are any hooks in it.

Then the question is, should git-rook bail? or should it remove / replace those files that were copied over from the templates directory?

Another solution might be to always move existing files and throw up a notice. So, for example, if there's a pre-commit file there already it'd be renamed something like pre-commit.rook-bak

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.