commercialhaskell / commercialhaskell/stack

Add branch or ref to git deps

Open
#5,335 0 comments 4 reactions 0 assignees View on GitHub
component: nix type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Currently git dependencies only have two attributes: a URL of the repository and a commit SHA1. This works fine, but has an issue: it is generally inefficient: to find a commit without knowing what ref it belongs to, we generally have to fetch all of the repository.

Another problem (the one which is the reason for this feature request) is that it breaks compatibility with other tools, specifically Nix. See https://github.com/input-output-hk/haskell.nix/issues/592 and https://github.com/NixOS/nix/pull/2409 for the main issue I'm facing and motivation behind the way `fetchGit` works in nix respectively.

I propose to add an optional attribute of `branch` or `ref`, that would specify which reference the commit belongs to, and fetching only that reference when it is specified.

To be clear, I don't want to add the ability to specify `git` deps without `commit`, but merely allow to specify the branch/ref to which the commit belongs to.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.