Skip to content

Automatically change branch name if it already exists #108

@DanielVandH

Description

@DanielVandH

I had made a PR to someones repo with this tool, and then had to follow up with another PR to include some other file types. Unfortunately, after going through all the corrections it then told me that the branch already exists:

Are you sure you want to create a pull request with these corrections? y, n, h: y
Creating a new branch "fix-typos"...
Error: Error: Command failed: git --work-tree="C:\Users\User\.github-spellcheck\DanielVandH\Manopt.jl" --git-dir="C:\Users\User\.github-spellcheck\DanielVandH\Manopt.jl\.git" branch fix-typos ba8d5cffafdbd65a5f81b72ab40240bec1624a04
fatal: a branch named 'fix-typos' already exists

Exiting...

so I then had to go and do the entire thing again (and again after I didn't realise I should've deleted the branch in the github-spellcheck repo rather than my fork of Manopt.jl, but that's on me).

Would it be a good idea to make the branch name change by default if fix-typos already exists (or, if not, check for the existence of this branch first before any work is done) and, if it does, use e.g. fix-typos-2? (and if fix-typos-n exists, sue fix-typos-n+1.) I'd make a PR to address this myself but I don't know any JavaScript to read any of the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions