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 support for Git Log API. #2046

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

ShimonBenYair
Copy link
Contributor

What does this PR do?

What issues does this PR fix or reference?

Previous Behavior

Remove this section if not relevant

New Behavior

This content may also be included in the release notes.

Tests written?

Yes/No

Docs requirements?

Include the content for all the docs changes required.

  1. API changes
  2. User docs changes

Please review Che's Contributing Guide for best practices.

Add support for skip and maxCount when calling the LOG API.
Add support to get the log for a specific folder or file in the repository.
For every commit that is returned when calling the LOG API, the following data was added:
The author of the commit
A list of branch names that the commit is related to.
A list of file names that were changed/deleted/added in the commit.
A list of commit parents (to enable for example clients to paint a graph)

Signed-off-by: Shimon Ben.Yair shimon.ben.yair@sap.com

@ShimonBenYair
Copy link
Contributor Author

ShimonBenYair commented Aug 4, 2016

@skabashnyuk @vinokurig

All your comments were fixed

@codenvy-ci
Copy link

Can one of the admins verify this patch?

1 similar comment
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@ShimonBenYair
Copy link
Contributor Author

@skabashnyuk @vinokurig

Hi, do you have more comments to fix ?

@@ -710,44 +721,163 @@ public void init(InitRequest request) throws GitException {
}
}

/** @see org.exoplatform.ide.git.server.GitConnection#log(org.exoplatform.ide.git.shared.LogRequest) */
Copy link
Contributor

Choose a reason for hiding this comment

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

this is invalid link

@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
please review

*/
LogRequest withRevisionRangeUntil(String revisionRangeUntil);

/** @return the integer value of the number of commits that will be skipped when calling log API */
Copy link
Contributor

Choose a reason for hiding this comment

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

the integer value of the number of commits that will be skipped when calling log command ?

}

private List<DiffCommitFile> getCommitDiffFiles(RevCommit revCommit, String pattern) throws IOException {
List<DiffEntry> diffs = null;
Copy link
Contributor

@vinokurig vinokurig Aug 26, 2016

Choose a reason for hiding this comment

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

It is not necessary to initialize this variable as null

@vinokurig
Copy link
Contributor

Could you please add tests for revision range in Log and for new fields in Revision

@ShimonBenYair
Copy link
Contributor Author

ShimonBenYair commented Sep 18, 2016

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

@vinokurig
Copy link
Contributor

I will review, as soon as possible

/** @return the file change type*/
String getChangeType();

/** set the file change type*/
Copy link
Contributor

@vinokurig vinokurig Sep 21, 2016

Choose a reason for hiding this comment

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

Start the javadoc with capital letter here and in other javadocs

void setRevisionRangeSince(String revisionRangeSince);

/**
* Create a LogRequest object based on a given revision range since.
Copy link
Contributor

@vinokurig vinokurig Sep 21, 2016

Choose a reason for hiding this comment

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

Create a {@link LogRequest} object based on a given revision range since.
here and in other javadocs

/** @return revision range until */
String getRevisionRangeUntil();

/** @set revision range until */
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove @

*
* @param oldPath
* file previous location
* @return a DiffCommitFile object
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide more info here and in other javadocs like this.
May be something like this: {@link DiffCommitFile} object that contains information about changes of the committed file


/** Set a list of DiffCommitFile objects, which describes the changes in the commit files */
void setDiffCommitFile(List<DiffCommitFile> v);
Copy link
Contributor

Choose a reason for hiding this comment

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

v is not a good name for parameter

}

@Test(dataProvider = "GitConnectionFactory", dataProviderClass = GitConnectionFactoryProvider.class)
public void testLogWithSkipAndMaxCount(GitConnectionFactory connectionFactory) throws GitException, IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference between this test and previous two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because i added three tests:

  1. testLogSkip - to check log with skip option
  2. testLogMaxCount - to check log with maxCount option
    3)testLogWithSkipAndMaxCount - to check log with skip and maxCount together

In addition i added more tests

@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

*
* @param revisionRangeSince
* revision range since
* @return a {@link LogRequest} object
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it will be better to remove javadoc fields like this in this class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why ?
Do you mean to remove all javadocs from all the with[...] methods ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean that @return a {@link LogRequest} object tells nothing except methods return type.
As for me it would be better to remove such fields only in this class, or try to provide more information there.

Copy link
Contributor

@vinokurig vinokurig left a comment

Choose a reason for hiding this comment

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

Other Ok fo rme @sleshchenko?

*
* @param branch
* branch name
* @return a Revision object
Copy link
Contributor

Choose a reason for hiding this comment

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

@return a {@link Revision} object that contains information about revision



/**
* Create a Revision object based on a given branch name.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace Revision to {@link Revision} here and in other javadocs

/**
* Parameter which shows that this revision is a fake revision (i.e. TO for Exception)
*
* @return boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide more info or remove it

Copy link
Contributor Author

@ShimonBenYair ShimonBenYair Sep 25, 2016

Choose a reason for hiding this comment

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

It is not a parameter that we added , so i don't know what is the purpose of this parameter ?
It was there before i added my code

Copy link
Member

Choose a reason for hiding this comment

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

return boolean looks bad for me

@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

@vinokurig
Copy link
Contributor

@sleshchenko ?

return gitUsers;
}

Copy link
Member

Choose a reason for hiding this comment

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

remove spaces here

* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/

Copy link
Member

Choose a reason for hiding this comment

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

remove extra line

*
* @author Shimon Ben Yair.
*/

Copy link
Member

Choose a reason for hiding this comment

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

remove extra line

*/
DiffCommitFile withOldPath(String oldPath);

/** @return the file new location*/
Copy link
Member

Choose a reason for hiding this comment

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

/**
* Parameter which shows that this revision is a fake revision (i.e. TO for Exception)
*
* @return boolean
Copy link
Member

Choose a reason for hiding this comment

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

return boolean looks bad for me

@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

*/
DiffCommitFile withOldPath(String oldPath);

/** @return the file new location */
Copy link
Contributor

Choose a reason for hiding this comment

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

According to https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment, it should be something like this: Returns new location of the file. Please take a look to other javadocs like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Add support for skip and maxCount when calling the LOG API.
Add support to get the log for a specific folder or file in the repository.
For every commit that is returned when calling the LOG API, the following data was added:
The author of the commit
A list of branch names that the commit is related to.
A list of file names that were changed/deleted/added in the commit.
A list of commit parents (to enable for example clients to paint a graph)

Change-Id: I2cc486cc49787c681b031067728b7a33f8fb11e7
Signed-off-by: Shimon Ben.Yair <shimon.ben.yair@sap.com>
@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

1 similar comment
@ShimonBenYair
Copy link
Contributor Author

@vinokurig
I have fixed all your comments,
can you please review and approve this pull request ?

@vinokurig
Copy link
Contributor

QA is in progress

@vkuznyetsov
Copy link

@vinokurig could you please merge this PR

@vinokurig vinokurig merged commit d55fbe9 into eclipse-che:master Oct 27, 2016
@bmicklea bmicklea added this to the 5.0.0 milestone Jan 11, 2017
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
Add support for skip and maxCount when calling the LOG API.
Add support to get the log for a specific folder or file in the repository.
For every commit that is returned when calling the LOG API, the following data was added:
The author of the commit
A list of branch names that the commit is related to.
A list of file names that were changed/deleted/added in the commit.
A list of commit parents (to enable for example clients to paint a graph)

Change-Id: I2cc486cc49787c681b031067728b7a33f8fb11e7
Signed-off-by: Shimon Ben.Yair <shimon.ben.yair@sap.com>
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

6 participants