fix(gitutil): do not stash ignored files (#262)

Until now `gitutil.stashAndPop` ran the following command for each repo:

    git stash save --all --quiet "coho stash"

Beside changed and untracked files, this also stashes ignored files. In
our case that includes the `node_modules` folder. Due to the massive
amount of files in there, that command takes a decent amount of time and
can also lead to _a lot_ of CRLF warning messages, depending on your
local git configuration.

Furthermore, the new build system of `cordova-js` needs to have its
dependencies present to be able to run. But since the `cordova-js` build
is run in a `stashAndPop` block, all modules have been stashed and thus
the build always fails.

AFAICT, no invocation of `gitutil.stashAndPop` does actually _need_ to
stash ignored files. Thus we can resolve these issues by replacing the
`--all` flag with `--include-untracked`, giving us this command:

    git stash save --include-untracked --quiet "coho stash"

This safely stashes all content that could potentially be destroyed by
`coho` operations, while leaving ignored files in place.
1 file changed
tree: 1f0ea4754e5787e7f8e2ee1c10bf7f8031e9b9f4
  1. .github/
  2. docs/
  3. spec/
  4. src/
  5. .eslintrc.yml
  6. .gitattributes
  7. .gitignore
  8. .ratignore
  9. .travis.yml
  10. appveyor.yml
  11. coho
  12. coho.cmd
  13. CONTRIBUTING.md
  14. LICENSE
  15. NOTICE
  16. package.json
  17. README.md
  18. RELEASENOTES.md
README.md

Build Status Build Status

Cordova Coho

Command line tool for Apache Cordova contributors to manage Apache Cordova repositories, and to help with releases and pull requests.

This repository has the following purposes:

  1. To hold committer-relevant documentation
  2. To hold release automation scripts
    • e.g. coho create-archive && coho verify-archive
  3. To hold generally useful dev scripts
    • e.g. coho repo-clone
    • e.g. coho --help

Node.js is a pre-requisite:

Easiest way on OS X & Linux: https://github.com/creationix/nvm

Easiest way on Windows: http://nodejs.org/

Installation

Via npm

npm install -g cordova-coho
coho

On Mac OS X / Linux, if you didn't use a node version manager like nvm or n, you might have to run the command using sudo.

Alternately, you could also clone & use coho

mkdir -p cordova
cd cordova
git clone https://github.com/apache/cordova-coho
cd cordova-coho
npm install
npm link # Might need sudo for some configurations
coho

Or you can just call coho directly in your clone:

C:\Projects\Cordova\cordova-coho\coho.cmd

Cloning/Updating Cordova repositories

coho repo-update -g -r all

repo-update will clone a repo if it is missing -- if it exists, it updates it.

The all repo id will clone all Apache Cordova repositories into the current working directory.

Docs

coho --help

or if you know the command:

coho [command] --help   

For example:

coho repo-clone --help

To see valid repo ids and repo group ids for use with Coho, use the list-repos command:

coho list-repos    

Note about global context

By default coho is executed in the parent of where it is installed or checked out (since coho was originally designed for use in another context where this was needed). To work in a global context, meaning the current folder where you are executing coho, most commands require you to use the -g or --global flag. To make this more obvious, all commands first output their current working directory: Running from ....

Contributing

Cordova is an open source Apache project and contributors are needed to keep this project moving forward. Learn more on [how to contribute on our website][contribute].