Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to add untracked files before a commit is performed #120

Open
eddiemonge opened this issue Jan 29, 2015 · 7 comments
Open

Add option to add untracked files before a commit is performed #120

eddiemonge opened this issue Jan 29, 2015 · 7 comments

Comments

@eddiemonge
Copy link
Collaborator

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 #87 for more discussion on the issue

@joshuahiggins
Copy link

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.

@eddiemonge
Copy link
Collaborator Author

Create the blank changelog and then commit it. then it will work.

@joshuahiggins
Copy link

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.

@eddiemonge
Copy link
Collaborator Author

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

@joshuahiggins
Copy link

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.

@eddiemonge
Copy link
Collaborator Author

-a only adds tracked files with changes, not untracked files. Its a different use case then adding untracked files.

@enure
Copy link

enure commented Oct 1, 2015

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/**/*']
    }
}

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

Successfully merging a pull request may close this issue.

3 participants