-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Support jujutsu (jj) VCS #1070
Comments
That needs some research, at first glance its probably possible But there's a need to verify all plumbing command's are available and we need automated tests for it It's not something I can currently send time on |
A colocated repo may be the easiest start Anything more needs research |
Yeah, actually colocated repos already work (they're just a normal git repo with an extra .jj/ subdir). The others should be as trivial as adding an alternate gitdir path to check. |
as far as im aware, jj will know the correct metadata, so id strongly prefer using jj commands over pretending a jj repo is a drunk git repo |
Fair 😄 I'm involved with the jj project, so LMK if I can help here too with the research / coding. |
the key part is whether there are commands to give us some extra details on the worktree
a backend should be fairly straightforward, but a key part wil lbe testign how we get what version when in the testsuite |
so if jj had a way to get the metadata for "infer development version from scm metadata" in a easy way, it might be as simple as a single command |
Some relevant jj commands for reference...
One gotcha: the |
lovely starting point |
K, this one-liner should spit out one or two lines of input to determine the necessary tag/commit metadata: $ jj log --no-graph \
-r 'latest(::@ ~ (empty() ~ tags()))' \
-r 'latest(::@ & tags())' \
--template 'tags++" "++change_id++"\n"'
rqpqstnkkssmnpxtrotnoomxnrvnuvwo
v0.14.0 vktsrykqlynwupyvuupoxqsqnqswzkqo If there's no tagged ancestor it'll be missing the 2nd line of output (triggering the
If the "current commit" IS the last tagged commit it'll resolve both revisions as the same and spit out a single line with a tagged commit (meaning it's a clean tagged version and doesn't need a hash suffix):
Details on the revset mini-language at https://martinvonz.github.io/jj/latest/revsets/. For a quick explanation of the mechanics here, the Filtering out empty commits is important because jj paradigms usually have an empty commit on top of the "real" commit (akin to git's staging area). |
so how to add the distanceto the listing we need current commit id, last reachable tag, distance in commits to the tag to match what we do with the others |
One way would be to run 2 separate commands, one to figure out the tag and another to find all newer commits:
That might act funny when there are branched/merged commits, depending on what you mean by "distance", but in the case of multiple commit paths from tag to head I'm not sure there's a simple way to flatten to "longest distance" or "shortest distance" using the revset language, without separate processing. |
Nice, I verified those commands seem correct and it gets the same count |
Would it be possible to support https://github.com/martinvonz/jj so that if I clone a repo of a python project using that, I'm still able to build its python package contents normally?
At least in the case of their git backend that could be as simple as detecting if the repo dir contains a .jj/repo/store/git/ and running the existing git detection against that $GIT_DIR (example: https://martinvonz.github.io/jj/latest/github/#using-github-cli).
The text was updated successfully, but these errors were encountered: