*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-apply.html"
* >Git documentation about apply</a>
+ * @since 2.0
*/
public class ApplyCommand extends GitCommand<ApplyResult> {
/**
* Encapsulates the result of a {@link ApplyCommand}
+ *
+ * @since 2.0
*/
public class ApplyResult {
* @param all
* true to checkout all paths, false otherwise
* @return {@code this}
+ * @since 2.0
*/
public CheckoutCommand setAllPaths(boolean all) {
checkoutAllPaths = all;
* Returns a command object used to create a stashed commit
*
* @return a {@link StashCreateCommand}
+ * @since 2.0
*/
public StashCreateCommand stashCreate() {
return new StashCreateCommand(repo);
* Returns a command object used to apply a stashed commit
*
* @return a {@link StashApplyCommand}
+ * @since 2.0
*/
public StashApplyCommand stashApply() {
return new StashApplyCommand(repo);
* Returns a command object used to drop a stashed commit
*
* @return a {@link StashDropCommand}
+ * @since 2.0
*/
public StashDropCommand stashDrop() {
return new StashDropCommand(repo);
*
* @return a {@link ApplyCommand} used to collect all optional parameters
* and to finally execute the {@code apply} command
+ * @since 2.0
*/
public ApplyCommand apply() {
return new ApplyCommand(repo);
/**
* Continue with nothing left to commit (possibly want skip).
+ *
+ * @since 2.0
*/
NOTHING_TO_COMMIT {
@Override
*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html"
* >Git documentation about Stash</a>
+ * @since 2.0
*/
public class StashCreateCommand extends GitCommand<RevCommit> {
*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html"
* >Git documentation about Stash</a>
+ * @since 2.0
*/
public class StashDropCommand extends GitCommand<ObjectId> {
* exception can be retrieved by calling
* {@link Exception#getCause()}. Expect only
* {@code IOException's} to be wrapped.
+ * @since 2.0
*/
public Ref call() throws JGitInternalException,
ConcurrentRefUpdateException, InvalidTagNameException, NoHeadException {
* Get the prefix applied in front of old file paths.
*
* @return the prefix
+ * @since 2.0
*/
public String getOldPrefix() {
return this.oldPrefix;
/**
* Get the prefix applied in front of new file paths.
- *
+ *
* @return the prefix
+ * @since 2.0
*/
public String getNewPrefix() {
return this.newPrefix;
/**
* Thrown when JGit detects and refuses to use an invalid path
+ *
+ * @since 2.0
*/
public class InvalidPathException extends IllegalArgumentException {
* Initialize a new in-memory repository.
*
* @param repoDesc
- * description of the repository.
+ * description of the repository.
+ * @since 2.0
*/
public InMemoryRepository(DfsRepositoryDescription repoDesc) {
super(new DfsRepositoryBuilder<DfsRepositoryBuilder, InMemoryRepository>() {
/**
* Utility for writing reflog entries
+ *
+ * @since 2.0
*/
public class ReflogWriter {
/**
* Implementation of {@link AdvertiseRefsHook} that advertises the same refs for
* upload-pack and receive-pack.
+ *
+ * @since 2.0
*/
public abstract class AbstractAdvertiseRefsHook implements AdvertiseRefsHook {
public void advertiseRefs(UploadPack uploadPack)
package org.eclipse.jgit.transport;
-/** Hook to allow callers to take over advertising refs to the client. */
+/**
+ * Hook to allow callers to take over advertising refs to the client.
+ *
+ * @since 2.0
+ */
public interface AdvertiseRefsHook {
/**
* A simple hook that advertises the default refs.
*/
protected static final int MIN_CLIENT_BUFFER = 2 * 32 * 46 + 8;
- /** Include tags if we are also including the referenced objects. */
+ /**
+ * Include tags if we are also including the referenced objects.
+ * @since 2.0
+ */
public static final String OPTION_INCLUDE_TAG = "include-tag";
- /** Mutli-ACK support for improved negotiation. */
+ /**
+ * Mutli-ACK support for improved negotiation.
+ * @since 2.0
+ */
public static final String OPTION_MULTI_ACK = "multi_ack";
- /** Mutli-ACK detailed support for improved negotiation. */
+ /**
+ * Mutli-ACK detailed support for improved negotiation.
+ * @since 2.0
+ */
public static final String OPTION_MULTI_ACK_DETAILED = "multi_ack_detailed";
- /** The client supports packs with deltas but not their bases. */
+ /**
+ * The client supports packs with deltas but not their bases.
+ * @since 2.0
+ */
public static final String OPTION_THIN_PACK = "thin-pack";
- /** The client supports using the side-band for progress messages. */
+ /**
+ * The client supports using the side-band for progress messages.
+ * @since 2.0
+ */
public static final String OPTION_SIDE_BAND = "side-band";
- /** The client supports using the 64K side-band for progress messages. */
+ /**
+ * The client supports using the 64K side-band for progress messages.
+ * @since 2.0
+ */
public static final String OPTION_SIDE_BAND_64K = "side-band-64k";
- /** The client supports packs with OFS deltas. */
+ /**
+ * The client supports packs with OFS deltas.
+ * @since 2.0
+ */
public static final String OPTION_OFS_DELTA = "ofs-delta";
- /** The client supports shallow fetches. */
+ /**
+ * The client supports shallow fetches.
+ * @since 2.0
+ */
public static final String OPTION_SHALLOW = "shallow";
- /** The client does not want progress messages and will ignore them. */
+ /**
+ * The client does not want progress messages and will ignore them.
+ * @since 2.0
+ */
public static final String OPTION_NO_PROGRESS = "no-progress";
- /** The client supports receiving a pack before it has sent "done". */
+ /**
+ * The client supports receiving a pack before it has sent "done".
+ * @since 2.0
+ */
public static final String OPTION_NO_DONE = "no-done";
static enum MultiAck {
* Notification event delivered just before the pack is received from the
* network. This event can be used by RPC such as {@link TransportHttp} to
* disable its request magic and ensure the pack stream is read correctly.
+ *
+ * @since 2.0
*/
protected void onReceivePack() {
// By default do nothing for TCP based protocols.
*/
public abstract class BasePackPushConnection extends BasePackConnection implements
PushConnection {
- /** The client expects a status report after the server processes the pack. */
+ /**
+ * The client expects a status report after the server processes the pack.
+ * @since 2.0
+ */
public static final String CAPABILITY_REPORT_STATUS = "report-status";
- /** The server supports deleting refs. */
+ /**
+ * The server supports deleting refs.
+ * @since 2.0
+ */
public static final String CAPABILITY_DELETE_REFS = "delete-refs";
- /** The server supports packs with OFS deltas. */
+ /**
+ * The server supports packs with OFS deltas.
+ * @since 2.0
+ */
public static final String CAPABILITY_OFS_DELTA = "ofs-delta";
- /** The client supports using the 64K side-band for progress messages. */
+ /**
+ * The client supports using the 64K side-band for progress messages.
+ * @since 2.0
+ */
public static final String CAPABILITY_SIDE_BAND_64K = "side-band-64k";
private final boolean thinPack;
* commands to filter.
* @param want
* desired status to filter by.
- * @return a copy of the command list containing only those commands with the
- * desired status.
+ * @return a copy of the command list containing only those commands with
+ * the desired status.
+ * @since 2.0
*/
public static List<ReceiveCommand> filter(List<ReceiveCommand> commands,
final Result want) {
* name of the ref being affected.
* @param type
* type of the command.
+ * @since 2.0
*/
public ReceiveCommand(final ObjectId oldId, final ObjectId newId,
final String name, final Type type) {
*
* @param rp
* receive-pack session.
+ * @since 2.0
*/
public void execute(final ReceivePack rp) {
try {
package org.eclipse.jgit.transport;
-/** Indicates that a client request has not yet been read from the wire. */
+/**
+ * Indicates that a client request has not yet been read from the wire.
+ *
+ * @since 2.0
+ */
public class RequestNotYetReadException extends IllegalStateException {
private static final long serialVersionUID = 1L;
import java.io.IOException;
-/** Indicates a transport service may not continue execution. */
+/**
+ * Indicates a transport service may not continue execution.
+ *
+ * @since 2.0
+ */
public class ServiceMayNotContinueException extends IOException {
private static final long serialVersionUID = 1L;
* <p>
* This stream is buffered at packet sizes, so the caller doesn't need to wrap
* it in yet another buffered stream.
+ *
+ * @since 2.0
*/
public class SideBandOutputStream extends OutputStream {
/** Channel used for pack data. */
* JGit internal API for use by {@link DirCacheCheckout}
*
* @return start of name component part within {@link #getEntryPathBuffer()}
+ * @since 2.0
*/
public int getNameOffset() {
return pathOffset;
/**
* Option not to throw exceptions when a deletion finally doesn't succeed.
+ * @since 2.0
*/
public static final int IGNORE_ERRORS = 8;
* @param s
* the string to read
* @return the string divided into lines
+ * @since 2.0
*/
public static List<String> readLines(final String s) {
List<String> l = new ArrayList<String>();
* second string to compare.
* @return negative, zero or positive if a sorts before, is equal to, or
* sorts after b.
+ * @since 2.0
*/
public static int compareIgnoreCase(String a, String b) {
for (int i = 0; i < a.length() && i < b.length(); i++) {
* second string to compare.
* @return negative, zero or positive if a sorts before, is equal to, or
* sorts after b.
+ * @since 2.0
*/
public static int compareWithCase(String a, String b) {
for (int i = 0; i < a.length() && i < b.length(); i++) {
/**
* Creates a new InputStream, wrapping the specified stream
- *
+ *
* @param in
* raw input stream
* @param detectBinary
* whether binaries should be detected
+ * @since 2.0
*/
public EolCanonicalizingInputStream(InputStream in, boolean detectBinary) {
this.in = in;