Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: abbreviate path from git root #719

Closed
elsassph opened this issue Nov 25, 2019 · 4 comments
Closed

Feature request: abbreviate path from git root #719

elsassph opened this issue Nov 25, 2019 · 4 comments

Comments

@elsassph
Copy link
Contributor

elsassph commented Nov 25, 2019

System Details

  • posh-git version/path: 1.0.0 beta3 ~/.local/share/powershell/Modules/posh-git/1.0.0
  • PowerShell version: 6.2.3
  • git version 2.21.0 (Apple Git-122.2)
  • OS: Unix 18.7.0.0

Issue Description

My abbreviated path can be pretty long and maybe there could be an option to abbreviate based on the closest git root (including the folder name), so it would essentially show the path within the project I'm working.

e.g.

~/company/work/projects/client/project-name/src [master] >

Could be further shortened to:

-/project-name/src [master] >
@elsassph
Copy link
Contributor Author

elsassph commented Dec 2, 2019

What are the contributions guidelines? Has this feature (with proposed implementation) a chance to be accepted?
cc @dahlbyk @rkeithhill

@rkeithhill
Copy link
Collaborator

We should probably have some contribution guidelines. Short version, following the existing coding style in the function/script you're modifying. If there are tests for the function you are modifying, please add new Pester tests to cover the changed/new functionality. All tests must pass before PR would be accepted. And yes, IMO I would accept this feature. My only question is would it be enough to add an optional parameter to the Get-PromptPath function which would require the user to have to change the $GitPromptSettings.DefaultPromptPath setting. Or should we also add yet another setting to enable this feature? Could go either way.

@elsassph
Copy link
Contributor Author

elsassph commented Dec 2, 2019

@rkeithhill well I also did a PR adding an extra option for it. CI is green, but I'll look into adding a test specific to it.

Maybe the path manipulations would be worth extracting into more easily testable functions BTW, unless that would add noise (I'm not familiar with all subtleties of pwsh).

@dahlbyk
Copy link
Owner

dahlbyk commented Mar 14, 2020

Closed by #720. Thanks for the contribution!

@dahlbyk dahlbyk closed this as completed Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants