Skip to content
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

Configure base branch name detection #1646

Open
koalp opened this issue Jan 22, 2025 · 0 comments
Open

Configure base branch name detection #1646

koalp opened this issue Jan 22, 2025 · 0 comments

Comments

@koalp
Copy link

koalp commented Jan 22, 2025

Is your feature request related to a problem? Please describe.

I have base branches with other names than "main" and "master".
Currently, I have to manually configure them my repositories.

Describe the solution you'd like

I would like to be able to set a list of branch names that would be used to detect the base branche (base_branche_names = ["main", "master", "develop", "mycustomnamethatnobodyuses"]).

The base_branch function

function M.base_branch()
local value = git.config.get("neogit.baseBranch")
if value:is_set() then
return value:read() ---@type string
else
if M.exists("master") then
return "master"
elseif M.exists("main") then
return "main"
end
end
end
would be modified to use this new parameter.

Describe alternatives you've considered
I could use a global neogit.baseBranch, but I would lose the autodetection of main and master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant