Skip to content

Commit 751115d

Browse files
committed
1 parent 31d3953 commit 751115d

File tree

5 files changed

+35
-36
lines changed

5 files changed

+35
-36
lines changed

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![Release](https://jitpack.io/v/ProjectKaiser/pk-vcs-git.svg)](https://jitpack.io/#ProjectKaiser/pk-vcs-git)
1+
[![Release](https://jitpack.io/v/ProjectKaiser/scm4j-vcs-git.svg)](https://jitpack.io/#ProjectKaiser/scm4j-vcs-git)
22

33
# Overview
4-
Pk-vcs-git is lightweight library for execute basic Git VCS operations (merge, branch create etc). It uses [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) exposing IVCS implementation for Git repositories and [JGit](https://eclipse.org/jgit/) as framework to work with Git repositories.
4+
scm4j-vcs-git is lightweight library for execute basic Git VCS operations (merge, branch create etc). It uses [scm4j-vcs-api](https://github.com/ProjectKaiser/scm4j-vcs-api) exposing IVCS implementation for Git repositories and [JGit](https://eclipse.org/jgit/) as framework to work with Git repositories.
55
Features:
66
- Branch create and remove
77
- Branch merge with result return (success or list of conflicted files)
@@ -13,19 +13,19 @@ Features:
1313

1414
# Terms
1515
- Workspace Home
16-
- Home folder of all folders used by vcs-related operations. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details
16+
- Home local folder of all folders used by vcs-related operations. See [scm4j-vcs-api](https://github.com/ProjectKaiser/scm4j-vcs-api) for details
1717
- Repository Workspace
18-
- Folder for LWC folders related to Repository of one type. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details
18+
- Local folder for LWC folders related to Repository of one type. See [scm4j-vcs-api](https://github.com/ProjectKaiser/scm4j-vcs-api) for details
1919
- Locked Working Copy, LWC
20-
- 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
20+
- Local folder where vcs-related operations are executed. Provides thread- and process-safe repository of working folders. See [scm4j-vcs-api](https://github.com/ProjectKaiser/scm4j-vcs-api) for details
2121
- Test Repository
2222
- Git repository which is used to execute functional tests
2323
- File-based repository is used
24-
- Generates new before and deletes after each test
24+
- Generates new one before and deletes after each test
2525
- Named randomly (uuid is used)
2626

27-
# Using pk-vcs-git
28-
- Add github-hosted pk-vcs-git and pk-vcs-api projects as maven dependencies using [jitpack.io](https://jitpack.io/). As an example, add following to gradle.build file:
27+
# Using scm4j-vcs-git
28+
- Add github-hosted scm4j-vcs-git and scm4j-vcs-api projects as maven dependencies using [jitpack.io](https://jitpack.io/). As an example, add following to gradle.build file:
2929
```gradle
3030
allprojects {
3131
repositories {
@@ -35,11 +35,10 @@ Features:
3535

3636
dependencies {
3737
// versioning: master-SNAPSHOT (lastest build, unstable), + (lastest release, stable) or certain version (e.g. 1.1)
38-
compile 'com.github.ProjectKaiser:pk-vcs-git:+'
39-
compile 'com.github.ProjectKaiser:pk-vcs-api:+'
38+
compile 'com.github.ProjectKaiser:scm4j-vcs-git:+'
4039
}
4140
```
42-
Or download release jars from https://github.com/ProjectKaiser/pk-vcs-git/releases, https://github.com/ProjectKaiser/pk-vcs-api/releases
41+
Or download release jars from https://github.com/ProjectKaiser/scm4j-vcs-git/releases
4342
- Create Workspace Home instance providing path to any folder as Workspace Home folder path. This folder will contain repositories folders (if different vcs or repositories are used)
4443
```java
4544
public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "git-workspaces";
@@ -49,27 +48,26 @@ Features:
4948
```
5049
- Obtain Repository Workspace from Workspace Home providing a certain Repository's url. The obtained Repository Workspace will represent a folder within Workspace Home dir which will contain all Working Copies relating to the provided VCS Repository
5150
```java
52-
String repoUrl = "https://github.com/ProjectKaiser/pk-vcs-api";
51+
String repoUrl = "https://github.com/ProjectKaiser/scm4j-vcs-api";
5352
IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl);
5453
```
5554
- Create `GitVCS` instance providing Repository Workspace
5655
```java
5756
IVCS vcs = new GitVCS(repoWorkspace);
5857
```
59-
- Use methods of `IVCS` interface. See [pk-vcs-api](https://github.com/ProjectKaiser/pk-vcs-api) for details
58+
- Use methods of `IVCS` interface. See [scm4j-vcs-api](https://github.com/ProjectKaiser/scm4j-vcs-api) for details
6059
- Use `vcs.setProxy()` and `vcs.setCredentials()` if necessary
6160

6261
# Implementation details
6362
- [JGit](https://eclipse.org/jgit/) is used as framework to work with Git repositories
64-
- [Github](https://github.com/) is used as hosting of a Test Repository
65-
- LWC is obtained for each vcs operation.
63+
- Each vcs operation is executed within a LWC
6664
- `getLocalGit(IVCSLockedWorkingCopy wc)` method is used to create a Git implementation to execute vcs operations within `wc` Working Copy
67-
- If provided LWC is empty then current Test Repository is cloned into this LWC, otherwise just Git object is created
65+
- If provided LWC is empty then current Test Repository is cloned into this LWC, otherwise existing repository is just switched to required branch
6866
- If `IVCS.setProxy()` is called then provided proxy is used for each url which contains `repoUrl`
6967

7068
# Functional testing
7169
- New local file-based Test Repository is created before each test and deletes automatically after each test
72-
- 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
70+
- To execute tests just run GitVCSTest class as JUnit test. Tests from VCSAbstractTest class will be executed. See [scm4j-vcs-test](https://github.com/ProjectKaiser/scm4j-vcs-test) for details
7371
- Run `gradle test` to execute tests
7472

7573
# Limitations

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'maven'
44
sourceCompatibility = JavaVersion.VERSION_1_7
55
targetCompatibility = JavaVersion.VERSION_1_7
66

7-
group = 'com.projectkaiser.scm'
7+
group = 'org.scm4j'
88
version = '2.0-SNAPSHOT'
99

1010
repositories {
@@ -15,12 +15,12 @@ repositories {
1515
}
1616

1717
dependencies {
18-
compile 'com.github.ProjectKaiser:pk-vcs-api:master-SNAPSHOT'
18+
compile 'com.github.ProjectKaiser:scm4j-vcs-api:master-SNAPSHOT'
1919
compile 'org.eclipse.jgit:org.eclipse.jgit:4.3.0.201604071810-r'
2020

2121
testCompile 'org.mockito:mockito-core:2.0.62-beta'
2222
testCompile 'junit:junit:4.12'
23-
testCompile 'com.github.ProjectKaiser:pk-vcs-test:master-SNAPSHOT'
23+
testCompile 'com.github.ProjectKaiser:scm4j-vcs-test:master-SNAPSHOT'
2424
}
2525

2626
task sourcesJar(type: Jar, dependsOn: classes) {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name = 'pk-vcs-git'
1+
rootProject.name = 'scm4j-vcs-git'

src/main/java/com/projectkaiser/scm/vcs/GitVCS.java renamed to src/main/java/org/scm4j/vcs/GitVCS.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.projectkaiser.scm.vcs;
1+
package org.scm4j.vcs;
22

33
import java.io.ByteArrayOutputStream;
44
import java.io.File;
@@ -46,16 +46,16 @@
4646
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
4747
import org.eclipse.jgit.treewalk.CanonicalTreeParser;
4848

49-
import com.projectkaiser.scm.vcs.api.IVCS;
50-
import com.projectkaiser.scm.vcs.api.VCSChangeType;
51-
import com.projectkaiser.scm.vcs.api.VCSCommit;
52-
import com.projectkaiser.scm.vcs.api.VCSDiffEntry;
53-
import com.projectkaiser.scm.vcs.api.VCSMergeResult;
54-
import com.projectkaiser.scm.vcs.api.exceptions.EVCSBranchExists;
55-
import com.projectkaiser.scm.vcs.api.exceptions.EVCSException;
56-
import com.projectkaiser.scm.vcs.api.exceptions.EVCSFileNotFound;
57-
import com.projectkaiser.scm.vcs.api.workingcopy.IVCSLockedWorkingCopy;
58-
import com.projectkaiser.scm.vcs.api.workingcopy.IVCSRepositoryWorkspace;
49+
import org.scm4j.vcs.api.IVCS;
50+
import org.scm4j.vcs.api.VCSChangeType;
51+
import org.scm4j.vcs.api.VCSCommit;
52+
import org.scm4j.vcs.api.VCSDiffEntry;
53+
import org.scm4j.vcs.api.VCSMergeResult;
54+
import org.scm4j.vcs.api.exceptions.EVCSBranchExists;
55+
import org.scm4j.vcs.api.exceptions.EVCSException;
56+
import org.scm4j.vcs.api.exceptions.EVCSFileNotFound;
57+
import org.scm4j.vcs.api.workingcopy.IVCSLockedWorkingCopy;
58+
import org.scm4j.vcs.api.workingcopy.IVCSRepositoryWorkspace;
5959

6060
public class GitVCS implements IVCS {
6161

src/test/java/com/projectkaiser/scm/vcs/GitVCSTest.java renamed to src/test/java/org/scm4j/vcs/GitVCSTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.projectkaiser.scm.vcs;
1+
package org.scm4j.vcs;
22

33

44
import java.io.File;
@@ -9,10 +9,11 @@
99
import org.eclipse.jgit.lib.Repository;
1010
import org.junit.After;
1111
import org.mockito.Mockito;
12+
import org.scm4j.vcs.GitVCS;
13+
import org.scm4j.vcs.api.abstracttest.VCSAbstractTest;
1214

13-
import com.projectkaiser.scm.vcs.api.IVCS;
14-
import com.projectkaiser.scm.vcs.api.abstracttest.VCSAbstractTest;
15-
import com.projectkaiser.scm.vcs.api.workingcopy.IVCSRepositoryWorkspace;
15+
import org.scm4j.vcs.api.IVCS;
16+
import org.scm4j.vcs.api.workingcopy.IVCSRepositoryWorkspace;
1617

1718
public class GitVCSTest extends VCSAbstractTest {
1819

0 commit comments

Comments
 (0)