Skip to content

Commit bc59c2b

Browse files
author
Denis
committed
limit added to getCommitMessages()
ducumentation updated
1 parent e40b890 commit bc59c2b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pk-vcs-git is lightweight library for execute basic Git VCS operations (merge, b
1010
- Folder where vcs-related operations are executed. Provides thread- and process-safe repository of working folders. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details
1111
- Test Repository
1212
- Git repository which is used to execute functional tests
13-
- Hosted on [Github](https://github.com/) using username and password provided by enviroment variables (see below)
13+
- Hosted on [Github](https://github.com/) using username and password provided by environment variables (see below)
1414
- Generates new before and deletes after each test
1515
- Named randomly (uuid is used)
1616
- [Kohsuke Github API](http://github-api.kohsuke.org/) is used as to work with Github API
@@ -45,7 +45,7 @@ Pk-vcs-git is lightweight library for execute basic Git VCS operations (merge, b
4545
IVCS vcs = new GitVCS(repoWorkspace);
4646
```
4747
- Use methods of `IVCS` interface. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details
48-
- Use `vcs.setProxy()` and `vcs.setCredentials()` if neccessary
48+
- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary
4949

5050
# Implementation details
5151
- [JGit](https://eclipse.org/jgit/) is used as framework to work with Git repositories
@@ -58,11 +58,11 @@ Pk-vcs-git is lightweight library for execute basic Git VCS operations (merge, b
5858
# Functional testing
5959
- Github is used for hosting the Test Repository
6060
- [Kohsuke Github API](http://github-api.kohsuke.org/) is used to create and delete Test Repository
61-
- `PK_VCS_TEST_GITHUB_USER` enviroment var or JVM var is used as username for access to Github
62-
- `PK_VCS_TEST_GITHUB_PASS` enviroment var or JVM var is used as user password for access to Github
61+
- `PK_VCS_TEST_GITHUB_USER` environment var or JVM var is used as username for access to Github
62+
- `PK_VCS_TEST_GITHUB_PASS` environment var or JVM var is used as user password for access to Github
6363
- New Test Repository is created before each test and deletes automatically after each test
6464
- To execute tests just run GitVCSTest class as JUnit test. Tests from VCSAbstractTest class will be executed. See [pk-vcs-test](https://github.com/ProjectKaiser/pk-vcs-test) for details
65-
- NOTE: Github has some latency for exposing results of previosly executed operations. For example if create a new branch and immediately check branches list then Github could return old branches list. Need to wait a couple of second to get new list. So if a test failed then try to execute it again.
65+
- NOTE: Github has some latency for exposing results of previously executed operations. For example if create a new branch and immediately check branches list then Github could return old branches list. Need to wait a couple of second to get new list. So if a test failed then try to execute it again.
6666

6767
# Limitations
68-
- Commit messages can not be atached to branch create and delete operations because Git does not exposes these operations as separate commits
68+
- Commit messages can not be attached to branch create and delete operations because Git does not exposes these operations as separate commits

src/main/java/com/projectkaiser/scm/vcs/GitVCS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,14 @@ public Set<String> getBranches() {
471471
}
472472

473473
@Override
474-
public List<String> getCommitMessages(String branchName) {
474+
public List<String> getCommitMessages(String branchName, Integer limit) {
475475
try (IVCSLockedWorkingCopy wc = repo.getVCSLockedWorkingCopy()) {
476476
try (Git git = getLocalGit(wc)) {
477477
Iterable<RevCommit> logs = git
478478
.log()
479479
.add(git.getRepository().resolve("remotes/origin/"
480480
+ parseBranch(branchName)))
481+
.setMaxCount(limit)
481482
.call();
482483
List<String> res = new ArrayList<>();
483484
for (RevCommit commit : logs) {

0 commit comments

Comments
 (0)