jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.66k stars 1.84k forks source link

Branch Whitespace Char Option #2663

Open Zombiefleischer opened 1 year ago

Zombiefleischer commented 1 year ago

Is your feature request related to a problem? Please describe. At work we use branchnames with underline as whitespace replacement

Describe the solution you'd like An option to use your own char as an whitespace replacement like vscode has.

Describe alternatives you've considered Just typing it out yourself, which is kind of tedious.

jesseduffield commented 1 year ago

Sounds good to me: we currently replace spaces with hyphens in sanitizedBranchName in pkg\gui\controllers\helpers\refs_helper.go. We just need to add a new config key gui.branchWhitespaceChar and default it to a hyphen. The config stuff lives in pkg\config\user_config.go.

Do you wanna raise a PR for this @Zombiefleischer ?

Zombiefleischer commented 1 year ago

I can try after work :)

jesseduffield commented 1 year ago

Sounds good :) Reach out if you need any pointers

Zombiefleischer commented 1 year ago

Started working on #2665 , but have the following problem and can't quite wrap my head around it:

# github.com/jesseduffield/lazygit/pkg/gui
pkg/gui/controllers.go:22:3: not enough arguments in call to helpers.NewRefsHelper
        have (*"github.com/jesseduffield/lazygit/pkg/gui/types".HelperCommon, *commands.GitCommand, *"github.com/jesseduffield/lazygit/pkg/gui/context".ContextTree, *"github.com/jesseduffield/lazygit/pkg/gui/types".Model)
        want (*"github.com/jesseduffield/lazygit/pkg/gui/types".HelperCommon, *commands.GitCommand, *"github.com/jesseduffield/lazygit/pkg/gui/context".ContextTree, *"github.com/jesseduffield/lazygit/pkg/gui/types".Model, *"github.com/jesseduffield/lazygit/pkg/config".UserConfig)

If someone can help me with that would be nice :) I'm now heading to bed.

jesseduffield commented 1 year ago

Left a comment :)

Zombiefleischer commented 1 year ago

One thing I noticed the other day is that when you switch from a branch to one that doesn't exist and you create a new one, there is no character substitution on the new branch. image

skolj commented 11 months ago

Looks like the PR for this is still open. Are there any plans to merge it? I'd like to give this a shot if there won't be any progress with the current PR.

raulhammerl commented 1 week ago

@jesseduffield @Zombiefleischer can we get this issue / the PR moving again? Would be interested in this as well :)

If I can help I would be open to add the missing tests to the PR.