/** * Set the commit message * * @param message * the commit message used for the {@code commit} * @return {@code this} */ public CommitCommand setMessage(String message) { checkCallable(); this.message = message; return this; }
/** * Sets the committer for this {@code commit}. If no committer is explicitly * specified because this method is never called or called with {@code null} * value then the committer will be deduced from config info in repository, * with current time. * * @param committer * the committer used for the {@code commit} * @return {@code this} */ public CommitCommand setCommitter(PersonIdent committer) { checkCallable(); this.committer = committer; return this; }
/** * Used to amend the tip of the current branch. If set to {@code true}, the * previous commit will be amended. This is equivalent to --amend on the * command line. * * @param amend * whether to ammend the tip of the current branch * @return {@code this} */ public CommitCommand setAmend(boolean amend) { checkCallable(); this.amend = amend; return this; }
/** * Sets the author for this {@code commit}. If no author is explicitly * specified because this method is never called or called with {@code null} * value then the author will be set to the committer or to the original * author when amending. * * @param author * the author used for the {@code commit} * @return {@code this} */ public CommitCommand setAuthor(PersonIdent author) { checkCallable(); this.author = author; return this; }
/** * If set to true a change id will be inserted into the commit message * * An existing change id is not replaced. An initial change id (I000...) * will be replaced by the change id. * * @param insertChangeId * whether to insert a change id * @return {@code this} */ public CommitCommand setInsertChangeId(boolean insertChangeId) { checkCallable(); this.insertChangeId = insertChangeId; return this; }
/** * Commit dedicated path only. * <p> * This method can be called several times to add multiple paths. Full file * paths are supported as well as directory paths; in the latter case this * commits all files/directories below the specified path. * * @param only * path to commit (with <code>/</code> as separator) * @return {@code this} */ public CommitCommand setOnly(String only) { checkCallable(); if (all) throw new JGitInternalException(MessageFormat.format( JGitText.get().illegalCombinationOfArguments, "--only", //$NON-NLS-1$ "--all")); //$NON-NLS-1$ String o = only.endsWith("/") ? only.substring(0, only.length() - 1) //$NON-NLS-1$ : only; // ignore duplicates if (!this.only.contains(o)) this.only.add(o); return this; }
/** * If set to true the Commit command automatically stages files that have * been modified and deleted, but new files not known by the repository are * not affected. This corresponds to the parameter -a on the command line. * * @param all * whether to auto-stage all files that have been modified and * deleted * @return {@code this} * @throws JGitInternalException * in case of an illegal combination of arguments/ options */ public CommitCommand setAll(boolean all) { checkCallable(); if (all && !only.isEmpty()) throw new JGitInternalException(MessageFormat.format( JGitText.get().illegalCombinationOfArguments, "--all", //$NON-NLS-1$ "--only")); //$NON-NLS-1$ this.all = all; return this; }
/** * Sets the committer for this {@code commit}. If no committer is explicitly * specified because this method is never called then the committer will be * deduced from config info in repository, with current time. * * @param name * the name of the committer used for the {@code commit} * @param email * the email of the committer used for the {@code commit} * @return {@code this} */ public CommitCommand setCommitter(String name, String email) { checkCallable(); return setCommitter(new PersonIdent(name, email)); }
/** * Sets the author for this {@code commit}. If no author is explicitly * specified because this method is never called then the author will be set * to the committer or to the original author when amending. * * @param name * the name of the author used for the {@code commit} * @param email * the email of the author used for the {@code commit} * @return {@code this} */ public CommitCommand setAuthor(String name, String email) { checkCallable(); return setAuthor(new PersonIdent(name, email)); }
/** * @param message * the commit message used for the {@code commit} * @return {@code this} */ public CommitCommand setMessage(String message) { checkCallable(); this.message = message; return this; }
/** * Set the commit message * * @param message * the commit message used for the {@code commit} * @return {@code this} */ public CommitCommand setMessage(String message) { checkCallable(); this.message = message; return this; }
/** * Used to amend the tip of the current branch. If set to true, the previous * commit will be amended. This is equivalent to --amend on the command * line. * * @param amend * @return {@code this} */ public CommitCommand setAmend(boolean amend) { checkCallable(); this.amend = amend; return this; }
/** * Sets the author for this {@code commit}. If no author is explicitly * specified because this method is never called or called with {@code null} * value then the author will be set to the committer or to the original * author when amending. * * @param author * the author used for the {@code commit} * @return {@code this} */ public CommitCommand setAuthor(PersonIdent author) { checkCallable(); this.author = author; return this; }
/** * Used to amend the tip of the current branch. If set to {@code true}, the * previous commit will be amended. This is equivalent to --amend on the * command line. * * @param amend * whether to ammend the tip of the current branch * @return {@code this} */ public CommitCommand setAmend(boolean amend) { checkCallable(); this.amend = amend; return this; }
/** * Sets the committer for this {@code commit}. If no committer is explicitly * specified because this method is never called or called with {@code null} * value then the committer will be deduced from config info in repository, * with current time. * * @param committer * the committer used for the {@code commit} * @return {@code this} */ public CommitCommand setCommitter(PersonIdent committer) { checkCallable(); this.committer = committer; return this; }
/** * If set to true a change id will be inserted into the commit message * * An existing change id is not replaced. An initial change id (I000...) * will be replaced by the change id. * * @param insertChangeId * * @return {@code this} */ public CommitCommand setInsertChangeId(boolean insertChangeId) { checkCallable(); this.insertChangeId = insertChangeId; return this; }
ConcurrentRefUpdateException, WrongRepositoryStateException, AbortedByHookException { checkCallable(); Collections.sort(only);
/** * Sets the committer for this {@code commit}. If no committer is explicitly * specified because this method is never called then the committer will be * deduced from config info in repository, with current time. * * @param name * the name of the committer used for the {@code commit} * @param email * the email of the committer used for the {@code commit} * @return {@code this} */ public CommitCommand setCommitter(String name, String email) { checkCallable(); return setCommitter(new PersonIdent(name, email)); }
/** * Sets the committer for this {@code commit}. If no committer is explicitly * specified because this method is never called then the committer will be * deduced from config info in repository, with current time. * * @param name * the name of the committer used for the {@code commit} * @param email * the email of the committer used for the {@code commit} * @return {@code this} */ public CommitCommand setCommitter(String name, String email) { checkCallable(); return setCommitter(new PersonIdent(name, email)); }
/** * Sets the author for this {@code commit}. If no author is explicitly * specified because this method is never called then the author will be set * to the committer or to the original author when amending. * * @param name * the name of the author used for the {@code commit} * @param email * the email of the author used for the {@code commit} * @return {@code this} */ public CommitCommand setAuthor(String name, String email) { checkCallable(); return setAuthor(new PersonIdent(name, email)); }