posh-git icon indicating copy to clipboard operation
posh-git copied to clipboard

Add remote name enum

Open marckassay opened this issue 1 year ago • 1 comments

This PR resolves feature request https://github.com/dahlbyk/posh-git/issues/781 more so than PR #908.

This PR utilizes PowerShell's enum flags for positioning the remote name relative to the branch name. I'm not sure if that is a concern since I'm pretty sure that is a somewhat newer feature for PowerShell. In addition to placement, the user can specify any value in between the remote and branch name.

If this PR is merged, it will require an additional image similar to the one in PR #908. Otherwise, a broken image link will occur in README.md. I can provide that image here in the next couple of hours or so if needed.

marckassay avatar Jul 14 '22 15:07 marckassay

I just updated images for README.md as best as I can at the moment. See them below.

PromptShowRemoteName.png: PromptShowRemoteName PromptShowRemoteNameEnd.png PromptShowRemoteNameEnd

If your profile is importing posh-git from your local repo and need to add a remote repo, I suppose you can add my repo to test:

git remote add marckassay https://github.com/marckassay/posh-git.git
git fetch marckassay
git checkout add-remote-name-enum

... and then start a new PS session. See the README to set this feature.

Also, feel free to make edits. Change names of properties for settings, function name, et cetera if desired. Fyi, the Placement enum labels are following CSS nomenclature which may not mentally map in the context of a PS module. So consider that too.

marckassay avatar Jul 14 '22 20:07 marckassay