gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Branch name editing should replace spaces with dashes

Open pvinis opened this issue 1 year ago • 4 comments

This is an amazing feature of Fork.app, and I'd love to have it on gitbutler.

When I go to edit the branch name, I can type bla bla branch. In real time, then I press the first spacebar after bla, it should turn into bla-. That way the branch names are always valid.

pvinis avatar Feb 14 '24 20:02 pvinis

I could provide a PR, but I wanted to make sure there is an issue here first, and get your opinion.

pvinis avatar Feb 14 '24 20:02 pvinis

Well, that might be a good to have indeed, but instead, a more comprehensive whitelist should be used, and only the characters given in

https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names#naming-branches-and-tags

Should be allowed.

namanlp avatar Feb 14 '24 22:02 namanlp

I assume you're talking about the "Set branch name" dialog, so feel free to ignore me, but it kind of already works the way you describe if you rename a branch via the branch header instead:

https://github.com/gitbutlerapp/gitbutler/assets/52106/a0d95c02-2367-4873-9db2-56958f2697cf

askielboe avatar Feb 16 '24 16:02 askielboe

yea exactly! but i wanted it from the three dots at the bottom right on your video, and then rename.

pvinis avatar Feb 16 '24 16:02 pvinis

@pvinis under three dots menu we have set remote branch name dialog. When you submit your name, we replace spaces with dashes. Or you mean something different?

https://github.com/gitbutlerapp/gitbutler/assets/18498712/c15b0525-92e8-4727-a6df-5ec4f9e61041

PavelLaptev avatar Apr 16 '24 00:04 PavelLaptev

@PavelLaptev ah yes. that's exactly what I mean.

I expected the string in that input field to replace the spaced already so it's obvious that it will happen.

Either keep that issue for that, or you can call it done and close it. 👍

pvinis avatar Apr 16 '24 06:04 pvinis

I think there's still some room for improvement here but for now I think we handle this case well enough and will close. We have some changes lined up regarding the lanes anyway so I'd expect the UX surrounding this to improve quite a bit in the coming months ✌🏻

Thanks for the report!

Qix- avatar Apr 30 '24 13:04 Qix-