From 2adc4915d42547fd71e4d8983dc50e33df251b53 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 18 Feb 2025 17:33:15 +0100 Subject: just-lock: Support special pragma for plain imports Marking a source repository 'as plain' means that the whole source repository tree will get imported as a repository type corresponding to the source type. In this case, additional pragmas than those supported by the inndividual imports might need to be set. Solve this by supporting the just-mr-style 'pragma' field also in the source description, for all sources also accepting the 'as plain' field. Currently support only the 'special' pragma. Document change and add test for plain imports that checks this feature. --- doc/future-designs/just-lock.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'doc') diff --git a/doc/future-designs/just-lock.md b/doc/future-designs/just-lock.md index 151625c1..61e3c900 100644 --- a/doc/future-designs/just-lock.md +++ b/doc/future-designs/just-lock.md @@ -230,6 +230,12 @@ The type of a _source_ is defined by the string value of the mandatory subfield that will be used in the resulting repository description corresponding to any imported `"file"`-type repositories (see `just-import-git`). + If `"as plain": true`, any provided `"special"` key for the `"pragma"` field + in the source description is unconditionally set in the imported repositories, + superseding any other config- or import-level treatment of pragmas during the + import. Note that `"as plain": true` results in only one repository + (containing the whole source repository tree) being imported. + Proposed format: ``` jsonc { "source": "git" @@ -254,6 +260,7 @@ The type of a _source_ is defined by the string value of the mandatory subfield , "inherit env": [...] // optional; corresponds to `inherit_env` var (option --inherit-env) , "config": "" // optional; corresponds to `foreign_repository_config` var (option -R) , "as plain": false // optional; corresponds to `plain` var (option --plain) + , "pragma": {"special": ""} // optional; only considered if `"as plain": true` } ``` @@ -268,6 +275,12 @@ The type of a _source_ is defined by the string value of the mandatory subfield one can also set the `"to_git": true` pragma with a corresponding entry in the usual `"pragma"` field. + If `"as plain": true`, any provided `"special"` key for the `"pragma"` field + in the source description is unconditionally set in the imported repositories, + superseding any other config- or import-level treatment of pragmas during the + import. Note that `"as plain": true` results in only one repository + (containing the whole source repository tree) being imported. + Proposed format: ``` jsonc { "source": "file" @@ -289,6 +302,7 @@ The type of a _source_ is defined by the string value of the mandatory subfield , "path": "" // mandatory , "config": "" // optional; corresponds to `foreign_repository_config` var (option -R) , "as plain": false // optional; corresponds to `plain` var (option --plain) + , "pragma": {"special": ""} // optional; only considered if `"as plain": true` } ``` @@ -301,6 +315,12 @@ The type of a _source_ is defined by the string value of the mandatory subfield A field `"subdir"` is provided to account for the fact that source repository root often is not the root directory of the unpacked archive. + If `"as plain": true`, any provided `"special"` key for the `"pragma"` field + in the source description is unconditionally set in the imported repositories, + superseding any other config- or import-level treatment of pragmas during the + import. Note that `"as plain": true` results in only one repository + (containing the whole source repository tree) being imported. + Proposed format: ``` jsonc { "source": "archive" @@ -327,6 +347,7 @@ The type of a _source_ is defined by the string value of the mandatory subfield , "sha512": "" // optional checksum; if given, will be checked , "config": "" // optional; corresponds to `foreign_repository_config` var (option -R) , "as plain": false // optional; corresponds to `plain` var (option --plain) + , "pragma": {"special": ""} // optional; only considered if `"as plain": true` } ``` @@ -358,6 +379,12 @@ The type of a _source_ is defined by the string value of the mandatory subfield such repositories will be translated to appropriate `"git tree"`-type repositories in the output configuration. + If `"as plain": true`, any provided `"special"` key for the `"pragma"` field + in the source description is unconditionally set in the imported repositories, + superseding any other config- or import-level treatment of pragmas during the + import. Note that `"as plain": true` results in only one repository + (containing the whole source repository tree) being imported. + Proposed format: ``` jsonc { "source": "git tree" @@ -381,6 +408,7 @@ The type of a _source_ is defined by the string value of the mandatory subfield , "config": "" // optional; corresponds to `foreign_repository_config` var (option -R) // searched for in the "subdir" tree , "as plain": false // optional; corresponds to `plain` var (option --plain) + , "pragma": {"special": ""} // optional; only considered if `"as plain": true` } ``` -- cgit v1.2.3