-
Notifications
You must be signed in to change notification settings - Fork 12
"Git bump commit" should have been reverted if the the command "git tag" fails #6
Comments
I tried solving the problem but I can't... I was trying to use the convention from the Gulp documentation, but I can't handle the error... https://github.com/stevelacy/gulp-git#gittagversion-message-opt-cb
That did not work... The handler does not work... :( |
This is performed by using the git module "gift" and not issuing a git tag if it exists. https://github.com/notatestuser/gift#reporesettreeish-options-callback After this point, we just reset HEAD^. * modified: index.js - Implementing the steps to get the git repo, and the list of tags * modified: package.json - Bumping the version manually to 1.1.1.
I think I have a proposed solution to use the git module "gift" to retrieve the list of tags and verify if the "candidate" one already exists. |
…t: Updating package.json
Hi! You should admit that in the perfect world, the situation of having mismatch between tag and package.json should never happen, especially that it breaks npm big time ;-) I don't live in a perfect world, and have panickly removed a premature tag from the remote too, so I'm not innocent. The plugin should follow the Unix philosophy of "do one thing, do it well". Maybe I posted a too wide example (that I use myself) that includes version bumping scenarios, but please remember, that neither version bumping, nor commiting the bump is part of this plugin's functionality. Those are just the tasks that I assumed we always do before tagging a commit with a version. Because of the last, we can't really revert the last commit --- the plugin has no idea what was in the last commit (it didn't do it). We can't remove commits blindly! What we should do, I believe, is to gracefully emit an error (in other words, most likely, throw an exception) inside the plugin, since an unexpected condition was encountered and it is to the gulpscript maintainer to handle this situation (we shouldn't make things even more unexpected). I think the check whether the tag already exist is a great idea and I'll look into And that means making sure that the options that were passed down to So, I now have something to work on in this repository, just give me a while, I usually check it here once in a couple of days :) I will probably soon use your commit and create a new version taking all above into consideration. |
Hi! Yes, thanks for your valuable insights... I do agree with you when it comes to solving the problem right... However, although I believe that it's better to give something that does not break, I see the point of the graceful error messages... Yeah, I would suggest using gift... I really liked experimenting it because it gave me full control over the git functionalities I was looking for... Thanks for the great plugin anyway! It's been very useful in my daily work managing private plugins where NPM repository is still controlled using git repos. |
Hi, |
@ikari-pl The change seem to be sane :D Considering it is 2:50am and I spent the weekend working with Go :P I will definitely pull and test it out tomorrow, but reading the code I did not see anything alarming... Great idea on checking with the author of #2 ... I tried to reading his requirements, but not sure what the translation of the command would look like.. If he replies to you, I can certainly help debugging it if needed... Thanks again! |
Well, in theory, since I want to stick to proper |
You know, I believe a decent sleep schedule would fix half od your problems ;-) |
@ikari-pl Yeah... I hope he won't need to change the version... 👍 Hah my brain does not let me 💤 sometimes :) Yeah perfect time zone difference for online work! |
Hi there!
Your plugin is awesome! I maintain multiple modules and I manage versions manually every day... Yours is definitely helping me a lot!!!
So, as I'm adopting it, some tags are higher than the version of the package.json.... (those days I was super sleepy to verify the manual process 💤)... The version on the package.json was old by 1 so it collided...
Wit that, I was expecting the plugin to now keep the "bad" commit there... But it did...
thanks!
The text was updated successfully, but these errors were encountered: