Skip to content

version() fails on git compiled from source #852

@bytestream

Description

@bytestream

Compile git from source (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git#_installing_from_source) and then simpleGit().version() fails to parse the version string:

import { simpleGit } from 'simple-git'; 
 
console.log(await simpleGit().version());
{
  major: 0,
  minor: 0,
  patch: 0,
  agent: 'git version 2.37.GIT\n',
  installed: true
}

For ease of reproduction, example docker file to compile from source:

FROM debian:11

# Install latest version of git
RUN set -ex; \
    apt-get update; \
    # https://git-scm.com/book/en/v2/Getting-Started-Installing-Git#_installing_from_source
    apt-get install -y curl ca-certificates unzip build-essential dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev --no-install-recommends; \
    curl -o git.zip https://codeload.github.com/git/git/zip/refs/heads/master; \
    unzip git.zip; \
    cd git-master; \
    make configure; \
    ./configure --prefix=/usr ; \
    make all; \
    make install; \
    cd .. && rm -rf git-master git.zip; \
    git --version; \
    rm -rf /var/lib/apt/lists/*

ENTRYPOINT git --version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions