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

Add API to fetch repository status via uhub #21

Merged
merged 9 commits into from Nov 15, 2016
Merged

Conversation

mklabs
Copy link
Contributor

@mklabs mklabs commented Nov 4, 2016

Hi!

This PR introduces new APIs to the driver, a new utility called LocalFileUtils and a new model LocalFile.

It also update the uhub version we are using in tests to match 2.5.1 which includes the needed API to fetch the repository status.

* @param {Driver} driver
* @return {Promise<List<LocalFile>>}
*/
LocalFileUtils.status = function status(repoState, driver) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name it simply "LocalUtils" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing

* }
* }
*
* @param {String} opts.message List of files with name and status.
Copy link
Contributor

Choose a reason for hiding this comment

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

"commit message" ?
If it is optional, you can put it between brackets [opts.message] or indicate it is (optional) as for opts.author for example.

* "message": "Commit message",
* "files": [{
* "name": "README.md",
* "status": "modified"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the status has a meaning here ? Should it be removed ? (i would guess it is of no use here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is used indeed in uhub

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so we should mention that status is useful. And as long as there is no documentation for Uhub, it's good to have it written somewhere, like here.

Added -> File will be added and committed
Copied -> ?
Deleted -> File will be removed
Modified -> Modification will be committed
Renamed -> ?
Unmodified -> Nothing
Untracked -> File will be added and committed

@@ -21,3 +21,23 @@ LocalFileUtils.status = function status(repoState, driver) {
branch: branch
});
};

/**
* Perform a git status on a given repository branch
Copy link
Contributor

Choose a reason for hiding this comment

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

Docstring needs to be updated

@Soreine Soreine merged commit b062e16 into master Nov 15, 2016
@mklabs mklabs deleted the feature/status branch November 16, 2016 15:11
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.

None yet

2 participants