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

Release v0.7.2 #522

Merged
merged 19 commits into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# posh-git Release History

## 0.7.2 - January 10, 2018

- posh-git now exports the variable `$GitPromptScriptBlock` which contains the code for the default prompt.
([#501](https://github.com/dahlbyk/posh-git/issues/501))
([PR #513](https://github.com/dahlbyk/posh-git/pull/513))

If you need to execute your own logic in your own prompt function but still want to display the default posh-git
prompt, you can execute this scriptblock from your prompt function e.g.:

```powershell
# profile.ps1
function prompt {
Set-NodeVersion
&$GitPromptScriptBlock
}
Import-Module posh-git
```

- Added `Add-PoshGitToProfile -AllUsers` support
([PR #504](https://github.com/dahlbyk/posh-git/pull/504))
- Fixed 'Write-Prompt' to be able use Black as foreground color.
([#470](https://github.com/dahlbyk/posh-git/pull/470))
([PR #468](https://github.com/dahlbyk/posh-git/pull/468))
Thanks Vladimir Poleh (@vladimir-poleh)
- Pass "git.exe" instead of "git" to Get-Command.
([PR #478](https://github.com/dahlbyk/posh-git/pull/478))
([PR #479](https://github.com/dahlbyk/posh-git/pull/479))
Thanks Mike Sigsworth (@mikesigs)
- Squash ssh agent warnings if `-Quiet`.
([PR #484](https://github.com/dahlbyk/posh-git/pull/484))
Thanks Refael Ackermann (@refack)
- Fixed directory names that contain [brackets] cause GitPrompt to fail.
([PR #502](https://github.com/dahlbyk/posh-git/pull/502))
Thanks Duncan Smart (@duncansmart)
- Fixed duplicated branch completion for git checkout
([#505](https://github.com/dahlbyk/posh-git/issues/505))
([PR #506](https://github.com/dahlbyk/posh-git/pull/506))
([PR #512](https://github.com/dahlbyk/posh-git/pull/512))
Thanks Christoph Bergmeister (@bergmeister)
- Fixed PSScriptAnalyzer warnings in the source
([PR #509](https://github.com/dahlbyk/posh-git/pull/509))
Thanks Christoph Bergmeister (@bergmeister)
- Fixed errors added to $Error collection by `Get-GitStatus` command
([#500](https://github.com/dahlbyk/posh-git/issues/500))
([PR #514](https://github.com/dahlbyk/posh-git/pull/514))
- Add custom path rendering in prompt
([#469](https://github.com/dahlbyk/posh-git/issues/469))
([PR #520](https://github.com/dahlbyk/posh-git/pull/520))
- Clean up wording for work dir local status in help file
([PR #516](https://github.com/dahlbyk/posh-git/pull/516))
- Add code coverage to Coveralls.io
([#416](https://github.com/dahlbyk/posh-git/pull/416))
([PR #461](https://github.com/dahlbyk/posh-git/pull/461))
Thanks Jan De Dobbeleer (@JanJoris)

## 0.7.1 - March 14, 2017

- Fixed tab completion issues with duplicate aliases
Expand Down
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If not, PLEASE fill in the following details so that we can help you!
To retrieve the system details, paste the following line into PowerShell, press Enter
and then copy/paste the resulting output above.

"- posh-git version/path: $($m = Get-Module posh-git; '{0} {1} {2}' -f $m.Version,$m.PrivateData.PSData.PreReleaseVersion,$m.ModuleBase.Replace($HOME,'~'))`n- PowerShell version: $($PSVersionTable.PSVersion)`n- $(
"- posh-git version/path: $($m = Get-Module posh-git; '{0} {1} {2}' -f $m.Version,$m.PrivateData.PSData.Prerelease,$m.ModuleBase.Replace($HOME,'~'))`n- PowerShell version: $($PSVersionTable.PSVersion)`n- $(
git --version)`n- OS: $([System.Environment]::OSVersion)"
-->

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ You can also tab complete remote names and branch names e.g.: `git pull or<tab>
- `master` avoids breaking changes, maintaining v0.x.
( [README](https://github.com/dahlbyk/posh-git/blob/master/README.md)
• [CHANGELOG](https://github.com/dahlbyk/posh-git/blob/master/CHANGELOG.md) )
- Supports PowerShell 3+
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should be Windows PowerShell 3+ to help make distinction between Windows PowerShell and PowerShell Core.

- `develop` includes breaking changes, toward [v1.0](https://github.com/dahlbyk/posh-git/issues/328).
( [README](https://github.com/dahlbyk/posh-git/blob/develop/README.md)
• [CHANGELOG](https://github.com/dahlbyk/posh-git/blob/develop/CHANGELOG.md) )
- Supports PowerShell 5 and PowerShell Core 6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the first one to Windows PowerShell 5.x - includes 5.0 and 5.1.

- Supports [ANSI escape sequences](https://en.wikipedia.org/wiki/ANSI_escape_code) for color customization
- Previous releases:
- v0.7.1
( [README](https://github.com/dahlbyk/posh-git/blob/v0.7.1/README.md)
Expand Down
4 changes: 2 additions & 2 deletions chocolatey/packAndLocalInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
param ($Remote = 'origin', [switch]$Force)
pushd $PSScriptRoot
Push-Location $PSScriptRoot

$nuspec = [xml](Get-Content poshgit.nuspec)
$version = $nuspec.package.metadata.version
Expand All @@ -17,4 +17,4 @@ elseif (!$(git ls-remote $Remote $tag)) {
choco pack poshgit.nuspec
choco install -f -y poshgit -pre --version=$version -s .

popd
Pop-Location
4 changes: 2 additions & 2 deletions chocolatey/poshgit.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>poshgit</id>
<title>posh-git</title>
<version>0.7.2-pre0</version>
<version>0.7.2-pre1</version>
<authors>Keith Dahlby, Mark Embling, Jeremy Skinner, Keith Hill</authors>
<owners>Keith Dahlby</owners>
<description>### posh-git
Expand All @@ -27,7 +27,7 @@ Note on performance: displaying file status in the git prompt for a very large r
<summary>Provides prompt with Git status summary information and tab completion for Git commands, parameters, remotes and branch names.</summary>
<tags>poshgit posh-git powershell git</tags>
<projectUrl>https://github.com/dahlbyk/posh-git</projectUrl>
<licenseUrl>https://github.com/dahlbyk/posh-git/blob/master/LICENSE.txt</licenseUrl>
<licenseUrl>https://github.com/dahlbyk/posh-git/blob/v0.7.2-pre1/LICENSE.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies>
<dependency id="chocolatey" version="0.9.10" />
Expand Down
20 changes: 10 additions & 10 deletions chocolatey/tests/InstallChocolatey.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Describe "Install-Posh-Git" {
RunInstall

$newProfile = (Get-Content $Profile)
$pgitDir = [Array](Dir "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
$pgitDir = [Array](Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
($newProfile -like ". '$poshgitPath\posh-git\profile.example.ps1'").Count.should.be(0)
($newProfile -like ". '$pgitDir\profile.example.ps1'").Count.should.be(1)
}
Expand All @@ -59,7 +59,7 @@ Describe "Install-Posh-Git" {
RunInstall

$newProfile = (Get-Content $Profile)
$pgitDir = [Array](Dir "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
$pgitDir = [Array](Get-ChildItem "$poshgitPath\*posh-git*\" | Sort-Object -Property LastWriteTime)[-1]
($newProfile -like ". '$pgitDir\profile.example.ps1'").Count.should.be(1)
}
catch {
Expand Down Expand Up @@ -94,15 +94,15 @@ Describe "Install-Posh-Git" {
try{
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
New-Item function:\global:Write-Host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) try{Write-Output `$object;[string]`$global:wh += `$object.ToString()} catch{}"

Prompt

Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -122,15 +122,15 @@ Describe "Install-Posh-Git" {
Remove-Item $Profile -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
New-Item function:\global:Write-Host -value "param([object] `$object, `$backgroundColor, `$foregroundColor, [switch] `$nonewline) try{Write-Output `$object;[string]`$global:wh += `$object.ToString()} catch{}"

Prompt

Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -152,7 +152,7 @@ Describe "Install-Posh-Git" {
Add-Content $profile -value "function prompt {Write-Host 'Hi'}" -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
. $Profile
$global:wh=""
Expand All @@ -161,7 +161,7 @@ Describe "Install-Posh-Git" {
Prompt

Remove-Item function:\global:Write-Host
Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand All @@ -183,7 +183,7 @@ Describe "Install-Posh-Git" {
Add-Content $profile -value ". 'C:\tools\poshgit\dahlbyk-posh-git-60be436\profile.example.ps1'" -Force
RunInstall
mkdir PoshTest
Pushd PoshTest
Push-Location PoshTest
git init
write-output (Get-Content function:\prompt)
. $Profile
Expand All @@ -193,7 +193,7 @@ Describe "Install-Posh-Git" {
Prompt

Remove-Item function:\global:Write-Host
Popd
Pop-Location
$wh.should.be("$pwd\PoshTest [master]")
}
catch {
Expand Down
2 changes: 2 additions & 0 deletions src/GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ $global:GitPromptSettings = [pscustomobject]@{
DefaultPromptSuffix = '$(''>'' * ($nestedPromptLevel + 1)) '
DefaultPromptDebugSuffix = ' [DBG]$(''>'' * ($nestedPromptLevel + 1)) '
DefaultPromptEnableTiming = $false

DefaultPromptPath = '$(Get-PromptPath)'
DefaultPromptAbbreviateHomeDirectory = $false

Debug = $false
Expand Down
2 changes: 1 addition & 1 deletion src/GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function Find-Pageant() {
# Attempt to guess $program's location. For ssh-agent/ssh-add.
function Find-Ssh($program = 'ssh-agent') {
Write-Verbose "$program not in path. Trying to guess location."
$gitItem = Get-Command git -Erroraction SilentlyContinue | Get-Item
$gitItem = Get-Command git -CommandType Application -Erroraction SilentlyContinue | Get-Item
if ($null -eq $gitItem) {
Write-Warning 'git not in path'
return
Expand Down
21 changes: 21 additions & 0 deletions src/Utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,27 @@ function Get-PathStringComparison {
}
}

function Get-PromptPath {
$settings = $global:GitPromptSettings
$abbrevHomeDir = $settings -and $settings.DefaultPromptAbbreviateHomeDirectory

# A UNC path has no drive so it's better to use the ProviderPath e.g. "\\server\share".
# However for any path with a drive defined, it's better to use the Path property.
# In this case, ProviderPath is "\LocalMachine\My"" whereas Path is "Cert:\LocalMachine\My".
# The latter is more desirable.
$pathInfo = $ExecutionContext.SessionState.Path.CurrentLocation
$currentPath = if ($pathInfo.Drive) { $pathInfo.Path } else { $pathInfo.ProviderPath }

$stringComparison = Get-PathStringComparison

# Abbreviate path by replacing beginning of path with ~ *iff* the path is in the user's home dir
if ($abbrevHomeDir -and $currentPath -and $currentPath.StartsWith($Home, $stringComparison)) {
$currentPath = "~" + $currentPath.SubString($Home.Length)
}

return $currentPath
}

function Get-PSModulePath {
$modulePaths = $Env:PSModulePath -split ';'
$modulePaths
Expand Down
11 changes: 6 additions & 5 deletions src/posh-git.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ModuleToProcess = 'posh-git.psm1'

# Version number of this module.
ModuleVersion = '0.7.2.0'
ModuleVersion = '0.7.2'

# ID used to uniquely identify this module
GUID = '74c9fd30-734b-4c89-a8ae-7727ad21d1d5'
Expand All @@ -25,6 +25,7 @@ PowerShellVersion = '2.0'
FunctionsToExport = @(
'Invoke-NullCoalescing',
'Add-PoshGitToProfile',
'Get-PromptPath',
'Write-GitStatus',
'Write-Prompt',
'Write-VcsStatus',
Expand All @@ -47,7 +48,7 @@ FunctionsToExport = @(
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = @()
VariablesToExport = @('GitPromptScriptBlock')

# Aliases to export from this module
AliasesToExport = @('??')
Expand All @@ -61,16 +62,16 @@ PrivateData = @{
Tags = @('git', 'prompt', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion')

# A URL to the license for this module.
LicenseUri = 'https://github.com/dahlbyk/posh-git/blob/master/LICENSE.txt'
LicenseUri = 'https://github.com/dahlbyk/posh-git/blob/v0.7.2-pre1/LICENSE.txt'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/dahlbyk/posh-git'

# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/dahlbyk/posh-git/blob/master/CHANGELOG.md'
ReleaseNotes = 'https://github.com/dahlbyk/posh-git/blob/v0.7.2-pre1/CHANGELOG.md'

# TODO: REMOVE BEFOE RELEASE
PreReleaseVersion = 'pre0'
Prerelease = 'pre1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to update this or do you do that manually before you publish?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll drop this and fix all the other -pre1 references before I commit and tag v0.7.2.

}

}
Expand Down
Loading