package com.atlassian.bitbucket.mesh.config;

public interface GitCompatibilityConfig {

    /**
     * Prior to {@code git} 2.37, {@code git} would perform 'extra' {@code reference-transaction} callbacks for ref
     * deletions; for these versions, special filtering is needed to ignore these 'fake' callbacks
     * <p>
     * At the time of writing, {@code git 2.37} had not been released and this compatibility flag has been made
     * configurable in case the proposed changes do not get shipped in {2.37}.
     *
     * @return {@code true} if {@code git} performs 'extra' {@code reference-transaction} callbacks for ref deletions
     */
    boolean isPackedRefsBackendCallbacksSuppressed();

    /**
     * Prior to git 2.37, {@code reference-transaction} callbacks for {@code git branch -d} and {@code git tag -d} were
     * broken. When deleting refs, {@code git} usually performs 'fake' {@code reference-transaction} callbacks before
     * invoking the real callback. This results in callback sequences like {@code prepared (packed)},
     * {@code prepared (loose)}, {@code committed (packed)}, {@code committed (loose)}.
     * <p>
     * For {@code git branch -d} and {@code git tag -d}, the flows are different: {@code prepared (packed)},
     * {@code committed (packed)}, {@code prepared (loose)}, {@code committed (loose)}. As a result, special handling
     * is required to ensure Mesh's {@code prepared} callback is invoked before any (packed) changes are committed and
     * the {@code committed} callback is invoked after both packed and loose changes have been committed.
     * <p>
     * At the time of writing, {@code git 2.37} had not been released and this compatibility flag has been made
     * configurable in case the proposed changes do not get shipped in {2.37}.
     *
     * @return {@code true} if the {@code reference-transaction} callbacks are broken for {@code git branch -d} and
     *         {@code git tag -d} in the current {@code git} version
     */
    boolean isRefDeleteCallbacksBroken();
}
