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

Change how we check for git directories in cmder.lua #786

Closed
MartiUK opened this issue Jan 6, 2016 · 9 comments
Closed

Change how we check for git directories in cmder.lua #786

MartiUK opened this issue Jan 6, 2016 · 9 comments

Comments

@MartiUK
Copy link
Member

MartiUK commented Jan 6, 2016

See https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh#L362

@vladimir-kotikov
Copy link
Contributor

@MartiUK, you meant this line?

@MartiUK
Copy link
Member Author

MartiUK commented Jan 6, 2016

@vladimir-kotikov Yeah, should cut down on the time to find a .git folder.

@jankatins
Copy link
Contributor

Actually, the rebase hints and the info if I'm behind the remote are also nice... :-)

@vladimir-kotikov
Copy link
Contributor

It would be great if this will improve perfomance, but i recall that we've been relying on git already at some moment before #438 and there were some perf issues... Unfortunately, git on Windows is not so super-fast as on Nix machines :(

@vladimir-kotikov
Copy link
Contributor

Made some timings, and the results are not very promising (the timings are in 1/100 sec, measurements are made for directories, placed on SSD):

Current Using git rev-parse
Non-git directory 0 0.22
Git repo 0.30 0.55

So IMO it's better to keep the current approach. Personally for me it's not very comfortable to wait ~0.5 sec each time before thr prompt updates.

Here is the gist with git_prompt_filter function, that uses git rev-parse and prints nice results: https://gist.github.com/vladimir-kotikov/ef164c3baa8b80bd30b0

@jankatins
Copy link
Contributor

@vladimir-kotikov Can you tell how you did the timing? That would make a nice test how to evaluate changes to this functions... :-)

Or was that just the printouts?

@vladimir-kotikov
Copy link
Contributor

Just printouts, exactly the same as in the gist

@Stanzilla
Copy link
Member

@DRSDavidSoft @daxgames this is no longer needed, right? we already sped that up?

@DRSDavidSoft
Copy link
Contributor

I don't fully know the context of this issue, since the original line has changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants