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

[feature request] Add configurable feature branch separator #1069

Closed
halostatue opened this issue Sep 11, 2023 · 1 comment · Fixed by #1072
Closed

[feature request] Add configurable feature branch separator #1069

halostatue opened this issue Sep 11, 2023 · 1 comment · Fixed by #1072

Comments

@halostatue
Copy link
Contributor

After having been burned a few too many times by the use of / to separate branch parts (it works, but it doesn't necessarily work the way that people think it should unless they're git experts), I have an aversion to this separator being used and do not allow it at the workplace. It would be useful to be able to have a default configuration and/or a flag to be able to specify this value.

git config --get git-extras.feature.separator and/or -s|--separator would be useful from my perspective.

This way I could do git config git-extras.feature.separator - and I would get feature-branchname instead of feature/branchname.

@spacewander
Copy link
Collaborator

LGTM.
PR is welcome!

spacewander pushed a commit that referenced this issue Sep 19, 2023
* git-feature: add configurable branch separator

Closes #1069

This allows the use of a separator other than `/` for feature or other
alias branches. While a command-line option has been provided (`-s` or
`--separator`), this will most often be used via
`git-extras.feature.separator`.

* Significant update to bin/git-feature

- Changed option parsing so that `--alias` requires an argument and will
  fail with an error unless provided. Applied the same logic to
  `--separator`.

- Changed `finish` parsing to capture it as a variable flag during
  argument parsing.

  This could be extended so that if `finish` is already true, a second
  `finish` results in the word being added to the argument list.

  ```console
  $ git feature -- finish remote
  $ git feature finish finish remote
  ```

  This has not been done because it is a bit of an inconsistent handling
  for documentation purposes.

- Add handling of `--` to permit options or `finish` to be made part of
  the feature branch name.

- Since `finish` is now a variable flag, simplify the name-building
  logic to always use `concatargs "${argv[@]}"`. This means that
  `git feature finish ...` and `git feature ...` behave the same in
  terms of feature branch name building.

- Basically rewrote the man page to include better descriptions of the
  options as well as adding a GIT CONFIG section and additional EXAMPLES
  for the new features/behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants