-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enhancement: bundle posh-git? #1384
Comments
Sounds good!
Yes.
Is that planned?
Makes sense. Either the user updates Git for Windows (and gets the posh-git updates via |
I'm a month overdue for a release, so I'll ship that soon. |
After running into trouble when e.g. a new Git LFS version came out and users expected a new Git for Windows version to be released just because of that, I think we'll try to learn from that experience a bit and not bundle posh-git. |
Well this is embarrassing. As I said:
posh-git has never been part of my job, and interest/availability ebbs and flows. Squeaky wheels get the grease, so I'll probably get a release out this weekend. If posh-git is the right technical solution for bundling a PowerShell experience with Git for Windows, let's add maintainers and automate releases to remove me as a bottleneck. Or companies that have benefited from it for a decade could sponsor me to spend more time on it. Or I could transfer ownership and walk away.
An |
Do you still think it'd be a good idea to bundle posh-git in Git for Windows? It would give it a lot of visibility AKA increased maintenance burden... |
I think it would be good for Git for Windows to provide/recommend how to do what Git Bash does (prompt, tab completion) in the default Windows shell. If posh-git is the best option to achieve that, let's figure out how to make that sustainable. Having this goal to work towards might rekindle my interest. |
@dahlbyk so how frequently is posh-git updated (if it really is rarely, I'll gladly reverse my stance)? What is the best way to install it system-wide (I'd like to implement this in InnoSetup, so the ideal for me would be "copy this set of files to that destination, then run this command" or something like that)? |
Looking at https://github.com/dahlbyk/posh-git/releases, it's roughly once a year (ignoring pre-releases and the occasional two releases on the same day (0.7.0/0.7.1 in april 2017, 0.7.2/0.7.3 in april 2018)) |
Okay, once a year-ish is totally doable. The only remaining concern is: are there occasionally vulnerabilities that require coordinated releases? |
I guess I should ping @dahlbyk ;-) |
Updates could theoretically be as frequent as Git adds commands or command flags, if that were a goal. But actual blocking things like the Git LFS version issue are rare, which is why I've not internalized a sense of urgency to ship releases.
Three options to consider:
The other question is if we should run Could check how Chocolatey handles this for their module.
I don't know that we've ever had an actual vulnerability reported. The vast majority of what we do is just calling |
@dahlbyk great, thanks! My current thinking is that we should make this a new option (probably a new checkbox just like "Check daily for updates"), and use the PSGallery option, i.e. avoid bundling a specific Pardon my ignorance, though: what commands would I run to check if it is installed, to find out whether there is a newer version, and what commands would be needed to upgrade if there is a new version? |
I assume it's mostly standard Powershell Modules commands, so
|
I think there are actually two potential settings:
2 only makes sense if 1 is selected.
@rimrul is correct, though Note also that An edge case we'll need to test is how to behave if the PSGallery isn't marked as trusted. I suppose we could check trust status and reset to untrusted after install if necessary? |
I'd just straight up ask the user if they want to trust PSGallery and then leave it trusted. I've considered letting powershell ask, but I don't quite understand when it asks that question in a separate window and when it just asks on the console (which the users wont see and would block the installer indefinitely). Another edge case might be a fresh powershell install where powershell might ask the user to install the nuget provider. (With the same issue of potentially hanging indefinitely) |
We could even add a note under the checkbox to clarify that choosing this option will ensure the Nuget provider and PSGallery repository will be marked as trusted. If the user has asked for Git for Windows to auto-update, presumably posh-git should auto-update too? Implementation-wise I'm assuming this essentially ends up as powershell.exe -File Install-PoshGit.ps1 -ExecutionPolicy Bypass -NonInteractive -NoProfile |
Why not use |
I would think a separate script would be easier to test, isolated from the installer? I've never had to ship an installer, so I'm content to defer to what you think would be easier to maintain. |
I actually find it simpler to put the call directly into the installer. See for example how we call the helper In any case, Git for Windows v2.34.0 is expected to land this coming Monday or Tuesday, and it is a little too late in the cycle for me to be comfortable with including a bigger change such as adding the option to install |
Agreed.
👍 I expect to publish a new posh-git release the week of Nov 22. Let me know what you need from me. |
Posh-Git is a very neat PowerShell module that serves as a PowerShell equivalent to Git's Bash prompt and tab completion. Let's offer it as an optional component; When selected, it will be installed from the PSGallery for all users and will then also be added to the profile. This addresses git-for-windows/git#1384 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dahlbyk I've opened a PR over at git-for-windows/build-extra#401, not sure whether you saw it. Now I have a question: should we uninstall Posh-Git when uninstalling Git for Windows? If so, how do I remove it from the users' profile, programmatically? |
🎉 Do you have a target date for 2.35?
Replied over in git-for-windows/build-extra#401 (review). |
We aim to have Git for Windows releases out within a few days after the corresponding Git release. According to https://tinyurl.com/gitCal Git 2.35.0 is scheduled to release on January 24th. |
Posh-Git is a very neat PowerShell module that serves as a PowerShell equivalent to Git's Bash prompt and tab completion. Let's offer it as an optional component; When selected, it will be installed from the PSGallery for all users and will then also be added to the profile. When selected, the uninstaller will also uninstall `posh-git`. This addresses git-for-windows/git#1384 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Posh-Git is a very neat PowerShell module that serves as a PowerShell equivalent to Git's Bash prompt and tab completion. Let's offer it as an optional component; When selected, it will be installed from the PSGallery for all users and will then also be added to the profile. When selected, the uninstaller will also uninstall `posh-git`. This addresses git-for-windows/git#1384 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Posh-Git is a very neat PowerShell module that serves as a PowerShell equivalent to Git's Bash prompt and tab completion. Let's offer it as an optional component; When selected, it will be installed from the PSGallery for all users and will then also be added to the profile. When selected, the uninstaller will also uninstall `posh-git`. This addresses git-for-windows/git#1384 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
I think it is time to close this, as experience shows that we won't ever get to it. |
@dscho reached out to me about bundling posh-git with Git for Windows, which I certainly support.
My tentative suggestion would be to have the Git for Windows installer detect a supported PowerShell version (see dahlbyk/posh-git#328 for version support discussion). If available, launch PowerShell to execute a script that runs
Install-Module
(included in 5.0+, or via PackageManagement PowerShell Modules Preview, if available.Install-Module accepts a
-Scope
parameter of eitherCurrentUser
orAllUsers
(paths). I assume the Git for Windows installer would be able to spawn an elevated shell to install withAllUsers
.The other part of installation is to inject
Import-Module posh-git
into a PowerShell profile, which can be one of:posh-git's
Add-PoshGitToProfile
supports-AllHosts
but does not support togglingCurrentUser
/AllUsers
.Release cadence is....infrequent? I'd just let PowerShellGet install the latest for the given platform.
The text was updated successfully, but these errors were encountered: