-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Conversation
What's the plan for transitioning to this API? I was thinking our existing synchronous let repository = someMethodReturningARepository().async When we hit Atom 2.0 and transition to the repository always being async, we can retain the However, I'm not sure how this all meshes with your idea of keeping this API private for a while. In my mind, we should start transitioning the community to any async APIs we feel confident about. We might not want to make every method on the class public, but I'd like to deprecate existing synchronous functionality as soon as we can. |
Yep, I agree with this, it's suggested in the bullet points above.
This is not necessarily a conflict with how I feel, I'm just not expecting we'll feel confident about the APIs for a while. |
|
||
onSuccess = jasmine.createSpy('onSuccess') | ||
|
||
waitsForPromise -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you also write the specs in ES6, async/await
syntax could really clean up these async tests...
it('does something async', function () {
waitsForPromise(async function() {
expect(await repo.getPath()).toBe('/some/path')
})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's ES7+ only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, which we have access to 😄
⚡ Thanks for moving us in the right direction on this. |
Sorry, I didn't comprehend it initially for some reason. Of course |
Oh hey, this will be excellent for packages that integrate with git. 👍 😁 |
❤️ ES6 instead of ☕script! |
Thought: it seems like a good place to start using this in prod & packages is to proxy all the |
return new GitRepositoryAsync(path, options) | ||
} | ||
|
||
constructor (path, options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💄 🎨 What do you think about removing the spaces in front of the arguments? https://github.com/airbnb/javascript#18.3 Just about style. Really good work! Love the ES6 ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - this currently conforms to JS Standard Style (a very presumptuous name, isn't it?) rather than AirBnB style and I'm happy with Standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the resource. Didn't knew about it! Looks of course also good 👍 Just important that there is one style over the whole repository 👍 👏
Thanks for the feedback @steelbrain! |
|
||
getPath () { | ||
return this.repoPromise.then((repo) => { | ||
return Promise.resolve(repo.path().replace(/\/$/, '')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to replace most of these Promise.resolve
s here with just values.
This will break a lot of things, and depends on atom/atom#9213
You guys really hate placing semicolons don't you? :D |
By not adding semi colons, are you adding overhead to the JIT?
|
@SeanJM I don't know why github doesn't use them in their code, is this because they have most of their code in Ruby or Coffescript doesn't allow them? |
https://www.quora.com/Are-there-performance-differences-between-using-semi-colons-and-not-using-semi-colons-in-JavaScript https://www.quora.com/Are-there-performance-differences-between-using-semi-colons-and-not-using-semi-colons-in-JavaScript
|
this._gitUtilsRepo = GitUtils.open(path) // TODO remove after porting ::relativize | ||
this.repoPromise = Git.Repository.open(path) | ||
|
||
var {project, refreshOnWindowFocus} = options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be let
(or const
), doesn't look like we want or need hoisting here.
…sync-repo-relativize-symlinks
Support symlinked repo roots when relativizing
Does this address #2456? |
@martindale it would be great if you could download the 1.7.0 beta and find out :). |
Subjectively, the problem appears to be worse with 1.7.0 beta. Atom now completely hangs when launching it inside of a remote mount, and eventually requests direction on whether to close or keep waiting. |
Same problem here, Atom 1.6.0 or 1.7.0 beta now hangs up when trying to open a big git repository inside of a remote mount making Atom unusable in this configuration 😢 |
Can't use Atom anymore. Probably because of this feature. I mounted a vagrant via SSHFS and Atom freezes when opening a file. Could you release a fix for this, please. |
I'm wondering why we switched to using nodegit. I realize that maintaining a wrapper around a git executable is lame but nodegit wraps libgit2 which is glacial in comparison to git. This is completely anecdotal but I've always found it far slower. Perhaps using something like https://www.npmjs.com/package/simple-git instead? |
@mehcode Before nodegit we were already using libgit2, with a sync api wrapper we were maintaining ourselves (https://github.com/atom/git-utils) - so we can't blame any performance regressions on libgit2 here. |
Ah. I was under the impression we were just doing shell execution. |
This is an experimental spike of an alternate GitRepository class that uses nodegit rather than git-utils. We would love to speed up the responsiveness of various aspects of Atom (tree-view, etc) by doing more Git operations asynchronously, and it would also be nice to get out of the business of maintaining our own libgit2 wrapper.
Here are a few notes about the reasoning behind some decisions here:
GitRepository.async
that returns the Promise for an async repo, so that internal callers can use async without changing anything in theGitRepositoryProvider
?cc @atom/core @orderedlist