Skip to content

Allow branchPrefix prompt to handle empty input during init #127

Description

@jtheuerkauf

If a branch prefix is not wanted for jj-spr setting up branches, it does accept "" or '':

$ jj-spr init
  [ ... clip ... ]
  ❓  What prefix should be used when naming Pull Request branches?
      Good practice is to begin with 'spr/' as a general namespace for
      spr-managed Pull Request branches. Continuing with the GitHub user name is
      a good idea, so there is no danger of names clashing with those of other users.
      The prefix should end with a good separator character (like '/' or '-'),
      since commit titles will be appended to this prefix.
Branch prefix: ''
$ jj config e --repo
[spr]
githubRemoteName = "origin"
githubRepository = "jtheuerkauf/learning-jj"
githubMasterBranch = "trunk"
branchPrefix = ''

If I clear the prefix and leave the input empty, it just restores the default. Also, is the empty string shown above actually an empty string, or will SPR try to use '' as part of a branch name?

I would like that prompt to allow blank input to achieve the same result, or to specify in the text above the prompt that ""/'' will set no-prefix.

$ jj-spr init
  [ ... ]
  ❓  What prefix should be used when naming Pull Request branches?
[ ... ]
Branch prefix:
$ jj config e --repo
[spr]
githubRemoteName = "origin"
githubRepository = "jtheuerkauf/learning-jj"
githubMasterBranch = "trunk"
branchPrefix =

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions