package com.atlassian.bitbucket.mesh.config;

import com.atlassian.bitbucket.mesh.annotation.ManagedByControlPlane;
import com.atlassian.bitbucket.mesh.git.binary.GitBinary;

import javax.annotation.Nonnull;

public interface GitConfig {

    /**
     * @return the configured (and resolved) {@code git} binary
     */
    @Nonnull
    GitBinary getBinary();

    /**
     * @return compatibility information for the {@link GitBinary#getVersion() current git version}
     */
    @Nonnull
    GitCompatibilityConfig getCompatibility();

    /**
     * @return configuration properties related to garbage collection
     */
    @Nonnull
    GcConfig getGc();

    /**
     * @return configuration properties related to hooks
     */
    @Nonnull
    HooksConfig getHooks();

    /**
     * @return configuration properties related to hook scripts
     */
    @Nonnull
    HookScriptsConfig getHookScripts();

    /**
     * @return configuration properties related to hosting
     */
    @Nonnull
    HostingConfig getHosting();

    /**
     * @return the maximum length of the commit message to be loaded when retrieving one or more commits,
     *         to prevent {@code OutOfMemoryError}s
     */
    @ManagedByControlPlane
    int getMaxMessageLength();

    /**
     * @return configuration properties related to {@code git} processes
     */
    @Nonnull
    GitProcessConfig getProcess();
}
