-
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
_git.py:remove_files does not react to git's fatal error if newsfragment is untracked by git #448
Comments
I just ran across this as well. I didn't realize it was standard (actually, required) to commit the files via git first. |
Another issue is backup files. I got this error after it tried to use a backup file that ended with |
Thanks @Dreamsorcerer for the comment. I think this needs a separate ticket. It's important to gather info about what extensions or file formats are used by backup tools/text editor. I think this might be related to #357 I think that this can be closed as we are now handling this error. For now, towncrier needs to have the file commited to git... so this works as expected. Also, in latest releses, a stacktrack is no longer presented.
I agree that it would be nice to have a better explanation... but that would be a feature. I am closing this. We can re-open if anyone thinks that this is still an issue. Happy to review a PR in which the error message is better and expalins that files must be added to git before being handled by towncrier. |
In your output, it doesn't look like it tried to remove the second file (540.bugfix). |
Agree. And it should not say I don't know what is the best way to fix this. I am ok with just ignoring files that are not managed by git... I don't know if there are any unwanted side-effects by ignoring them. |
A quick glance at the code suggests it's just calling Otherwise, with a bigger refactoring, you could consider interfacing with git more directly using gitpython. |
well, towncrier is a development tool, and not an end user tool. I expect that devs will know what they are doing I think that using If this is a big "nerve" for someone and they submit a PR for better error reporting, we can merge this. For me, this is not a problem. I have all the files in git :) I am not sure why a file like |
Sorry to revive an old thread, but came across this thread while sanity checking my assumptions when I encountered this error. For me, it was pretty obvious that the issue was git remove on an untracked file. What surprised me is that no error was triggered, so I was unexpectedly left with a non-empty newsfragments directory. I think this should trigger an error of some sort that prevents successful completion. |
I think if you reread the previous 4 comments, it aligns with your expectation. We should attempt each file, rather than aborting on the first failure, and the message should not indicate that it completed successfully. |
Happy to review and approve a PR that fixes this. As long as the PR has documentation and automated tests and the code is not a big mess, there should be no reason not to merge it. Thanks |
@Dreamsorcerer - sorry for the confusion, just wanted to make sure I was understanding the issue correctly. |
I created some news fragments for towncrier to build me my new changelog and after that I inteded to commit the changes to the git repo. So the news fragments themselves were not tracked by git at the time of the changelog generation. When towncrier asked if it is ok to remove the news fragments I said yes and this was the result:
This error should be expected and handled here
it could look something like this:
The text was updated successfully, but these errors were encountered: