abhinav / git-spice

Manage stacked Git branches
https://abhinav.github.io/git-spice/
GNU General Public License v3.0
220 stars 11 forks source link

submit: Handle remote ref name already taken #408

Open abhinav opened 1 month ago

abhinav commented 1 month ago

Today, all submit commands push to $remote/$name where $name is the same as the local branch name—except if the branch was renamed after the initial push.

This is fine as the default, but it doesn't handle the case where $name is already taken by the remote. This will especially be true if the local name happens to be something generic. We can probably inspect local tracking branches, and use a different name (e.g. $name-$n for an incrementing value of $n) if that's the case.