foriequal0 / git-trim

Automatically trims your branches whose tracking remote refs are merged or stray
MIT License
490 stars 14 forks source link

Unclear that `--delete remote:foo` will only delete merged branches #203

Open jyn514 opened 1 year ago

jyn514 commented 1 year ago

git trim -h says the following about --delete:

  -d, --delete <DELETE>
          Comma separated values of `<delete range>[:<remote name>]`. Delete range is one of the `merged, merged-local, merged-remote, stray, diverged, local, remote`. `:<remote name>` is only necessary to a `<delete range>` when the range is applied to remote branches. You can use `*` as `<remote name>` to delete a range of branches from all remotes. [default : `merged:origin`] [config: trim.delete]

Having merged-remote separate from remote makes it seem like remote deletes all branches, which isn't what I want since that will also break all my open PRs. It turns out that merged does actually do what I want, and merged-remote does something I don't quite understand that seems related to local tracking branches. It would be nice to have more clear names for these options.

I see that https://github.com/foriequal0/git-trim/blob/master/docs/git-trim.man does actually document this, but unfortunately it didn't get installed with cargo install so I never saw it before opening this issue :/