jj/cli/src/config-schema.json

360 lines
14 KiB
JSON
Raw Normal View History

{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Jujutsu config",
"type": "object",
"description": "User configuration for Jujutsu VCS. See https://github.com/martinvonz/jj/blob/main/docs/config.md for details",
"properties": {
"user": {
"type": "object",
"description": "Settings about the user",
"properties": {
"name": {
"type": "string",
"description": "Full name of the user, used in commits"
},
"email": {
"type": "string",
"description": "User's email address, used in commits",
"format": "email"
}
}
},
"operation": {
"type": "object",
"description": "Metadata to be attached to jj operations (shown in jj op log)",
"properties": {
"hostname": {
"type": "string",
"format": "hostname"
},
"username": {
"type": "string"
}
}
},
"ui": {
"type": "object",
"description": "UI settings",
"properties": {
"allow-init-native": {
"type": "boolean",
"description": "Whether to allow initializing a repo with the native backend",
"default": false
},
"default-command": {
"type": "string",
"description": "Default command to run when no explicit command is given",
"default": "log"
},
"default-description": {
"type": "string",
"description": "Default description to use when describing changes with an empty description",
"default": ""
},
"color": {
"description": "Whether to colorize command output",
"enum": [
"always",
"never",
"auto"
],
"default": "auto"
},
"paginate": {
"type": "string",
"description": "Whether or not to use a pager",
"enum": [
"never",
"auto"
],
"default": "auto"
},
"pager": {
"type": "string",
"description": "Pager to use for displaying command output",
"default": "less -FRX"
},
"diff": {
"type": "object",
"description": "Options for how diffs are displayed",
"properties": {
"format": {
"description": "The diff format to use",
"enum": [
"color-words",
"git",
"summary"
],
"default": "color-words"
},
"tool": {
"type": "string",
"description": "External tool for generating diffs"
}
}
},
"diff-instructions": {
"type": "boolean",
"description": "Whether to generate the JJ-INSTRUCTIONS file as part of editing a diff",
"default": true
},
2023-01-31 06:21:49 +00:00
"graph": {
"type": "object",
"description": "Options for rendering revision graphs from jj log etc",
"properties": {
"style": {
"description": "Style of connectors/markings used to render the graph. See https://github.com/martinvonz/jj/blob/main/docs/config.md#graph-style",
"enum": [
"legacy",
"curved",
"square",
"ascii",
"ascii-large"
],
2023-01-31 06:21:49 +00:00
"default": "legacy"
}
}
},
"log-word-wrap": {
"type": "boolean",
"description": "Whether to wrap log template output",
"default": false
},
"editor": {
"type": "string",
"description": "Editor to use for commands that involve editing text"
},
"diff-editor": {
"type": "string",
"description": "Editor tool to use for editing diffs",
"default": "meld"
},
"merge-editor": {
"type": "string",
"description": "Tool to use for resolving three-way merges. Behavior for a given tool name can be configured in merge-tools.TOOL tables"
}
}
},
"colors": {
"type": "object",
"description": "Mapping from jj formatter labels to colors",
"definitions": {
"colors": {
"enum": [
"default",
"black",
"red",
"green",
"yellow",
"blue",
"magenta",
"cyan",
"white",
"bright black",
"bright red",
"bright green",
"bright yellow",
"bright blue",
"bright magenta",
"bright cyan",
"bright white"
]
},
"basicFormatterLabels": {
"enum": [
"description",
"change_id",
"commit_id",
"author",
"committer",
"working_copies",
"current_working_copy",
"branches",
"tags",
"git_refs",
"is_git_head",
"divergent",
"hidden",
"conflict",
"root"
]
}
},
"propertyNames": {
"oneOf": [
{
"$ref": "#/properties/colors/definitions/basicFormatterLabels"
},
{
"type": "string"
}
]
},
"additionalProperties": {
"description": "A color profile for the given formatter label. Either a bare color name used as the foreground color or a table describing color and formatting",
"oneOf": [
{
"$ref": "#/properties/colors/definitions/colors"
},
{
"type": "object",
"properties": {
"fg": {
"$ref": "#/properties/colors/definitions/colors"
},
"bg": {
"$ref": "#/properties/colors/definitions/colors"
},
"bold": {
"type": "boolean"
},
"underline": {
"type": "boolean"
}
}
}
]
}
},
"git": {
"type": "object",
"description": "Settings for git behavior (when using git backend)",
"properties": {
"auto-local-branch": {
"type": "boolean",
"description": "Whether jj creates a local branch with the same name when it imports a remote-tracking branch from git. See https://github.com/martinvonz/jj/blob/main/docs/config.md#automatic-local-branch-creation",
"default": true
},
"abandon-unreachable-commits": {
"type": "boolean",
"description": "Whether jj should abandon commits that became unreachable in Git.",
"default": true
},
"push-branch-prefix": {
"type": "string",
"description": "Prefix used when pushing a change ID as a new branch",
"default": "push-"
},
"fetch": {
"description": "The remote(s) from which commits are fetched",
"default": "origin",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"push": {
"type": "string",
"description": "The remote to which commits are pushed",
"default": "origin"
}
}
},
"merge-tools": {
"type": "object",
"description": "Tables of custom options to pass to the given merge tool (selected in ui.merge-editor)",
"additionalProperties": {
"type": "object",
"properties": {
"program": {
"type": "string"
},
"diff-args": {
"type": "array",
"items": {
"type": "string"
}
},
"edit-args": {
"type": "array",
"items": {
"type": "string"
}
},
"merge-args": {
"type": "array",
"items": {
"type": "string"
}
},
"merge-tool-edits-conflict-markers": {
"type": "boolean",
"description": "Whether to populate the output file with conflict markers before starting the merge tool. See https://github.com/martinvonz/jj/blob/main/docs/config.md#editing-conflict-markers-with-a-tool-or-a-text-editor",
"default": false
}
}
}
},
"revsets": {
"type": "object",
"description": "Revset expressions used by various commands",
"properties": {
"log": {
"type": "string",
"description": "Default set of revisions to show when no explicit revset is given for jj log and similar commands",
"default": "@ | ancestors(immutable_heads().., 2) | heads(immutable_heads())"
},
"short-prefixes": {
"type": "string",
"description": "Revisions to give shorter change and commit IDs to",
"default": "<revsets.log>"
}
},
"additionalProperties": {
"type": "string"
}
},
"revset-aliases": {
"type": "object",
"description": "Custom symbols/function aliases that can used in revset expressions",
cli: make set of immutable commits configurable This adds a new `revset-aliases.immutable_heads()s` config for defining the set of immutable commits. The set is defined as the configured revset, as well as its ancestors, and the root commit commit (even if the configured set is empty). This patch also adds enforcement of the config where we already had checks preventing rewrite of the root commit. The working-copy commit is implicitly assumed to be writable in most cases. Specifically, we won't prevent amending the working copy even if the user includes it in the config but we do prevent `jj edit @` in that case. That seems good enough to me. Maybe we should emit a warning when the working copy is in the set of immutable commits. Maybe we should add support for something more like [Mercurial's phases](https://wiki.mercurial-scm.org/Phases), which is propagated on push and pull. There's already some affordance for that in the view object's `public_heads` field. However, this is simpler, especially since we can't propagate the phase to Git remotes, and seems like a good start. Also, it lets you say that commits authored by other users are immutable, for example. For now, the functionality is in the CLI library. I'm not sure if we want to move it into the library crate. I'm leaning towards letting library users do whatever they want without being restricted by immutable commits. I do think we should move the functionality into a future `ui-lib` or `ui-util` crate. That crate would have most of the functionality in the current `cli_util` module (but in a non-CLI-specific form).
2023-09-02 02:12:01 +00:00
"properties": {
"immutable_heads()": {
"type": "string",
"description": "Revisions to consider immutable. Ancestors of these are also considered immutable. The root commit is always considered immutable.",
"default": "trunk() | tags()"
}
},
"additionalProperties": {
"type": "string"
}
},
"template-aliases": {
"type": "object",
"description": "Custom symbols/function aliases that can used in templates",
"additionalProperties": {
"type": "string"
}
},
"aliases": {
"type": "object",
"description": "Custom subcommand aliases to be supported by the jj command",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
},
"snapshot": {
"type": "object",
"description": "Parameters governing automatic capture of files into the working copy commit",
"properties": {
"max-new-file-size": {
cli: make set of immutable commits configurable This adds a new `revset-aliases.immutable_heads()s` config for defining the set of immutable commits. The set is defined as the configured revset, as well as its ancestors, and the root commit commit (even if the configured set is empty). This patch also adds enforcement of the config where we already had checks preventing rewrite of the root commit. The working-copy commit is implicitly assumed to be writable in most cases. Specifically, we won't prevent amending the working copy even if the user includes it in the config but we do prevent `jj edit @` in that case. That seems good enough to me. Maybe we should emit a warning when the working copy is in the set of immutable commits. Maybe we should add support for something more like [Mercurial's phases](https://wiki.mercurial-scm.org/Phases), which is propagated on push and pull. There's already some affordance for that in the view object's `public_heads` field. However, this is simpler, especially since we can't propagate the phase to Git remotes, and seems like a good start. Also, it lets you say that commits authored by other users are immutable, for example. For now, the functionality is in the CLI library. I'm not sure if we want to move it into the library crate. I'm leaning towards letting library users do whatever they want without being restricted by immutable commits. I do think we should move the functionality into a future `ui-lib` or `ui-util` crate. That crate would have most of the functionality in the current `cli_util` module (but in a non-CLI-specific form).
2023-09-02 02:12:01 +00:00
"type": [
"integer",
"string"
],
"description": "New files with a size in bytes above this threshold are not snapshotted, unless the threshold is 0",
"default": "1MiB"
}
}
}
}
cli: make set of immutable commits configurable This adds a new `revset-aliases.immutable_heads()s` config for defining the set of immutable commits. The set is defined as the configured revset, as well as its ancestors, and the root commit commit (even if the configured set is empty). This patch also adds enforcement of the config where we already had checks preventing rewrite of the root commit. The working-copy commit is implicitly assumed to be writable in most cases. Specifically, we won't prevent amending the working copy even if the user includes it in the config but we do prevent `jj edit @` in that case. That seems good enough to me. Maybe we should emit a warning when the working copy is in the set of immutable commits. Maybe we should add support for something more like [Mercurial's phases](https://wiki.mercurial-scm.org/Phases), which is propagated on push and pull. There's already some affordance for that in the view object's `public_heads` field. However, this is simpler, especially since we can't propagate the phase to Git remotes, and seems like a good start. Also, it lets you say that commits authored by other users are immutable, for example. For now, the functionality is in the CLI library. I'm not sure if we want to move it into the library crate. I'm leaning towards letting library users do whatever they want without being restricted by immutable commits. I do think we should move the functionality into a future `ui-lib` or `ui-util` crate. That crate would have most of the functionality in the current `cli_util` module (but in a non-CLI-specific form).
2023-09-02 02:12:01 +00:00
}