8000 dune subst crashes when there is no commit · Issue #3619 · ocaml/dune · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
dune subst crashes when there is no commit #3619
Closed
@emillon

Description

@emillon

Hi,

This is a bit of an edge case but I think that's worth reporting.

When running dune subst in a git repository with no commit, the following error happens:

  $ cat > dune-project <<EOF
  > (lang dune 1.0)
  > (name foo)
  > EOF

  $ echo 'authors: [ "John Doe <john@doe.com>" ]' > foo.opam

  $ git init --quiet

  $ dune subst
           git (internal) (exit 128)
  /usr/bin/git describe --always --dirty > /tmp/dune.cram.43198erun.t/tmp/dune3a97db.output
  fatal: bad revision 'HEAD'
           git (internal) (exit 128)
  /usr/bin/git rev-parse HEAD > /tmp/dune.cram.43198erun.t/tmp/dune7e6051.output
  fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
           git (internal) (exit 128)
  /usr/bin/git ls-tree -r --name-only HEAD > /tmp/dune.cram.43198erun.t/tmp/dune2547a1.output
  fatal: Not a valid object name HEAD
  [1]

This happened to me while opam pinning a new package. I started working on a fix, but it's a bit complex because we need to both get the git error code and its output, which we don't do at the moment, so I put that on hold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0