lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Allow setting a default name when creating new branches

Open elliotcubit opened this issue 1 year ago • 1 comments

  • PR Description

I commonly prefix my branch names with my first initial and last name, such as this one (ecubit/branch-prefixes). It can be a bit annoying to type out.

This PR adds a config option to set a default value for the name in the branch creation modal.

If there would have previously been a branch name autofilled (I do not know all such cases), this change has no effect.

  • Please check if the PR fulfills these requirements
  • [x] Cheatsheets are up-to-date (run go generate ./...)
  • [x] Code has been formatted (see here)
  • [x] Tests have been added/updated (see here for the integration test guide)
  • [ ] Text is internationalised (see here)
    • CONTRIBUTING.md says I may submit without doing localization (and I am unable)
  • [x] Docs (specifically docs/Config.md) have been updated if necessary
  • [x] You've read through your own file changes for silly mistakes etc

elliotcubit avatar Apr 09 '24 19:04 elliotcubit

why not make it repository specific as well, like in predefined commit message prefix.

EliasA5 avatar May 24 '24 19:05 EliasA5

Thanks for making this @elliotcubit . I've taken the liberty of pushing a change to the test to make it more focused.

@EliasA5 we'll eventually have a proper solution for defining arbitrary repo-specific config values, so I'd rather wait for that than to add another thing like commitPrefixes now. See https://github.com/jesseduffield/lazygit/issues/3293

jesseduffield avatar Jul 06 '24 10:07 jesseduffield