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

Automatically replace disallowed characters with allowed characters in create branch form field #471

Closed
griest024 opened this issue Mar 2, 2021 · 5 comments
Assignees
Labels
feature request Feature request nice to have A feature request that is nice to have (lower priority)
Milestone

Comments

@griest024
Copy link

Describe the feature that you'd like
When typing the name of the branch in the create branch dialog form field, I would like an allowed character (e.g. hyphen: -) to be automatically substituted in when I type a disallowed character (e.g. space: ).

Additional context (optional)
The inserted character should probably be configurable as I imagine some people would prefer _ over -.

@griest024 griest024 added the feature request Feature request label Mar 2, 2021
@mhutchie mhutchie added the nice to have A feature request that is nice to have (lower priority) label Mar 2, 2021
@mhutchie
Copy link
Owner

mhutchie commented Mar 2, 2021

Hi @griest024,

Thanks for raising this feature request, it would definitely be nice to have in Git Graph!

It seems like the space substitution you mentioned as an example would be the most useful.

There are numerous other disallowed characters that I don’t think there is a natural substitution for (e.g. ~, ^, :, ?, *, [). I’ll have a think about how these should be substituted (if at all). Let me know if you have any ideas.

@griest024
Copy link
Author

There are numerous other disallowed characters that I don’t think there is a natural substitution for (e.g. ~, ^, :, ?, *, [). I’ll have a think about how these should be substituted (if at all). Let me know if you have any ideas.

I think at the very least the form field should not allow those characters to be inserted into the branch name string. You could add a config option for each one of those characters but that seems cumbersome and most likely YAGNI.

I say for now just add an option to configure the space replacement character. I would be willing to submit a PR; let me dig into the codebase a little and I'll get back to you.

@mhutchie
Copy link
Owner

mhutchie commented Mar 3, 2021

Hi @griest024,

I agree that for now let's focus on the space replacement in all reference dialog inputs.

This is actually really quick and easy for me to do - I'm doing a beta release in around 9 hours, so I'm happy to implement it so it can be included in it.

@mhutchie mhutchie added this to the v1.30.0 milestone Mar 3, 2021
@griest024
Copy link
Author

griest024 commented Mar 3, 2021

@mhutchie okay go for it, don't let me hold you up

Edit: feel free to ping me for a beta test

mhutchie added a commit that referenced this issue Mar 3, 2021
@mhutchie
Copy link
Owner

mhutchie commented Mar 3, 2021

Automatic space substitution on reference inputs on dialogs will be available in v1.30.0.

The new extension setting git-graph.dialog.general.referenceInputSpaceSubstitution lets the user choose between "None", "Hyphen" & "Underscore". Currently it is set to "None" by default, so users must set their preference before any substitution is performed. In the future we can reconsider the default value of this setting, if this receives positive user feedback.

If you'd like to use / test it before the next release, you can download v1.30.0-beta.0, and install it following the instructions provided here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request nice to have A feature request that is nice to have (lower priority)
Projects
None yet
Development

No branches or pull requests

2 participants