grunt-bump
grunt-bump copied to clipboard
Add option to add untracked files before a commit is performed
I think if the added files were part of a grunt/glob match then I would feel far more comfortable. Then you can specify which files would be generated that are to be added instead of adding everything blindly.
see https://github.com/vojtajina/grunt-bump/pull/87 for more discussion on the issue
I just ran into this issue when following the example of grunt bump-only
, grunt changelog
, grunt bump-commit
. If changelog generates a new file instead of appending, then that file is untracked and not included in the bump-commit operation.
Create the blank changelog and then commit it. then it will work.
I should create a blank file and add it to tracking then run grunt-bump
? That's not a solution at all and makes the process manual again, which removes the point of using grunt-bump
in the first place.
its a one time add. It should be a separate commit anyway saying you are adding a changelog. After that, its automated. You might have to add changelog.md to your commitFiles
Saying it should be a separate commit is making assumptions about all projects. If we want our vX.XX commit to include nothing more then the version bumped files and a changelog detailing out the work performed in this version, then that's our team's call.
If you're not going to support all files, then take -a
out of the examples and only allow Grunt globs. That seems to be the direction you'd like to take anyway.
-a
only adds tracked files with changes, not untracked files. Its a different use case then adding untracked files.
In our projects we have auto-generated files and the file name is a unique id based on a SHA of the file contents like "dist/i/f2e4bdcfaeb8aeec3b91d47fd8266c2c7fe4cbdb.png". We therefore cannot add the file ahead of time.
In order to get these files added we do the following as part of our grunt release task:
grunt.task.run('bump-only:' + releaseType);
grunt.task.run('default');
grunt.task.run('gitadd');
grunt.task.run('bump-commit');
The gitadd
tasks uses grunt-git to add untracked files in our "dist/" directory:
gitadd: {
files: {
src: ['dist/**/*']
}
}