Replies: 3 comments 2 replies
-
For reference, the design doc for |
Beta Was this translation helpful? Give feedback.
-
First sorry for the late response, as I've tried multiple times to write a reply but always failed to express myself. So here it goes.
The current approach which we'll use is documented in the design doc. I also recently thought of adding an option like
This is planned and will be supported as soon as And supporting special footers, e.g
This is a really interesting case to support, so I think this could be added to
As noted in the design doc, I'm not really a fan of adding So what does
Caching is planned and hopefully makes
I think this is another feature request for Jujutsu, as no current VCS has a builtin understanding of tests. But I like the idea.
I agree, as every backend benefits from |
Beta Was this translation helpful? Give feedback.
-
The git-branchless progress indicator shows a linear list of commits being processed, but it would be nice if it modeled the graph structure instead. It's often difficult for me to tell if a specific branch/stack has been fully processed yet. |
Beta Was this translation helpful? Give feedback.
-
I've been using git-branchless's
git test
for some time now and thought I'd provide notes on the workflow in practice.Terminology note: when rebasing B on top of A, we reapply the logical patch induced by B on top of A. There's another relevant operation when it comes to fixing commits where we reapply B on top of A by simply reusing B's tree, without any attempt to reapply the patch. I'll call this A "adopting" its old (orphaned) descendant B, rather than rebasing its descendants.
There are a few common modes for
git test run
:git test run
simply to "sandbox" a command run:hg fix
will run fixes on the set of all files changes since the roots of the commit set being processed. This means that each commit being processed performs duplicate work for files which were changed in an ancestor, but, in exchange, the command processing can be parallelized. This approach is sensible and almost certainly efficient in practice, but requires additional complexity or concessions if caching is desired.hg fix
actually requires that user commands run on the textual contents of files; as I understand it,hg fix
won't materialize the commit working copies at all. Obviously, this requires significant integration with the tool in question — for example, many formatters are not equipped to process files without a working copy — but you can get significant speedups if implemented correctly.And then some less-common modes, but still worth considering:
git test
has a--no-cache
option to decline both reading and writing to the cache.)git test
actually doesn't (currently) have a mode to fix a commit without adopting, which can cause mistakes if you're not careful.arc
tool famously does this to embed a change ID in the commit message immediately prior to uploading.Other notes:
-c
arguments forgit test run -c lint
vsgit test fix -c lint-fix
.git test
without worrying about wasting time.(cached)
and completes instantly.git test
has separaterun
andfix
subcommands because it wasn't clear how much the use-cases would overlap. In my experience so far, there are definitely cases where you don't want to fix using the results, but I think using the same command (with an optional--fix
argument) makes sense. The main impedance mismatch is that you often want to specify different underlying commands for the "check" and "fix" modes of a logical command.git test fix
doesn't support--search <strategy>
. I think there's even a reasonable interpretation of that argument, in which you try to find the first failing commit and then fix it and rebase (not adopt) descendants, as discussed above.git submit 'stack() - tests.failed()
. The most useful thing in practice is switching to the earliest/latest commit that failed tests (something likegit sw 'roots(descendants(stack() & tests.failed()))
... definitely worth aliasing if you're going to use that). That being said, I don't think revset support is a priority, particularly if we can directly enable some workflows like finding and fixing the first failing commit.jj run
and other more experimental commands (jj sync
?) as a separate command which usesjututsu-lib
. This would let us test Jujutsu's API and mimic how some organizations will probably create their own commands. (Conceivably, we could even change git-branchless to support jj as a backend to execute its utility commands likegit test
andgit sync
...)Beta Was this translation helpful? Give feedback.
All reactions