Sign in

    PaiGack/moon_shadow/gitinfo does not have a README file

    Checkout

    The .git reader, re-exported: reading a checkout is gitx/gitz/repo's job, but the value it produces is part of this package's surface.

    RepoInfo

    The .git reader, re-exported: reading a checkout is gitx/gitz/repo's job, but the value it produces is part of this package's surface.

    RepoLocate

    The .git reader, re-exported: reading a checkout is gitx/gitz/repo's job, but the value it produces is part of this package's surface.

    GitInfo

    pub(all) struct GitInfo {
    available : Bool
    branch : String
    tag : String
    describe : String
    commit : String
    short_commit : String
    commit_date : String
    author : String
    email : String
    dirty : Bool
    ahead : Int
    behind : Int
    } derive(Eq,
    Debug
    )

    A snapshot of the git repository that was checked out when this module was built, rendered into the artifact at build time.

    Filled in by gen, never by the running program: the machine that runs the software has no .git, may not have git, and its cwd is none of your business.

    GitInfo::commit_version

    fn GitInfo::commit_version(self : GitInfo, short? : Bool) -> String

    <commit>[-dirty], or the short form when short is set.

    GitInfo::describe_version

    fn GitInfo::describe_version(self : GitInfo) -> String

    name[-dirty]: the branch name, the tag, or the describe output, whichever is the most specific thing known about HEAD.

    GitInfo::equal

    #deprecated("`GitInfo::equal` is deprecated, use `Eq::equal` instead.")
    fn GitInfo::equal(GitInfo, GitInfo) -> Bool

    GitInfo::is_dirty

    fn GitInfo::is_dirty(self : GitInfo) -> Bool

    Whether the value carries a commit worth printing.

    GitInfo::none

    fn GitInfo::none() -> GitInfo

    The "no git here" value: available = false, everything else empty.

    GitInfo::not_equal

    #deprecated("`GitInfo::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn GitInfo::not_equal(x : GitInfo, y : GitInfo) -> Bool

    GitInfo::to_repr

    #deprecated("`GitInfo::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn GitInfo::to_repr(GitInfo) ->
    Repr

    GitInfo::to_version_string

    fn GitInfo::to_version_string(self : GitInfo) -> String

    available=false becomes unavailable instead of an empty string, so a --version line does not end in dangling separators.

    read_repo_info

    fn read_repo_info(cwd : String) ->
    RepoInfo

    The checkout at cwd, read out of the files git itself would read.

    The other half of the pair is gitx/gitcli, which asks a git executable; this one opens HEAD, refs, packed-refs, the commit object and the index. moon.mod is not involved: this is a directory in.

    to_git_info

    The fields of GitInfo a .git reader can answer.

    commit_date / author / email need the commit object, dirty needs the index and a stat per file, and ahead / behind need the commit graph. All four are left empty rather than guessed: gitinfo does not invent a date to fill a hole.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io