Skip to content

Configure base branch name detection #1646

Open
@koalp

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions