-
Notifications
You must be signed in to change notification settings - Fork 122
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
Adding option to add untracked files before a commit is performed. #87
Conversation
@joshua703 - I have added in the extra functionality to report out which files that have been added. |
👍 thanks I've installed your fork until this PR lands |
This is a pretty scary feature. Its telling the system to add something that you may not know is there. Adding changed, tracked files is at least safe because they are already tracked so worst case is they are completely different. Untracked could accidentally add lots of unwanted data. What kinds of scenarios are you doing with this? |
In my grunt tasks, all of my compiled files, as well as assets (images, fonts, etc) are copied to a I'm not worried if this PR doesn't land. If it doesn't, we'll just keep using my fork, so no worries :). Just thought I would give it to the community to see if they wanted it. |
Forget my previous question. This is still a scary feature but it is one that is potentially needed for things like release files only existing in tags and not main repo. Let me think about this and see if there isn't a better way this could be done. Right now Im thinking you have to manually specify files using grunt file matchers would be a good compromise |
It's only dangerous based on how you have your grunt config setup. I tell grunt bump that I only want to add/commit files in my |
Let this plugin does its job. If you have additional tasks in VCS field, do them with proper tools. you can use one of grunt plugins that work with git: grunt-git or grunt-git-them-all(yes, a tiny bit of pr) |
@ZuBB: If that's the case, then grunt bump shouldn't do any git work at all. It's already built to do a |
@meenie actually it build in way that allows to do any git command. 'add' command is omitted with help of "direct" commit. But that's not a deal. you come with pr because you have untracked. @LeMisterV wants a '-f'. Someone else will come with need to handle files that were deleted ahead of 'git rm'. this queue may be endless. we ought to use commit, tag, and push. but IHMO would be better to stop on those three |
@eddiemonge: Have you thought about this? |
I think if there was a dry-run option then this would be better. While I do see how a need for this can exist, it still scares me. I'm actually dealing with something similar in a project at the moment and I grunt the build process, add the new files, then do a full release cycle. How I have it is not ideal since I am checking in the built files into git main instead of a dedicated branch that a tag could point to but doesn't need to exist. |
I think it's more scary that someone doesn't know exactly how their build process works and somehow grunt bump commits a massive file that was previously |
I came across this PR when wanting to stage and commit Sure I can (and have) added |
@rpocklin you have a separate changelog for every version? I still don't know about this. I try to close it and type up the reasons why and then immediately counter them but am still afraid of the implications of this. There has to be a better way. 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. Yeah, I am going with that. If you want to change this so it uses a pattern matcher then I'll accept it. Until then, I am closing this one. |
@eddiemonge Fair enough :). That sounds like a great addition to this PR. |
If you have time and the motivation to do it, I encourage you to update the pr with that functionality. If not, want to make an issue for someone else to tackle it? |
I can't 100% commit to it, so might as well create the issue to track it. If/when I update this PR I will link to it. |
Ah, I didn't notice this thread before submitting my own pull request, #120, which seems to mimic @meenie's nearly identically. On that note, I agree with @meenie's statements in this thread. This repo has already made the assumptions that it can add, commit, and push your git process, so it needs to offer the ability to control the finer aspects of adding, committing, and pushing. If someone's using an untracked option without understanding what it's doing, you can't feel responsible for that. I personally think |
Hi, I would love to see this merged. But agree that it could be safer to make use of glob match to gain a little bit of control what is added. Background: |
As the title says :). It's something we need for our internal projects. If you don't want to merge, we'll just use our forked version.