Closed mbikovitsky closed 1 year ago
Related to 25060c3b0683c710cd5b47cdfc550b7f8a3b4940
See work done in relation to https://github.com/gitextensions/gitextensions/issues/10242. Need to tighten git config fetching to handle values not existing.
Exit code is OK here.
private bool IsGitFlowInitialised
{
get
{
GitArgumentBuilder args = new("config")
{
"--get",
"gitflow.branch.master"
};
ExecutionResult exec = _gitUiCommands.GitModule.GitExecutable.Execute(args, throwOnErrorExit: false);
return exec.ExitedSuccessfully && !string.IsNullOrWhiteSpace(exec.StandardOutput);
}
}
What is the usage of the GitFlow plugin if this has not been seen until now? This plugin should probably be removed from GE core and be maintained by users.
Disagree. Just because you changed git executable handling of output and didn't verify plugin handling doesn't mean you should abandon a very useful plugin.
Git flow plugin supports git flow. https://danielkummer.github.io/git-flow-cheatsheet/
Actually the better fix is to use the module's git config functionality to retrieve the setting. @mbikovitsky did you want to attempt that change?
Short term change is to apply the change I posted. Longer term there is no maintainer working with this plugin, so it cannot be well maintained within GE and may benefit from a separate release cycle.
@mbikovitsky one thing that would help. Press f12 before launching gitflow dialog. Capture log output. Any error message?
@vbjay, here you go:
But I'll leave the fix to someone else :) I don't have enough free time on my hands at this moment.
Ok. @gerhardol I see what you changed. That would work too. Did you want to put it in?
Ok. @gerhardol I see what you changed. That would work too. Did you want to put it in?
Anyone is welcome to create a PR with that. (I try to look at issues between other things to do and plan to submit PRs after that.)
Until a fix is released, maybe initializing GitFlow manually is the solution by running the command git flow init -d
(for default branch naming convention) or git flow init
(but I'm not sure the plugin support another branch name than master
...)
No. When the config is in it reads the branch name from config. It's just yelling because of the exit code. It should accept that and not throw on that exit code.
When the config is in it reads the branch name from config.
For me master
is hardcoded: https://github.com/gitextensions/gitextensions/blob/master/Plugins/GitFlow/GitFlowForm.cs#L50
If I'm not wrong, there is no git config that store the name of the main branch of the repository.
I will be really pleased if someone prove me wrong...
@pmiossec, gitflow.branch.master
is the name of the config option that stores the name of the main branch. For example, in my .git\config
file:
[gitflow "branch"]
master = main
develop = develop
Yep. That is basically what is the name of the branch release and hotfix branches go to when completed. @pmiossec might want to read https://nvie.com/posts/a-successful-git-branching-model/
Yep. That is basically what is the name of the branch release and hotfix branches go to when completed. @pmiossec might want to read https://nvie.com/posts/a-successful-git-branching-model/
Yes, Yes, I know a little how it works. That's the link I put in the plugin UI as a documentation when I developed the plugin 😜
That's just I didn't remember the config key name and this name was especially misleading since Git introduced support for another name for default branch...
But still, the initialization of git flow with the default values as it is done today will not support another default branch than master
...
So git flow init won't read from what git understands is the main/master/trunk ..whatever we call the default branch?
So git flow init won't read from what git understands is the main/master/trunk ..whatever we call the default branch?
It's a good question. I don't know if git flow try to do something clever I don't know how but I don't think so. It's something that needs to be tested...
Just did. I renamed my branch master which is not defaukt branch name in my config.
it still was smart enough and once I ran the init, plugin behaves well.
So it actually looks at current branches to determine suggestions
has to exist too
I did some quick test also and when running git flow init -d
(what is run by the plugin), there is a special handling for master
(normal because it is the historic default) and main
.
I tried other names trunk
or another random one but with only 1 branch in the repository and the command failed.
So as long as master
or main
are used, it should be ok...
Confirmed and init.defaultbranch does not play a part
Environment
Issue description
Exit code: 1 Command: C:\Program Files\Git\bin\git.exe Arguments: config --get gitflow.branch.master Working directory: [REDACTED]
Steps to reproduce
Open the Git Flow plugin inside a repository that doesn't have Git Flow initialized.
Did this work in previous version of GitExtensions?
v3.5.4
Diagnostics
The issue is that
git config --get gitflow.branch.master
exits with status 1 because the setting isn't set. Runninggit flow init -d
manually beforehand solves the issue.