Skip to content
Snippets Groups Projects
Commit 764ee71d authored by Georg Seibt's avatar Georg Seibt :nerd:
Browse files

some doc fixes and additions

parent 9b271d02
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,6 @@ import java.util.Map; ...@@ -7,7 +7,6 @@ import java.util.Map;
/** /**
* A line from a file with the associated 'git blame' information. * A line from a file with the associated 'git blame' information.
*/ */
@SuppressWarnings("WeakerAccess")
public class BlameLine { public class BlameLine {
/** /**
......
...@@ -7,14 +7,14 @@ import java.util.function.Function; ...@@ -7,14 +7,14 @@ import java.util.function.Function;
import java.util.logging.Logger; import java.util.logging.Logger;
/** /**
* A {@link Branch} is a named {@link Reference} to a git branch pointing to an {@link Commit}. * A {@link Branch} is a named {@link Reference} to a git branch pointing to a {@link Commit}.
*/ */
public class Branch extends Reference { public class Branch extends Reference {
private static final Logger LOG = Logger.getLogger(Branch.class.getCanonicalName()); private static final Logger LOG = Logger.getLogger(Branch.class.getCanonicalName());
/** /**
* Constructs an object referencing an existing git branch. * Constructs a new {@link Branch} referencing an existing git branch.
* *
* @param repo the repo this branch is part of * @param repo the repo this branch is part of
* @param name the branch name * @param name the branch name
......
...@@ -14,7 +14,7 @@ public class Commit extends Reference { ...@@ -14,7 +14,7 @@ public class Commit extends Reference {
private static final Logger LOG = Logger.getLogger(Commit.class.getCanonicalName()); private static final Logger LOG = Logger.getLogger(Commit.class.getCanonicalName());
// since there is no porcelain format for this command, this regex is might depend on the git version // Regexes for parsing the 'git cat-file -p' output for a commit object. These might depend on the git version.
private static final Pattern TREE_INFO = Pattern.compile("tree (.{40})\\nparent (.{40})\\n"); private static final Pattern TREE_INFO = Pattern.compile("tree (.{40})\\nparent (.{40})\\n");
private static final Pattern AUTHOR_INFO = Pattern.compile("author (.*?)<(.*?)> (\\d+) ([+-]\\d{4})\\n"); private static final Pattern AUTHOR_INFO = Pattern.compile("author (.*?)<(.*?)> (\\d+) ([+-]\\d{4})\\n");
private static final Pattern COMMITTER_INFO = Pattern.compile("committer (.*?)<(.*?)> (\\d+) ([+-]\\d{4})\\n"); private static final Pattern COMMITTER_INFO = Pattern.compile("committer (.*?)<(.*?)> (\\d+) ([+-]\\d{4})\\n");
...@@ -195,8 +195,7 @@ public class Commit extends Reference { ...@@ -195,8 +195,7 @@ public class Commit extends Reference {
} }
/** /**
* Reads the author information (author, author mail, author time) about this commit and saves it in the * Initializes all uninitialized fields of this {@link Commit} from its 'git cat-file -p <id>' output.
* {@link Commit}.
*/ */
private void getCommitInfo() { private void getCommitInfo() {
git.exec(repo.getDir(), "cat-file", "-p", id).ifPresent(execRes -> { git.exec(repo.getDir(), "cat-file", "-p", id).ifPresent(execRes -> {
......
...@@ -3,7 +3,11 @@ package de.uni_passau.fim.seibt.gitwrapper.repo; ...@@ -3,7 +3,11 @@ package de.uni_passau.fim.seibt.gitwrapper.repo;
import java.time.OffsetDateTime; import java.time.OffsetDateTime;
import java.util.logging.Logger; import java.util.logging.Logger;
public class DummyCommit extends Commit { /**
* Represents the dummy commit that is used by git to represent uncommitted changes. Every {@link Repository}
* constructs its {@link DummyCommit} in its constructor.
*/
final class DummyCommit extends Commit {
private static final Logger LOG = Logger.getLogger(DummyCommit.class.getCanonicalName()); private static final Logger LOG = Logger.getLogger(DummyCommit.class.getCanonicalName());
......
...@@ -12,6 +12,7 @@ import java.util.stream.Collectors; ...@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
/** /**
* A git object referencing a tree-ish object. * A git object referencing a tree-ish object.
*
* @see Commit * @see Commit
* @see Branch * @see Branch
*/ */
...@@ -23,6 +24,14 @@ public abstract class Reference { ...@@ -23,6 +24,14 @@ public abstract class Reference {
protected final Repository repo; protected final Repository repo;
protected final GitWrapper git; protected final GitWrapper git;
/**
* Constructs a new {@link Reference} belonging to the given {@code repo}.
*
* @param repo
* the {@link Repository} this {@link Reference} belongs to
* @param id
* the ID of the {@link Reference}
*/
protected Reference(Repository repo, String id) { protected Reference(Repository repo, String id) {
this.id = id; this.id = id;
this.repo = repo; this.repo = repo;
......
...@@ -9,7 +9,13 @@ import java.util.Optional; ...@@ -9,7 +9,13 @@ import java.util.Optional;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
/**
* The status of a {@link Repository}.
*
* @see Repository#getStatus()
*/
public class Status { public class Status {
private static final Pattern STATUS_ENTRY = Pattern.compile("(.?.) (?:.*? )?(.*?)\0"); private static final Pattern STATUS_ENTRY = Pattern.compile("(.?.) (?:.*? )?(.*?)\0");
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment