-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Should we really be preferring externally installed Git? #782
Comments
if not then I suggest: vendor\init.bat
vendor\profile.ps1
|
I would think we would only use externally installed Git if Cmder Mini was in use and thus did not include the vendor\git-for-windows folder. |
So maybe the best code would be: vendor\init.bat:
vendor\profile.ps1
|
Do we actually really need the package without git? |
Git and the *nix like environment is why I use cmder so I personally would say no. |
@Stanzilla @daxgames I think it's important to allow users to use their installed version of Git if they have it. Certain dev tools also require Git to be installed in the default location, so sometimes the choice is not your own. |
I also have git extras installed in the user installed location, so I would prefer if the logic prefers a user installed location. |
I'll add my opinion: IMO if the user has Git already installed, Cmder shouldn't change user experience around Git in any way, i.e. 1) do not force user to use bundled Git instead of already installed one; 2) do not modify So my proposal about detecting alghoritm is:
|
BTW: this is from another project where the git install path was needed:
|
There's no reason why we can't just run the powershell profile script within init.bat. |
+1 for @vladimir-kotikov 's proposal. I just found cmder and was immediately confused whether I should use mini or full as I already have Git installed. |
+1 for @vladimir-kotikov as well but with one slight change. Don't prepend git to %PATH%, instead append to it. Since cmder was prepending git and vim via init.bat#L39 to path I had issues using some of the apps that are shipped with Windows, like EXPAND (app for extracting the contents of a CAB archive). Instead, EXPAND that is shipped with git is used (utility for converting tabs to spaces) Pretty much there's a lot of conflicting when using utilities from Windows. So instead of |
+1, cannot afford to wonder which version of Git I'm using. |
@wgv-sethlivingston type |
Yes, I understand that. What I meant of course was that if I have installed Git on my system, then that is the Git I want to use. |
For people who prefer "GitHub for Windows" over other git packages below code should be added to "init.bat".
|
#865 implements the idea of #782 (comment) by @vladimir-kotikov |
@JanSchulz cmder_mini gives this notification:
As for git I have to manually add the lines I have written earlier. |
@t5k6 can you give me your path (cmd and |
The file not found problem should be fixed in a later version, I added a commit to fix that... |
@JanSchulz files inside PATH output in vanilla cmder_mini (AppVeyor 1.0.216-development): PATH output in vanilla cmder_full (AppVeyor 1.0.216-development): BTW with Github for Windows, git package is in portable state and is not added to path (instead only activated with Github application) as can be seen from my 'path' output. That is why I add Sorry for not clearly explaining that before. |
@t5k6 You installed github for windows and it didn't add itself to the path? Is I don't really want to add a special case for this: IMO:
The help text then becomes |
My VS2015 installation ended up installing standalone git on my machine. This version doesn't include all the UNIX commands - and I wouldn't want them being available for my normal But I do want them for my Cmder console. But as things are now where it checks for standalone Git first this setup won't work. I'm looking for a way to force cmder to always use vendor git - separate from my sans-UNIX-standalone-Git install. Is this currently possible, or would there need to be alternations to cmder? |
@thomgit Can you show us where VC2015 installs git too? The current (aka next release) version of the cmd init.bat script will let you overwrite these git in two ways:
https://github.com/cmderdev/cmder/blob/development/vendor/init.bat#L44 |
It installed Git into ProgramFiles (the 64bit variant). I ended up temporarily disabling the lines in init.bat and that worked for now:
@JanSchulz - with the changes you describe I'd then just add cmder's vendor git into the ENV: |
This is a variable which is used in init.bat, I think it is only used there. It is not set by git itself. If you want to have a preview, try the builds available here: https://ci.appveyor.com/project/MartiUK/cmder/build/1.0.256-development/artifacts They contain the "where is git" changes. |
I would say if git's already installed use that. If someone gets cmder+git with git already I'd assume they made a mistake. Perhaps we make a config function to help you flip over the env settings to a portable git if for whatever reason a user might not want to use the installed one. If we don't prefer the external version of packages we would need to start asking questions like "Ignore external config files?". I don't think anyone wants to have a .cmder/.gitconfig as well as their normal ones. Not by default anyway. I'm already not crazy about ignoring users PS Profiles but that's off topic. |
In my case I used cmder with git - then Visual Studio installed standalone git along with the ride for their installer - without all the UNIX commands. So in my case the stand-alone git isn't what I wanted cmder to be using - and it was out of my control. |
IMO for most users, preferring the user installed version over the included one is a good idea. There are several ways to overwrite that:
|
Should we be doing this in the vendor\init.bat:
and this in the vendor\profile.ps1:
Both of these could lead to running a different version of Git in cmd.exe/powershell.exe shells vs. the bash.exe shell shipped with Cmder.
If you really think we should, the vendor\init.bat code should be altered to the below:
The text was updated successfully, but these errors were encountered: