* @since 4.0
*/
public class ConsoleAuthenticator extends CachedAuthenticator {
- /** Install this authenticator implementation into the JVM. */
+ /**
+ * Install this authenticator implementation into the JVM.
+ */
public static void install() {
final ConsoleAuthenticator c = new ConsoleAuthenticator();
if (c.cons == null)
private final Console cons = System.console();
+ /** {@inheritDoc} */
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm();
* @since 4.0
*/
public class ConsoleCredentialsProvider extends CredentialsProvider {
- /** Install this implementation as the default. */
+ /**
+ * Install this implementation as the default.
+ */
public static void install() {
final ConsoleCredentialsProvider c = new ConsoleCredentialsProvider();
if (c.cons == null)
private final Console cons = System.console();
+ /** {@inheritDoc} */
@Override
public boolean isInteractive() {
return true;
}
+ /** {@inheritDoc} */
@Override
public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) {
return true;
}
+ /** {@inheritDoc} */
@Override
public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
@Option(name = "--verbose", aliases = { "-v" }, usage = "usage_beMoreVerbose")
private boolean verbose;
+ /**
+ * Show fetch result.
+ *
+ * @param r
+ * a {@link org.eclipse.jgit.transport.FetchResult} object.
+ * @throws java.io.IOException
+ * if any.
+ */
protected void showFetchResult(final FetchResult r) throws IOException {
try (ObjectReader reader = db.newObjectReader()) {
boolean shownURI = false;
@Argument(required = true, metaVar = "metaVar_filepattern", usage = "usage_filesToAddContentFrom")
private List<String> filepatterns = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
@Argument(index = 3, metaVar = "metaVar_KEY", required = true)
private String key;
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final AmazonS3 s3 = new AmazonS3(properties());
@Option(name = "--output", aliases = { "-o" }, metaVar = "metaVar_file", usage = "usage_archiveOutput")
private String output;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (tree == null)
private BlameResult blame;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (file == null) {
private List<String> delete;
+ /**
+ * Delete branches
+ *
+ * @param names
+ * a {@link java.util.List} of branch names.
+ */
@Option(name = "--delete", aliases = {
"-d" }, metaVar = "metaVar_branchNames", usage = "usage_deleteFullyMergedBranch", handler = OptionWithValuesListHandler.class)
public void delete(List<String> names) {
private List<String> deleteForce;
+ /**
+ * Forcefully delete branches
+ *
+ * @param names
+ * a {@link java.util.List} of branch names.
+ */
@Option(name = "--delete-force", aliases = {
"-D" }, metaVar = "metaVar_branchNames", usage = "usage_deleteBranchEvenIfNotMerged", handler = OptionWithValuesListHandler.class)
public void deleteForce(List<String> names) {
deleteForce = names;
}
+ /**
+ * Forcefully create a list of branches
+ *
+ * @param branchAndStartPoint
+ * a branch name and a start point
+ */
@Option(name = "--create-force", aliases = {
"-f" }, metaVar = "metaVar_branchAndStartPoint", usage = "usage_forceCreateBranchEvenExists", handler = OptionWithValuesListHandler.class)
public void createForce(List<String> branchAndStartPoint) {
}
}
+ /**
+ * Move or rename a branch
+ *
+ * @param currentAndNew
+ * the current and the new branch name
+ */
@Option(name = "--move", aliases = {
"-m" }, metaVar = "metaVar_oldNewBranchNames", usage = "usage_moveRenameABranch", handler = OptionWithValuesListHandler.class)
public void moveRename(List<String> currentAndNew) {
private int maxNameLength;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (delete != null || deleteForce != null) {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (createBranch) {
@Option(name = "--dryRun", aliases = { "-n" })
private boolean dryRun = false;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
@Argument(index = 1, metaVar = "metaVar_directory")
private String localName;
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (localName != null && gitdir != null)
}
}
+ /** {@inheritDoc} */
@Override
public void initializedSubmodules(Collection<String> submodules) {
try {
}
}
+ /** {@inheritDoc} */
@Override
public void cloningSubmodule(String path) {
try {
}
}
+ /** {@inheritDoc} */
@Override
public void checkingOut(AnyObjectId commit, String path) {
try {
import java.lang.annotation.Target;
/**
- * Annotation to document a {@link TextBuiltin}.
+ * Annotation to document a {@link org.eclipse.jgit.pgm.TextBuiltin}.
* <p>
* This is an optional annotation for TextBuiltin subclasses and it carries
* documentation forward into the runtime system describing what the command is
@Target( { TYPE })
public @interface Command {
/**
+ * Get the command name
+ *
* @return name the command is invoked as from the command line. If the
* (default) empty string is supplied the name will be generated
* from the class name.
public String name() default "";
/**
+ * Get command description
+ *
* @return one line description of the command's feature set.
*/
public String usage() default "";
/**
+ * If this command is considered to be commonly used
+ *
* @return true if this command is considered to be commonly used.
*/
public boolean common() default false;
/**
* List of all commands known by jgit's command line tools.
* <p>
- * Commands are implementations of {@link TextBuiltin}, with an optional
- * {@link Command} class annotation to insert additional documentation or
- * override the default command name (which is guessed from the class name).
+ * Commands are implementations of {@link org.eclipse.jgit.pgm.TextBuiltin},
+ * with an optional {@link org.eclipse.jgit.pgm.Command} class annotation to
+ * insert additional documentation or override the default command name (which
+ * is guessed from the class name).
* <p>
* Commands may be registered by adding them to a services file in the same JAR
* (or classes directory) as the command implementation. The service file name
}
/**
+ * Get all commands sorted by their name
+ *
* @return all known commands, sorted by command name.
*/
public static CommandRef[] all() {
}
/**
+ * Get all common commands sorted by their name
+ *
* @return all common commands, sorted by command name.
*/
public static CommandRef[] common() {
import org.eclipse.jgit.pgm.internal.CLIText;
/**
- * Description of a command (a {@link TextBuiltin} subclass.
+ * Description of a command (a {@link org.eclipse.jgit.pgm.TextBuiltin}
+ * subclass).
* <p>
* These descriptions are lightweight compared to creating a command instance
* and are therefore suitable for catalogs of "known" commands without linking
}
/**
+ * Get the <code>name</code>.
+ *
* @return name the command is invoked as from the command line.
*/
public String getName() {
}
/**
+ * Get <code>usage</code>.
+ *
* @return one line description of the command's feature set.
*/
public String getUsage() {
}
/**
+ * Is this command commonly used
+ *
* @return true if this command is considered to be commonly used.
*/
public boolean isCommon() {
}
/**
+ * Get implementation class name
+ *
* @return name of the Java class which implements this command.
*/
public String getImplementationClassName() {
}
/**
+ * Get implementation class loader
+ *
* @return loader for {@link #getImplementationClassName()}.
*/
public ClassLoader getImplementationClassLoader() {
}
/**
+ * Create an instance of the command implementation
+ *
* @return a new instance of the command implementation.
*/
public TextBuiltin create() {
return r;
}
+ /** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
@Argument(metaVar = "metaVar_commitPaths", usage = "usage_CommitPaths")
private List<String> paths = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws NoHeadException, NoMessageException,
ConcurrentRefUpdateException, JGitInternalException, Exception {
@Option(name = "--file", aliases = { "-f" }, metaVar = "metaVar_file", usage = "usage_configFile")
private File configFile;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (list)
@Argument(required = true, metaVar = "metaVar_directory", usage = "usage_directoriesToExport")
List<File> directory = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
PackConfig packConfig = new PackConfig();
@Option(name = "--match", usage = "usage_Match", metaVar = "metaVar_pattern")
private List<String> patterns = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
package org.eclipse.jgit.pgm;
/**
- * Indicates a {@link TextBuiltin} implementation has failed during execution.
+ * Indicates a {@link org.eclipse.jgit.pgm.TextBuiltin} implementation has
+ * failed during execution.
* <p>
* Typically the stack trace for a Die exception is not shown to the user as it
* may indicate a simple error condition that the end-user can fix on their own,
// END -- Options shared with Log
+ /** {@inheritDoc} */
@Override
protected void init(final Repository repository, final String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
diffFmt.setRepository(db);
@Option(name = "--", metaVar = "metaVar_path", handler = PathTreeFilterHandler.class)
private TreeFilter pathFilter = TreeFilter.ALL;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (final TreeWalk walk = new TreeWalk(db)) {
@Argument(index = 1, metaVar = "metaVar_refspec")
private List<RefSpec> toget;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
}
}
+ /** {@inheritDoc} */
@Override
public void fetchingSubmodule(String name) {
try {
@Option(name = "--prune-preserved", usage = "usage_PrunePreserved")
private boolean prunePreserved;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
Git git = Git.wrap(db);
frame.getContentPane().add(world);
}
+ /** {@inheritDoc} */
@Override
protected int walkLoop() throws Exception {
graphPane.getCommitList().source(walk);
return graphPane.getCommitList().size();
}
+ /** {@inheritDoc} */
@Override
protected void show(final RevCommit c) throws Exception {
throw new UnsupportedOperationException();
}
+ /** {@inheritDoc} */
@Override
protected RevWalk createWalk() {
if (objects)
@Option(name = "--index-version", usage = "usage_indexFileFormatToCreate")
private int indexVersion = -1;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
BufferedInputStream in = new BufferedInputStream(ins);
@Argument(index = 0, metaVar = "metaVar_directory")
private String directory;
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
InitCommand command = Git.init();
dateFormatter = new GitDateFormatter(Format.DEFAULT);
}
+ /** {@inheritDoc} */
@Override
protected void init(final Repository repository, final String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
diffFmt.setRepository(db);
NoteMap.read(argWalk.getObjectReader(), notesCommit));
}
+ /** {@inheritDoc} */
@Override
protected void show(final RevCommit c) throws Exception {
outw.print(CLIText.get().commitLabel);
@Argument(index = 0, metaVar = "metaVar_uriish", required = true)
private String remote;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
LsRemoteCommand command = Git.lsRemoteRepository().setRemote(remote)
}
}
+ /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
@Option(name = "--", metaVar = "metaVar_paths", handler = StopOptionHandler.class)
private List<String> paths = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (final TreeWalk walk = new TreeWalk(db)) {
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.OptionHandlerFilter;
-/** Command line entry point. */
+/**
+ * Command line entry point.
+ */
public class Main {
@Option(name = "--help", usage = "usage_displayThisHelpText", aliases = { "-h" })
private boolean help;
private ExecutorService gcExecutor;
/**
- *
+ * <p>Constructor for Main.</p>
*/
public Main() {
HttpTransport.setConnectionFactory(new HttpClientConnectionFactory());
*
* @param argv
* arguments.
- * @throws Exception
+ * @throws java.lang.Exception
*/
public static void main(final String[] argv) throws Exception {
new Main().run(argv);
*
* @param argv
* arguments.
- * @throws Exception
+ * @throws java.lang.Exception
*/
protected void run(final String[] argv) throws Exception {
writer = createErrorWriter();
* the {@code --git-dir} option given on the command line. May be
* null if it was not supplied.
* @return the repository to operate on.
- * @throws IOException
+ * @throws java.io.IOException
* the repository cannot be opened.
*/
protected Repository openGitDir(String aGitdir) throws IOException {
@Option(name = "-m", usage = "usage_message")
private String message;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (squash && ff == FastForwardMode.NO_FF)
@Argument(index = 1, metaVar = "metaVar_commitish", required = true)
private List<RevCommit> commits = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
for (final RevCommit c : commits)
private boolean shownURI;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
@Argument(index = 0, required = true, metaVar = "metaVar_directory", usage = "usage_RepositoryToReceiveInto")
File dstGitdir;
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final org.eclipse.jgit.transport.ReceivePack rp;
@Argument(metaVar = "metaVar_ref")
private String ref;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
@Argument(index = 2, metaVar = "metaVar_uriish")
private String uri;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
}
}
+ /** {@inheritDoc} */
@Override
public void printUsage(final String message, final CmdLineParser clp)
throws IOException {
@Argument(required = true, metaVar = "metaVar_path", usage = "usage_pathToXml")
private String path;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
new RepoCommand(db)
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
@Command(usage = "usage_RevList")
class RevList extends RevWalkTextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void show(final RevCommit c) throws Exception {
if (c.has(RevFlag.UNINTERESTING))
outw.println();
}
+ /** {@inheritDoc} */
@Override
protected void show(final ObjectWalk ow, final RevObject obj)
throws Exception {
@Argument(index = 0, metaVar = "metaVar_commitish")
private List<ObjectId> commits = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (all) {
@Option(name = "--max-count", aliases = "-n", metaVar = "metaVar_n")
private int maxCount = -1;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
walk = createWalk();
}
}
+ /**
+ * Create RevWalk
+ *
+ * @return a {@link org.eclipse.jgit.revwalk.RevWalk} object.
+ */
protected RevWalk createWalk() {
RevWalk result;
if (objects)
return result;
}
+ /**
+ * Loop the walk
+ *
+ * @return number of RevCommits walked
+ * @throws java.lang.Exception
+ * if any.
+ */
protected int walkLoop() throws Exception {
int n = 0;
for (final RevCommit c : walk) {
* RevWalkTextBuiltin.
*
* @param c
- * The current {@link RevCommit}
- * @throws Exception
+ * The current {@link org.eclipse.jgit.revwalk.RevCommit}
+ * @throws java.lang.Exception
*/
protected abstract void show(final RevCommit c) throws Exception;
* process RevCommits.
*
* @param objectWalk
- * the {@link ObjectWalk} used by {@link #walkLoop()}
+ * the {@link org.eclipse.jgit.revwalk.ObjectWalk} used by
+ * {@link #walkLoop()}
* @param currentObject
- * The current {@link RevObject}
- * @throws Exception
+ * The current {@link org.eclipse.jgit.revwalk.RevObject}
+ * @throws java.lang.Exception
*/
protected void show(final ObjectWalk objectWalk,
final RevObject currentObject) throws Exception {
@Option(name = "--", handler = StopOptionHandler.class)
private List<String> paths = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
fmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy ZZZZZ", Locale.US); //$NON-NLS-1$
}
+ /** {@inheritDoc} */
@Override
protected void init(final Repository repository, final String gitDir) {
super.init(repository, gitDir);
diffFmt = new DiffFormatter(new BufferedOutputStream(outs));
}
+ /** {@inheritDoc} */
@SuppressWarnings("boxing")
@Override
protected void run() throws Exception {
@Command(usage = "usage_ShowRef")
class ShowRef extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
for (final Ref r : getSortedRefs()) {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
protected List<String> filterPaths;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
}
}
+ /**
+ * Print section header
+ *
+ * @param pattern
+ * a {@link java.lang.String} object.
+ * @param arguments
+ * a {@link java.lang.Object} object.
+ * @throws java.io.IOException
+ */
protected void printSectionHeader(String pattern, Object... arguments)
throws IOException {
if (!porcelain) {
}
}
+ /**
+ * Print String list
+ *
+ * @param list
+ * a {@link java.util.Collection} object.
+ * @return a int.
+ * @throws java.io.IOException
+ */
protected int printList(Collection<String> list) throws IOException {
if (!list.isEmpty()) {
List<String> sortedList = new ArrayList<>(list);
return 0;
}
+ /**
+ * Print String list
+ *
+ * @param status1
+ * a {@link java.lang.String} object.
+ * @param status2
+ * a {@link java.lang.String} object.
+ * @param status3
+ * a {@link java.lang.String} object.
+ * @param list
+ * a {@link java.util.Collection} object.
+ * @param set1
+ * a {@link java.util.Collection} object.
+ * @param set2
+ * a {@link java.util.Collection} object.
+ * @param set3
+ * a {@link java.util.Collection} object.
+ * @return a int.
+ * @throws java.io.IOException
+ */
protected int printList(String status1, String status2, String status3,
Collection<String> list, Collection<String> set1,
Collection<String> set2,
@Argument(index = 1, metaVar = "metaVar_object")
private ObjectId object;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (Git git = new Git(db)) {
commandName = name;
}
- /** @return true if {@link #db}/{@link #getRepository()} is required. */
+ /**
+ * If this command requires a repository.
+ *
+ * @return true if {@link #db}/{@link #getRepository()} is required
+ */
protected boolean requiresRepository() {
return true;
}
*
* @param args
* command line arguments passed after the command name.
- * @throws Exception
+ * @throws java.lang.Exception
* an error occurred while processing the command. The main
* framework will catch the exception and print a message on
* standard error.
*
* @param args
* the arguments supplied on the command line, if any.
- * @throws IOException
+ * @throws java.io.IOException
*/
protected void parseArguments(final String[] args) throws IOException {
final CmdLineParser clp = new CmdLineParser(this);
* Print the usage line
*
* @param clp
- * @throws IOException
+ * a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object.
+ * @throws java.io.IOException
*/
public void printUsageAndExit(final CmdLineParser clp) throws IOException {
printUsageAndExit("", clp); //$NON-NLS-1$
* Print an error message and the usage line
*
* @param message
+ * a {@link java.lang.String} object.
* @param clp
- * @throws IOException
+ * a {@link org.eclipse.jgit.pgm.opt.CmdLineParser} object.
+ * @throws java.io.IOException
*/
public void printUsageAndExit(final String message, final CmdLineParser clp) throws IOException {
printUsage(message, clp);
}
/**
+ * Print usage help text.
+ *
* @param message
* non null
* @param clp
* parser used to print options
- * @throws IOException
+ * @throws java.io.IOException
* @since 4.2
*/
protected void printUsage(final String message, final CmdLineParser clp)
}
/**
+ * Get error writer
+ *
* @return error writer, typically this is standard error.
* @since 4.2
*/
}
/**
+ * Get output writer
+ *
* @return output writer, typically this is standard output.
* @since 4.9
*/
}
/**
+ * Get resource bundle with localized texts
+ *
* @return the resource bundle that will be passed to args4j for purpose of
* string localization
*/
* <p>
* This method should only be invoked by {@link #execute(String[])}.
*
- * @throws Exception
+ * @throws java.lang.Exception
* an error occurred while processing the command. The main
* framework will catch the exception and print a message on
* standard error.
protected abstract void run() throws Exception;
/**
+ * Get the repository
+ *
* @return the repository this command accesses.
*/
public Repository getRepository() {
}
/**
+ * Exit the command with an error message
+ *
* @param why
* textual explanation
* @return a runtime exception the caller is expected to throw
}
/**
+ * Exit the command with an error message and an exception
+ *
* @param why
* textual explanation
* @param cause
}
/**
+ * Exit the command
+ *
* @param aborted
- * boolean indicating that the execution has been aborted before running
+ * boolean indicating that the execution has been aborted before
+ * running
* @return a runtime exception the caller is expected to throw
* @since 3.4
*/
}
/**
+ * Exit the command
+ *
* @param aborted
* boolean indicating that the execution has been aborted before
* running
}
/**
+ * Check if the arguments contain a help option
+ *
* @param args
* non null
* @return true if the given array contains help option
@Argument(index = 0, required = true, metaVar = "metaVar_directory", usage = "usage_RepositoryToReadFrom")
File srcGitdir;
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final org.eclipse.jgit.transport.UploadPack up;
@Command(common = true, usage = "usage_DisplayTheVersionOfJgit")
class Version extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
// read the Implementation-Version from Manifest
outw.println(MessageFormat.format(CLIText.get().jgitVersion, version));
}
+ /** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
@Argument(index = 1)
private String reftablePath;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
switch (test) {
private ThreadMXBean mxBean;
+ /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
mxBean = ManagementFactory.getThreadMXBean();
String secretKey;
+ /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
AppServer server = new AppServer(port);
@Command(usage = "usage_MakeCacheTree")
class MakeCacheTree extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Command(usage = "usage_ReadDirCache")
class ReadDirCache extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final int cnt = 100;
@Argument(index = 1, required = false)
private String ref;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (FileInputStream in = new FileInputStream(input);
private Map<ObjectId, ObjectId> rewrites = new HashMap<>();
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (!really && !db.getRefDatabase().getRefs(ALL).isEmpty()) {
private String txnNamespace;
private String txnCommitted;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (ObjectReader reader = db.newObjectReader();
@Command(usage = "usage_ShowCacheTree")
class ShowCacheTree extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Option(name = "--pretty", metaVar = "metaVar_commandDetail", usage = "usage_alterTheDetailShown")
private Format pretty = Format.USAGE;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final CommandRef[] list = CommandCatalog.all();
@Option(name = "--millis", aliases = { "-m" }, usage = "usage_showTimeInMilliseconds")
private boolean millis = false;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final SimpleDateFormat fmt;
@Argument(index = 0)
private ObjectId objectId;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
ObjectReader reader = db.newObjectReader();
@Option(name = "--repository", aliases = { "-r" }, metaVar = "GIT_DIR", usage = "Repository to scan")
List<File> gitDirs = new ArrayList<>();
+ /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (gitDirs.isEmpty()) {
@Argument(index = 1)
private String reftablePath;
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
List<Ref> refs = WriteReftable.readRefs(lsRemotePath);
@Command(usage = "usage_WriteDirCache")
class WriteDirCache extends TextBuiltin {
+ /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@Argument(index = 1)
private String out;
+ /** {@inheritDoc} */
@SuppressWarnings({ "nls", "boxing" })
@Override
protected void run() throws Exception {
}
/**
+ * Format text
+ *
* @param text
* the text to format.
* @return a new Format instance.
}
/**
+ * Get an instance of this translation bundle
+ *
* @return an instance of this translation bundle
*/
public static CLIText get() {
import org.kohsuke.args4j.spi.Setter;
/**
- * Custom argument handler {@link AbstractTreeIterator} from string values.
+ * Custom argument handler
+ * {@link org.eclipse.jgit.treewalk.AbstractTreeIterator} from string values.
* <p>
* Assumes the parser has been initialized with a Repository.
*/
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public AbstractTreeIteratorHandler(final CmdLineParser parser,
final OptionDef option,
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_treeish;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
-import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.IllegalAnnotationError;
import org.kohsuke.args4j.NamedOptionDef;
-import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.OptionHandlerRegistry;
import org.kohsuke.args4j.spi.OptionHandler;
* them into the given object.
*
* @param bean
- * instance of a class annotated by {@link Option} and
- * {@link Argument}. this object will receive values.
- *
+ * instance of a class annotated by
+ * {@link org.kohsuke.args4j.Option} and
+ * {@link org.kohsuke.args4j.Argument}. this object will receive
+ * values.
* @throws IllegalAnnotationError
* if the option bean class is using args4j annotations
* incorrectly.
* them into the given object.
*
* @param bean
- * instance of a class annotated by {@link Option} and
- * {@link Argument}. this object will receive values.
+ * instance of a class annotated by
+ * {@link org.kohsuke.args4j.Option} and
+ * {@link org.kohsuke.args4j.Argument}. this object will receive
+ * values.
* @param repo
* repository this parser can translate options through.
* @throws IllegalAnnotationError
this.db = repo;
}
+ /** {@inheritDoc} */
@Override
public void parseArgument(final String... args) throws CmdLineException {
final ArrayList<String> tmp = new ArrayList<>(args.length);
}
/**
+ * Check if array contains help option
+ *
* @param args
* non null
* @return true if the given array contains help option
}
}
+ /** {@inheritDoc} */
@Override
protected OptionHandler createOptionHandler(OptionDef o, Setter setter) {
if (o instanceof NamedOptionDef)
}
+ /** {@inheritDoc} */
@Override
public void printSingleLineUsage(Writer w, ResourceBundle rb) {
List<OptionHandler> options = getOptions();
import org.kohsuke.args4j.spi.Setter;
/**
- * Custom argument handler {@link ObjectId} from string values.
+ * Custom argument handler {@link org.eclipse.jgit.lib.ObjectId} from string
+ * values.
* <p>
* Assumes the parser has been initialized with a Repository.
*/
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public ObjectIdHandler(final CmdLineParser parser, final OptionDef option,
final Setter<? super ObjectId> setter) {
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
CLIText.format(CLIText.get().notAnObject), name);
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_object;
public class OptionWithValuesListHandler extends OptionHandler<List<?>> {
/**
+ * Constructor for OptionWithValuesListHandler.
+ *
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public OptionWithValuesListHandler(CmdLineParser parser,
OptionDef option, Setter<List<?>> setter) {
super(parser, option, setter);
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final List<String> list = new ArrayList<>();
return list.size();
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_values;
import org.kohsuke.args4j.spi.Setter;
/**
- * Create a {@link TreeFilter} to patch math names.
+ * Create a {@link org.eclipse.jgit.treewalk.filter.TreeFilter} to patch math
+ * names.
* <p>
* This handler consumes all arguments to the end of the command line, and is
- * meant to be used on an {@link Option} of name "--".
+ * meant to be used on an {@link org.kohsuke.args4j.Option} of name "--".
*/
public class PathTreeFilterHandler extends OptionHandler<TreeFilter> {
/**
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public PathTreeFilterHandler(final CmdLineParser parser,
final OptionDef option, final Setter<? super TreeFilter> setter) {
super(parser, option, setter);
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final List<PathFilter> filters = new ArrayList<>();
return filters.size();
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_paths;
import org.kohsuke.args4j.spi.Setter;
/**
- * Custom argument handler {@link RefSpec} from string values.
+ * Custom argument handler {@link org.eclipse.jgit.transport.RefSpec} from
+ * string values.
* <p>
* Assumes the parser has been initialized with a Repository.
*/
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public RefSpecHandler(final CmdLineParser parser, final OptionDef option,
final Setter<? super RefSpec> setter) {
super(parser, option, setter);
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
setter.addValue(new RefSpec(params.getParameter(0)));
return 1;
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_refspec;
import org.kohsuke.args4j.spi.Setter;
/**
- * Custom argument handler {@link RevCommit} from string values.
+ * Custom argument handler {@link org.eclipse.jgit.revwalk.RevCommit} from
+ * string values.
* <p>
* Assumes the parser has been initialized with a Repository.
*/
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public RevCommitHandler(final CmdLineParser parser, final OptionDef option,
final Setter<? super RevCommit> setter) {
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
String name = params.getParameter(0);
setter.addValue(c);
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_commitish;
import org.kohsuke.args4j.spi.Setter;
/**
- * Custom argument handler {@link RevTree} from string values.
+ * Custom argument handler {@link org.eclipse.jgit.revwalk.RevTree} from string
+ * values.
* <p>
* Assumes the parser has been initialized with a Repository.
*/
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public RevTreeHandler(final CmdLineParser parser, final OptionDef option,
final Setter<? super RevTree> setter) {
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_treeish;
/**
* Custom Argument handler for jgit command selection.
* <p>
- * Translates a single argument string to a {@link TextBuiltin} instance which
- * we can execute at runtime with the remaining arguments of the parser.
+ * Translates a single argument string to a
+ * {@link org.eclipse.jgit.pgm.TextBuiltin} instance which we can execute at
+ * runtime with the remaining arguments of the parser.
*/
public class SubcommandHandler extends OptionHandler<TextBuiltin> {
private final org.eclipse.jgit.pgm.opt.CmdLineParser clp;
* This constructor is used only by args4j.
*
* @param parser
+ * a {@link org.kohsuke.args4j.CmdLineParser} object.
* @param option
+ * a {@link org.kohsuke.args4j.OptionDef} object.
* @param setter
+ * a {@link org.kohsuke.args4j.spi.Setter} object.
*/
public SubcommandHandler(final CmdLineParser parser,
final OptionDef option, final Setter<? super TextBuiltin> setter) {
clp = (org.eclipse.jgit.pgm.opt.CmdLineParser) parser;
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final String name = params.getParameter(0);
return 1;
}
+ /** {@inheritDoc} */
@Override
public String getDefaultMetaVariable() {
return CLIText.get().metaVar_command;
public class UntrackedFilesHandler extends StringOptionHandler {
/**
+ * <p>Constructor for UntrackedFilesHandler.</p>
+ *
* @param parser
* The parser to which this handler belongs to.
* @param option
super(parser, option, setter);
}
+ /** {@inheritDoc} */
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String alias = params.getParameter(-1);