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

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

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * A builder which can be used to construct a {@link com.atlassian.bitbucket.mesh.git.builder.GitProcess process}
 * for running {@code git format-patch}.
 */
public interface GitFormatPatchBuilder extends GitProcessBuilderSupport<GitFormatPatchBuilder> {

    /**
     * @param value indicates whether or not to generate a patch which includes all ancestors of {@code rev}. If true
     *              then the value provided by {@code ancestor} is ignored.
     * @return {@code this}
     */
    @Nonnull
    GitFormatPatchBuilder allAncestors(boolean value);

    /**
     * Specifies the ancestor for the patch. This is only applicable when {@code allAncestors} is false.
     * If this method isn't called, the patch will represent one single commit, the {@code rev}.
     *
     * @param value the ancestor
     * @return {@code this}
     */
    @Nonnull
    GitFormatPatchBuilder ancestor(@Nullable String value);

    /**
     * Specifies the rev for the patch.
     *
     * @param value the rev
     * @return {@code this}
     */
    @Nonnull
    GitFormatPatchBuilder rev(@Nonnull String value);
}
