package com.atlassian.stash.internal.scm.git.command.revlist;

import com.atlassian.bitbucket.scm.CommandOutputHandler;

import javax.annotation.Nonnull;

/**
 * Abstraction around a {@code CommandOutputHandler} for processing {@code git rev-list} output, tightly coupling the
 * output format for the executed command to the handler implementation for processing it.
 *
 * @param <T> The type of object returned after output has been processed
 */
public interface RevListOutputHandler<T> extends CommandOutputHandler<T> {

    /**
     * Retrieves the format which should be provided to {@code git rev-list --format=} to produce output which can
     * be consumed by this output handler.
     *
     * @return a format string, which <i>may not</i> be {@code null}
     */
    @Nonnull
    String getFormat();
}
