-
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
git bash auto update feature in windows #2187
Comments
I have no idea what you mean. Could you please clarify? |
SImilar to vscode if we have git auto update feature for git bash then it would be nice |
If I remember correctly, there is one already embedded, but I can't remember if that was for the SDK or the regular Git-for-Windows. Look in the Build-Extra repo. Because full releases don't occur that often, you won't see the note very often. (see the Git Calendar) |
There is a feature you can activate in the first page of the installer whereby Git for Windows will check for updates daily, and offer a notification when a new version is available (where you simply have to click a button to start the update). We do not have a feature to auto-update in a fully automated way. If this is desired, then once again, this is a perfect opportunity for a contributor to start enhancing Git for Windows. @kantiprasanna this is open source, have a look at how the current daily check is implemented. That should get you started. |
@dscho So if we want git for windows to update on its own would we have to run https://github.com/git-for-windows/build-extra/blob/ef78e61c865379ce2c07ec3b7fc01c6c930a054d/installer/install.iss#L2300 |
That file refers to the definition that is compiled into the official Git for Windows installer. I don't think that's what you meant. What I think you will want to run is |
@dscho Yeah this is what I meant, so in order to solve this we would need to achieve the following am I right: |
Yes. That'll be a lot trickier. |
@dscho I am not very familiar with the git for windows codebase but would a possible solution involve maybe warning the user that git is being updated ? |
That has nothing to do with Git's source code base. Your guess how to warn the user is as good as mine. Actually, yours is better than mine because you clearly thought about this more than I have. |
Yeah I was guessing that possibly we could do two things, that when a new update is detected check whether the git has an active running terminal if yes do not update, and when the user starts using it again we display that hey there is a new version available and we are updating it to the new version kindly wait. But it would still be difficult for users who keep the terminal running "forever" |
Right. At some stage, fully automatic updates without warning the users will become impossible. |
Maybe we could try and implement a sort of proof of concept in a pull request and then see if it works. |
A shell script using |
yeah , and where would this script be called from in git ? |
@sladyn98 I imagine you'd want a daily check? So you would piggy-back on top of the code that was introduced in git-for-windows/build-extra#155 and git-for-windows/build-extra@e4badda...d984925 |
I have a couple of follow-on questions on this issue, but folks can let me know if they think they should be in separate ones than this: First, is there any way to enable that auto-update (offered in the installer) if somehow we miss it? I just found that my gfw was over a year old. Of course, the git gui offers nothing to help. It was only when I thought to do a Along the same lines, and with regard to doing a manual command line update, I had hoped just typing Perhaps the problem is that the output of the |
You can always run
That's not really possible because In fact, that command is not even available in Portable Git. Only when Git for Windows was installed via the installer is that command available. Such optional commands will never be described by the output of |
Fair enough. You're the maintainer, so there's our answer. :-) I'll just add that I simply wondered if it MIGHT be possible that you compiled something from core Git (which caused the output of that git command), and that you might therefore be able to ADD that special argument to the help output. You don't leave open that possibility, so either you cannot or will not (along with any means to change the auto-update setting without reinstall). So be it. At least now it's clear to any who may have wondered. Thanks for the response and confirmation of things, and of course for the efforts by you and others on the project as it is. |
If you can find a way to make this work without affecting Portable Git in confusing ways, please let us know. I'm more than open to accepting PRs that solve this problem properly. BTW that goes for any Git for Windows issue: my opinion is just that: my opinion. I will be delighted to be proven wrong whenever it helps improve Git for Windows. |
@carehart also try You could create yourself a 'short cut' alias to help get you there quicker. |
@dscho Thanks for carrying on the conversation. To be clear, I'm only a user of GfW (indeed, only a very occasional one). I don't myself understand the connection with Portable Git, though I see you said in the first reply that it doesn't support this argument for updating. So I gather the code for the help is shared by both, and that would the reason for not being able/not wanting to make a change that would affect both. As for being "more open to a PR", FWIW I will note that before I even asked here, I did search the code (here in github for this project) for the phrase at the top help, "These are common Git commands", and I found no reference to it. That's why I assumed it was not something we could implement, and thus my question. :-) I do see now that the git gui source is here. I don't know tcl myself, but would you (or anyone) know if it would be possible for someone to add an update menu option to the gui help? That would be a natural place for most GfW users to look, I'd think. What I mean is can such a menu option in tcl even cause execution of a command line to run that update arg above? If so, perhaps even someone with no tcl experience could try to hack an implementation. Just trying to help someone readily figure out how to do a GfW update, whether from the GUI or the command line. :-) |
Thanks, @PhilipOakley. FWIW I tried that variation of git help. To be clear, it makes no mention of this special update argument. Indeed, it immediately shows the output in less (even on Windows, and even though Windows does not provide a less command). So I gather that this is again the "core Git" help that Johannes was referring to in his first reply. You also propose I could create an alias. Again, the point of my request was that someone running GfW has no obvious way to update it, if they don't know that special argument. (And of course, I mean if they somehow they did not choose the "auto-update" feature at installation, that Johannes mentions. I wouldn't have turned it off, if offered, but I suppose it's possible I installed GfW before it was offered as an option in the installer.) More specifically, I was saying that if someone in that situation did what was natural for them, they would not readily find a way to update GfW. Some would go to the GfW UI, but it has no update feature (like in the Help menu). And others would go to command line and type I simply was asking on behalf of all users, in the hope of helping them get or keep it updated, in this scenario. If somehow the situation I am proposing seems incredibly unique for someone to end up in, I will understand it a low priority problem to resolve. It just struck me as an easy one, since I ended up in that boat. :-) |
True. you need the
True again. Discoverability is tricky for many features in git
Noted. I'd mentioned the sneak paths that contributors could try so as to get a quick win. As always getting folks to help contribute is tricky because of the wide range of background knowledge / skills / perseverance that are often needed to bridge the two domains (Windows and Linux). Contributions are always welcome. |
Closing this stale ticket. |
If we have auto update feature in git bash then we can move safely
The text was updated successfully, but these errors were encountered: