luarocks / luarocks/luarocks

Feature request: "revision" field in rockspecs

Open
#569 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Lua
Stars
3.7k
Forks
479
PR merge metrics
No merged PRs in 30d

Description

example:

```
source = {
url = "git://my/repo",
revision = "86d59e66d0c12656ed34d4f4a9bab06ac7775f77"
}
```

In this context revision means an atomic reference to a repo's state, e.g. commit hashes in git and changeset IDs in Mercurial.

This can be useful for when you don't directly control a source repo to add tags to it, or if you want more specific rockspecs than you want tags. It can also be used as verification for tags, the same way source.md5 is used.

Implementation-wise, it doesn't look like git lets you clone a specific commit, so instead you need to pick the closest branch/tag and then `git checkout` from there. Mercurial's `--rev` flag also does changesets in addition to branches/tags so there it's just a matter of also passing the changeset id in.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how rockspec source fields are parsed and how Git and Mercurial sources are fetched. Check the existing branch and tag handling, including Git checkout and Mercurial revision arguments. Done means a revision can be declared in a rockspec for both backends and is used to retrieve the requested repository state, with coverage for the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, lua
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.