Skip to content

Stash unstaged changed before running tests #2

Closed

Description

@tomfuertes

Ref: http://codeinthehole.com/writing/tips-for-using-a-Git-pre-commit-hook/#stash-unstaged-changes-before-running-tests

Helps test only prospective commit.

$ npm test # runs jshint
$ echo "// pass" > pass.js
$ echo "err()" > fail.js
$ git add pass.js
$ npm test # should fail on fail.js
$ git commit -m "should pass"

Activity

  1. 3rd-Eden commented on Jan 22, 2014

    @3rd-Eden
    Member

    As the referred article's comments states, there are some serious flaws when it comes to stashing commits. So i'm not fully convinced this is the right way to handle this edgecase?

    As a developer, you could just do git stash && git commit when you have unstaged commits that breaks stuff.

  2. tomfuertes commented on Jan 22, 2014

    @tomfuertes
    Author

    Err, didn't see comments w/ Ghostery. Good point!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions