Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

templater: Add operation.snapshot() boolean and default template hook #3460

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

necauqua
Copy link
Contributor

@necauqua necauqua commented Apr 5, 2024

I think that ideally there will be elided nodes for consecutive snapshots in the log, and the full oplog as it's shown now will require something like an --all flag.
But I looked at how jj log does elision and it went just a bit over my head atm 🙃

Also I wrote those hooks to use the implicit self since passing everything as args, especially when there's a possibility more things will be added (like snapshot) is unwieldy.

When I added builtin_log_root(change_id, commit_id) I just did not realize I could do that 🤷

And also those are hooks, not builtins, so the builtin_ name is bad, it's more consistent for them to be one of the format_ functions - see the comment about maybe having some sort of deprecated templater function that'll make jj emit warnings about hooks being changed?.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

cli/src/operation_templater.rs Show resolved Hide resolved
cli/src/config/templates.toml Show resolved Hide resolved
cli/src/config/templates.toml Outdated Show resolved Hide resolved
cli/src/config/templates.toml Outdated Show resolved Hide resolved
cli/src/config/templates.toml Outdated Show resolved Hide resolved
@necauqua necauqua force-pushed the necauqua/push-sxxrozrlttzp branch from 52b61ce to 0701763 Compare April 6, 2024 20:37
CHANGELOG.md Outdated Show resolved Hide resolved
cli/src/config/templates.toml Show resolved Hide resolved
cli/src/operation_templater.rs Show resolved Hide resolved
necauqua added 3 commits April 7, 2024 19:37
Expose the information we now record, to allow changing the default "snapshot
working copy" message or to make snapshots more compact/less distracting in
the log
This is to allow modifying default templates without completely overriding
them, for example to change the oplog snapshots but keep other defaults
@necauqua necauqua force-pushed the necauqua/push-sxxrozrlttzp branch from 0701763 to 64d9c5b Compare April 7, 2024 16:38
@necauqua necauqua enabled auto-merge (rebase) April 7, 2024 16:42
@necauqua necauqua merged commit feaaa48 into main Apr 7, 2024
16 checks passed
@necauqua necauqua deleted the necauqua/push-sxxrozrlttzp branch April 7, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants