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

EnablePromptStatus should not affect Get-GitStatus #475

Closed
jpludens opened this issue Jun 12, 2017 · 8 comments
Closed

EnablePromptStatus should not affect Get-GitStatus #475

jpludens opened this issue Jun 12, 2017 · 8 comments
Assignees
Milestone

Comments

@jpludens
Copy link

System Details

  • posh-git version/path: 0.7.1 C:\Program Files\WindowsPowerShell\Modules\posh-git\0.7.1
  • PowerShell version: 5.1.14393.1198
  • git version 2.10.0.windows.1
  • OS: Microsoft Windows NT 10.0.14393.0

Issue Description

I have a use case which needs to disable the command prompt status while still using the Get-GitStatus function. Disabling the prompt is easy: set GitPromptSettings.EnablePromptStatus to false. But, Get-GitStatus also checks that setting, making the command ineffective.

If this coupling is not intentional, I propose adding a separate setting, such as EnableGetStatus or EnableGetGitStatus, so that these pieces of functionality can be managed separately.

If it is intentional, a simple enough workaround is wrapping Get-GitStatus with a function that temporarily changes the GitPromptSettings.

@dahlbyk
Copy link
Owner

dahlbyk commented Jun 13, 2017

The EnablePromptStatus check living in Get-GitStatus is an artifact of decisions made a few years ago, but I'm hesitant to change it now to avoid breaking customized prompt functions.

Would it work for you if we added -Force option to Get-GitStatus that would override EnablePromptStatus?

@jpludens
Copy link
Author

Yeah, that would certainly get the job done. Thank you!

@rkeithhill rkeithhill added this to the v1.0 milestone Jan 1, 2018
@rkeithhill rkeithhill self-assigned this Jan 1, 2018
@dahlbyk
Copy link
Owner

dahlbyk commented Jan 10, 2018

@rkeithhill self-assigned this

Did you start on this?

@rkeithhill
Copy link
Collaborator

I looked at it and was starting to come to the same conclusion you had - nervous about the change. Unfortunately, it affects all the new Write-Git*Status commands because they need a status object to operate on.

@rkeithhill
Copy link
Collaborator

That said, I'm OK punting on this for the first beta.

@dahlbyk
Copy link
Owner

dahlbyk commented Jan 10, 2018

Would it work for you if we added -Force option to Get-GitStatus that would override EnablePromptStatus?

Let's just do this. It can easily target v0.x and be pulled into v1.

@rkeithhill
Copy link
Collaborator

I have a fix for this. Waiting on PR #533.

dahlbyk added a commit that referenced this issue Jan 18, 2018
@rkeithhill
Copy link
Collaborator

This is fixed in the upcoming 1.0.0-beta2.

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