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

git and Posh-git check #440

Merged
merged 2 commits into from
Mar 25, 2015
Merged

Conversation

Jackbennett
Copy link
Contributor

  1. If the minimal client is used there's a chance git doesn't exist on the users machine.
  2. Really look for the posh-git module. It seems to need importing because it doesn't have a module manifest.

I didn't think this looked right so I added some work to it. Somewhere in the build we need to install-module posh-git and put it in the vendor/ path. That will save us adding posh-git to the repo.

See the commit messages for more info I tried to be quite clear.

Explicitly call `import posh-git` because it doesn't have a module
manifest thus powershell can't autoload it when using a cmdlet.

At present the cmder repo doesn't try to download posh-git so it might be
missing from the users session.
In an effort to speed up the prompt we will only call write-vcsstatus if
there is a .git folder in the current or any parent path recursively.

As this function is called every new prompt line it needs to be as fast as
possible.
MartiUK added a commit that referenced this pull request Mar 25, 2015
@MartiUK MartiUK merged commit 520e7cf into cmderdev:development Mar 25, 2015
$gitStatus = $false
}

function checkGit($Path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Jackbennett @MartiUK
I don't understand the reason of this function. Posh-Git checks himself what you write, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pulled out the code that imported everything all the time from our vendor\psmodules in another commit (e811c60)

Posh-git needs a module manifest creating to behave with powershell's auto-loading behaviour. This checks if we have git and need the cmdlet only if we're actually in a git repository.

All in the name of speed. You don't need to wait for all the git stuff constantly especially if its not even used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right. So e811c60

@Jackbennett Jackbennett deleted the proper-git-check branch May 5, 2015 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants