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
GitFlow Support #842
Comments
Not using git-flow personally, but I guess nothing in v5 prevents from using it. |
Awesome. I incorrectly linked you to the original git-flow repo; this is the most recent iteration gitflow-avh. Quick note, the gitflow-avh version was merged into Git for Windows as of version 2.6.4. I am not sure if it matters to Husky that I am using Git For Windows, but I wanted to point it out. The gitflow-avh version is also installable on all other platforms and comes packaged with Ubuntu as of version 18.04. I am looking for support of the default hooks emitted from gitflow-avh's commands. A few examples can be found here There is a Example Command: This will emit two "hookable" events All the core gitflow-avh commands would be supported then. So:
This similar issue was opened, and while GitFlow is an older workflow, I think there is a desire for this feature. #123 |
I'm not on Windows right now. But you could give a try with the following commands: git init
npm init -y
npm install husky@next -D
npx husky install
# Add one the hook you'd like to test
npx husky add .husky/<pre-flow-...> "touch ok"
# Run the corresponding git flow command
# Check that "ok" file was created |
Done, but it did not work. I did try the above actually before posting here (as well as again rn). I assumed since the events I wanted to hook into were part of GIT that Husky supported them out of the box. I had to add one step to the test. Here are the steps I tried:
Just as a sanity check I took the file (pre-flow-feature-start) created by huksy and manually put it in I made this screencast for you. Hope it helps! E002Iif3v4.mp4 |
Thanks for the screencast 👍 |
You're welcome! I always like recording vs typing out tons of text. As for it working on v4, no I don't know (it probably did though). I did not have much time to dedicate to this issue when I posted it, sorry to just push it all on you like that. Anyway, I figured out the issue :) Now we just need to fix it, potentially. Reproduce The Issue
This will initialize an empty repo and the config file will look like the below (unless you have global or system configs set).
Notice the missing core Next, we initialize git flow.
This adds needed config information for git flow to work and the config file now looks more or less like:
Notice the added Now we install husky.
This adds needed config information for husky to work and the config file now looks more or less like:
The IssueWhen husky is installed into an existing project that is using gitflow husky does not update the Note: Husky will work if it is installed BEFORE you setup gitflow. Why? Because when you install Husky the So the below will work:
TL;DR - The FixWell, I guess the "real fix" would be to make it so that when husky is installed it checks for a You can run Cheers! |
Awesome! Thanks for the detailed analysis and fix! 🙂 |
Thanks! I did fork v5 and took a look (congratulations on the release btw). Its simplicity is very impressive! To the issue. I am not sure that modifying Husky's install process to look for GitFlow is the right approach. The command Line 32 in 79830d3
However, I would argue that MOST people are not using GitFlow. So perhaps we handle this with some documentation around using Husky with GitFlow. Maybe it would be better to just tell people to run the command and set their hooks directory? Before I make PR I wanted to get your input. |
Thanks :) I agree, a mention in the doc would be better. |
Well, PR made #847 but I am getting a build error. |
It's merged :) Regarding the build error, it's a bug. I'll check the config. |
Awesome @typicode thanks! |
Will GitFlow actions (ex.
git flow feature publish
) be supported in v5.x?The text was updated successfully, but these errors were encountered: