From 46720fa6d7a34bea580c4fa44ee885c19e25e04c Mon Sep 17 00:00:00 2001 From: MavapeGZ Date: Fri, 19 Jun 2026 13:15:50 +0200 Subject: [PATCH] fix: Change conditional to allow tower and next git-flow versions. Since both of them are working similarlly, no more changes are required on the plugin. Readme was also updated to refer git-flow-next page --- GITFLOW_VERSION.md | 16 +++++++++++----- src/main/java/gitflow/GitflowVersionTester.java | 12 ++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/GITFLOW_VERSION.md b/GITFLOW_VERSION.md index 7abd37d..ae0ea0b 100644 --- a/GITFLOW_VERSION.md +++ b/GITFLOW_VERSION.md @@ -1,16 +1,22 @@ -The plugin requires that you have gitflow installed, specifically the [AVH edition](https://github.com/petervanderdoes/gitflow). This is because the [Vanilla Git Flow](https://github.com/nvie/gitflow) hasn't been maintained in years +The plugin requires that you have a maintained fork of gitflow installed. We recommend the modern **[GitFlowNext (by Tower)](https://github.com/git-tower/git-flow)** or the legacy **[AVH edition](https://github.com/petervanderdoes/gitflow)**. This is because the [Vanilla Git Flow](https://github.com/nvie/gitflow) hasn't been maintained in years. + +> **Note for Windows Users:** Git for Windows removed the built-in AVH edition starting from version 2.51.1. If you are getting a "command not found" error, you must install a modern alternative like GitFlowNext. **How to check Git Flow version** run `git flow version` -If it says `0.4.1` then you have the wrong version. You will have to uninstall it and then refer to [AVH edition](https://github.com/petervanderdoes/gitflow) docs for installation. +If it says `0.4.1`, then you have the wrong (Vanilla) version. You will have to uninstall it and then install a supported fork. +If the output contains `AVH` or `next` / `Tower`, you are good to go! +**How to install GitFlowNext (Recommended)** -**How to uninstall wrong version on OSX** +* **Windows:** You can install it via winget: `winget install GitTower.GitFlowNext` *(Make sure to rename the downloaded executable to `git-flow.exe` and place it in your Git `mingw64\libexec\git-core` directory).* +* **Mac/Linux/Windows:** Refer to the official [GitFlowNext Installation Docs](https://github.com/git-tower/git-flow) for detailed instructions. -If installed via `brew` then run `brew uninstall git-flow` +**How to uninstall wrong version on OSX** +If installed via `brew` then run `brew uninstall git-flow` **Mac/Linux users:** @@ -19,4 +25,4 @@ If you're running into issues like getting or `git: 'flow' is not a git command. See 'git --help'.` -Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7) +Please be sure to check out [this thread](https://github.com/OpherV/gitflow4idea/issues/7) \ No newline at end of file diff --git a/src/main/java/gitflow/GitflowVersionTester.java b/src/main/java/gitflow/GitflowVersionTester.java index c0b48c8..2a36748 100644 --- a/src/main/java/gitflow/GitflowVersionTester.java +++ b/src/main/java/gitflow/GitflowVersionTester.java @@ -51,13 +51,21 @@ public String getVersion() { /** * Returns true if the {@code git flow} version can be determined - * and is any AVH version ({@code #contains("AVH")}) and + * and is any AVH version ({@code #contains("AVH")}), any Tower version ({@code #contains("Tower")}) , + * any Next version ({@code #contains("Next")}) and * not the unmaintained NVIE version. * * @return true if we think the git flow version is an AVH version. */ public boolean isSupportedVersion() { - return version != null && version.contains("AVH"); + if (version == null) { + return false; + } + + String versionLower = version.toLowerCase(); + return versionLower.contains("avh") || + versionLower.contains("tower") || + versionLower.contains("next"); } public void init(){