package com.atlassian.bitbucket.mesh.git.builder.revert;

import com.atlassian.bitbucket.mesh.git.builder.GitProcess;
import com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilderSupport;

import javax.annotation.Nonnull;

/**
 * A builder for {@code git revert} commands.
 *
 * @since 2.1
 */
public interface GitRevertBuilder extends GitProcessBuilderSupport<GitRevertBuilder> {

    /**
     * Builds a process which will run the configured revert, <i>discarding any output</i>. If the
     * output contains error messages, <i>they will be ignored</i>.
     *
     * @return a {@link GitProcess process} to execute the configured revert
     */
    @Nonnull
    GitProcess<Void> build();

    /**
     * Sets the commit to be reverted.
     *
     * @param value the SHA of the commit to be reverted
     * @return {@code this}
     */
    @Nonnull
    GitRevertBuilder commit(@Nonnull String value);

    /**
     * If the commit to be reverted is a merged commit, this method sets the parent number of the merged commit relative
     * to which the changes need to be reverted.
     *
     * @param value the parent number of the merged commit
     * @return {@code this}
     */
    @Nonnull
    GitRevertBuilder parentNumber(int value);
}