-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Roadmap to 1.0 #328
Comments
cc @ferventcoder and @mwrock for Chocolatey input. Do you know of any other Chocolatey packages for PowerShell modules that are now available from the gallery? Would it make sense to try to restructure the package to just make sure PowerShell Gallery and the posh-git module are installed? Update: Could Chocolatey package depend on https://chocolatey.org/packages/powershell-packagemanagement? |
cc @shiftkey for GitHub Desktop implications. Do you have any telemetry for PowerShell versions used in the wild? |
@dahlbyk I would consider If you also decide to continue releasing to Chocolatey's community repository, I would treat it differently and not just have it use Side note: I've thought about adding the concept of |
Note: While I say treat them separately, there is nothing from Chocolatey's end stopping you from building a package that is compatible with both PowerShell Gallery and Chocolatey and releasing to both the PS Gallery and Chocolatey's Community Repository. |
I think it makes sense to use Chocolatey to support install on PS v2 and maybe v3/v4 as well. Although there is a PackageManagement/PowerShell install for v3/v4. I'd prefer we drop support for PSGet as it is just confusing with PowerShellGet and the latter is clearly the future for the distribution of PowerShell modules. I'm not sure there is much to document WRT the
Profile scripts tend to personal / protected in nature. I mean PowerShell power users don't like you messing with their profile scripts. :-) They are also particular about which profile script imports a particular module. Some may want it in all AllUsersAllHosts, others in CurrentUserAllHosts and yet others in CurrentUserCurrentHost. One thing we could do here, which is how I tend to "configure" my modules, is to provide a Import-Module posh-git
# Set up a simple prompt that displays Git status summary info when inside of a Git repo.
function global:prompt {
$origLastExitCode = $LASTEXITCODE
# 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
$curPath = if ($pathInfo.Drive) { $pathInfo.Path } else { $pathInfo.ProviderPath }
Write-Host $curPath -NoNewline
# Write the Git status summary information to the host.
Write-VcsStatus
$global:LASTEXITCODE = $origLastExitCode
"> "
}
# We could also provide several prompt variations in this file that are commented out. The user could choose between them. Then we could add a command like
On v2, this will need to be a bit different:
The command would direct the user to look at posh-git_config.ps1 and tweak their prompt as desired. Keep in mind that many PowerShell users already have a prompt function so they are more likely to want to look at examples and integrate the posh-git status summary into their prompt function. They probably wouldn't use this command. |
Regaring semver, I think it is beneficial for PowerShellGet users to be able to easily remember/type the version number in case they want to either install or import a specific version. We can encode the build date into another module field if wanted. Perhaps a BuildDate/SHA1 set of fields in the PrivateData field of the manifest? |
Edit - I meant PowerShellGet (not PSGet in my first statement, I specifically used "PS-Get" to separate the idea but I see the confusion). Edited. |
Huge fan of this as well. The date on the end I think was either using a misunderstood package fix version notation as a release version notation or it was just easier to identify for someone (maybe me a long, long time ago). |
I suspect that this might be hard sell and not easy thing to do - but I'd love to see posh-git implementing new way of tab-completing command elements (assuming you got v5.0+ route). TabExpansion is so v2... ;) And a side note:
Please make sure if the profile is signed, you take that into account. To many "installers" in the wild tend to ignore that "at the end" may mean "in the part where there should not be any code". |
There's a reasonable chance that v1.0.0 will support only v5 and higher (and cross-platform as well). v0.x could be maintained on a release branch to continue to support (bug fixes only) PowerShell v2 thru v4 for some time. For the v1.0.0 version, @lzybkr may help us switch over to Register-ArgumentCompleter. :-) RE signed profile scripts - thanks for the heads up. In that case, I think the command would probably refuse to make the change but we could emit a warning that says something to the effect:
|
Also if you ensure the profile is signed, ensure the file is bigger than 4 bytes. |
From a user POV, I think it makes sense to have https://www.powershellgallery.com/ as the canonical release channel. |
Do releases on those package platforms include manual work? Maybe it's worth it to automate such stuff and put it into a central way (like CI) so that every source you can use to get posh-git is actually up to date. Also does corss platform (as in Powershell Core) mean we need tests that run on different machines or does it "just work"? (haven't tried it yet) |
I agree that PowerShell Gallery is the canonical release channel for PowerShell modules. I was thinking a release to the Chocolatey community repository as well as an alternative location (but not required) |
I think it's fine to have alternative release channels, but IMHO they should not hold up releases to the canonical channel. |
I did not realize this was the case. Then by all means go for the canonical channel first. |
I don't think it is that big of a deal to release both via the PSGallery and Chocolatey and for now, we need Chocolatey since there is no PowerShellGet support on PS v2.
@ferventcoder Thanks for the tip! |
Thanks, @ferventcoder. I have a feeling our Chocolatey strategy will depend on whether or not we end up taking on any other PS Gallery dependencies (e.g. TabExpansionPlusPlus). I suppose the other option would be to ship a "final" 1.0 version on Chocolatey that says "moved to PS Gallery". We'll see what makes sense. |
Agreed. Honestly, I never thought much about version numbers for Chocolatey releases because it always installed latest anyway. 😏 As for installing posh-git, I have zero attachment to
There are also discussions that could be had about whether it's posh-git's place to worry about |
So I'm also pondering if there's some way to teach the posh-git module to install/repair itself without an explicit step, e.g.
We could also check here if either profile is signed and cannot be updated. As for |
We can do a I also think we have to be careful with auto-checks like this every time a module is imported. PS v5 is already notifying me that on some machines my profile scripts are slowing the PS load time. :-( |
I guess my thought is that posh-git is close to useless without being loaded as part of a profile. Maybe we could only offer to modify the user's profile if |
I will investigate how to detect if the import is running from a profile or not. If we can quickly assess that then sure, we could ask the user if they want their profile to be modified to import posh-git. I want to finish the prompt install first though. :-) |
WMF 5.1 was released earlier this year for Windows 7 and Windows 2012 R2 as well: https://www.microsoft.com/en-us/download/details.aspx?id=54616. We can update the installed WMF 3. |
OK I'm going to seriously propose dropping support for PS 2, 3 and 4 in the I have several PR's pending that:
|
OK bit more work on the refactoring of $status=Get-GitStatus
"[$(Write-GitWorkingDirStatusSummary $status -NoLeadingSpace) " +
"$(Write-GitWorkingDirStatus $status -NoLeadingSpace) || " +
"$(Write-GitIndexStatus $status -NoLeadingSpace)/" +
"$(Write-GitBranchStatus $status -NoLeadingSpace) " +
"$(Write-GitBranchName $status -NoLeadingSpace)]" |
BTW if anybody would like to try this out on Linux or macOS or PowerShell Core on Windows, checkout the |
I'm fine with this. Is PowerShellGet smart enough to fetch 0.x on older platforms if 1.x requires PS 5+? |
That is a question I posted in the Slack channel - https://powershell.slack.com/messages/C22L60F5E I haven't gotten an answer yet. @lzybkr would you happen to know? |
BTW we should consider removing the chocolatey install support in 1.0.0. Everywhere there is PS 5.0 or higher, there is PowerShellGet - including Linux and macOS. |
I don't think PowerShellGet has any smarts about installing something that won't work, and it might be annoying if it did, e.g. if you were installing to a location that might be shared across versions. It seems reasonable to require users to specify a precise version to get support for <V5, or to just use chocolatey assuming that package is never updated. |
@lzybkr Thanks. OK yeah, Are there any usage stats for versions of PowerShell? Since v2 has been deprecated, I expect its usage to be low. And since v4 was a Win8 version, I suspect its usage is also very low. So what is of interest is the v3 usage share and how long we'll need to support v3. |
For 0.7.1, Chocolatey has 50% more downloads than PowerShell Gallery. It seems reasonable for the 1.0+ Chocolatey install/upgrade/uninstall to delegate to PowerShellGet for the exact package version. |
Do we need to worry about someone trying to run the Chocolatey script from the repo on Linux/macOS? I mean there's no choco on those platforms. Just wondering if it's worth putting in a platform check or if it falls under the category of "sharp stick, don't poke yer eye out". :-) |
Not entirely true. Chocolatey has worked on Linux/macOS since 2014 (publicly available in March 2015), but it's only typically used for package maintenance. Installations won't run PowerShell on POSIX environments, so you have nothing to worry about. |
FYI, all: we've shipped 1.0.0-beta1 to the PowerShell Gallery. I've updated the task list here to reflect what I believe still needs to be resolved before we a final 1.0.0 release:
|
@ferventcoder does Chocolatey have a mechanism to specify that a package only works for PowerShell 5+? |
@dahlbyk yes, use dependencies with version ranges. Just like you would in NuGet. Take a dependency on the "powershell" package with a range or minimum version - https://docs.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges-and-wildcards If you don't want it to automatically upgrade folks to PowerShell v5, then consider something more along the lines of setting a requires in the install script itself and failing. https://ss64.com/ps/syntax-requires.html |
ICYMI, 1.0.0-beta2 was pushed to the PowerShell Gallery earlier this week. For anyone who cares about Chocolatey, there's an active discussion over in #473. In particular, the question was raised if posh-git should continue to automatically modify the current user's |
Is it still possible to define a different color for the git branch name depending if it is ahead/behind the remote? Right now I have:
But I can't seem to find any other branch color settings. Perhaps related: #212 |
@Laoujin it is! Not necessarily intuitive, but branch names are displayed with the same color as the relevant ahead/behind symbol:
You can set |
Thanks! Silly me thought that would only change the symbol color so I hadn't tried it.. |
Are you going to continue to prevent TabExpansionPlusPlus from being installed? It would be nice to be able to add other tab completion things to my PS profile UPDATE: Oh wait.. this is a bug w/ TabExpansionPlusPlus? |
@tommck were you able to figure this out? I'm not aware of incompatibility, but please open a dedicated issue if you find otherwise. |
Forgot to address this issue before shipping 0.7.0 - dahlbyk/posh-git#328 (comment) Merge to develop.
First off, huge thanks to @rkeithhill for his recent help in pushing posh-git forward! He suggested adopting SemVer and using 1.0 for the forewarned dropping of support for PowerShell 2.0. We should also consider if 1.0 is a good time to drop support for versions prior to PowerShell 5.0. Before we do that, I think it makes sense to cut a "final" (modulo minor bug fixes) pre-1.0 release.
The 1.0 milestone also give us an opportunity to revisit the many ways that posh-git is currently distributed:
git clone <url> && .\install.ps1
.\install.ps1
master
)So... tentative roadmap:
posh-git 0.7
prompt
self-installing from the module (Move simple prompt to the module. #217)posh-git 1.0
Invoke-NullCoalescing
)profile.example.ps1
The text was updated successfully, but these errors were encountered: