Skip to content

Bust up Write-GitStatus into smaller functions to make it easier for individuals to override parts of the status display #345

@rkeithhill

Description

@rkeithhill

I see a number of PRs come across to change the Git status summary display for things that probably don't apply to that many folks. And folks can today write their own prompt function to take the information from Get-GitStatus to display the Git status summary, plus any additional information in anyway they would like. However, in many cases folks just want to tweak one area of the Git status summary info. With this in mind, we should break up the bits and pieces of Write-GitStatus into reusable functions.

Perhaps we have Write-GitStatus call down to Write-BranchStatus, Write-GitIndexStatus, and Write-GitWorkingDirStatus.

In one PR scenario the OP wants to display any tags associated with HEAD. In this case, the OP could create his own version of Write-BranchStatus to display tags. Then in his prompt function he could call Write-GitIndexStatus and Write-GitWorkingDirStatus to create the rest of the status summary text. This would make overriding an individual status summary section much easier.

You could make the functions even finer grained as well. Perhaps break down Write-BranchStatus into Write-BranchName and Write-BranchSyncStatus?

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions