> Awesome, how do you ensure clients of your code always do the correct operations on your data?
Either the data type is opaque (as in you shouldn’t mess with it and you should use the provided api) or it’s just normal primitives and thus no restrictions.
You don’t usually reach into data structures to modify their properties, especially if it’s for foreign modules.
>> I find it incredibly useful as an individual contributor opening many PRs on a single upstream project
> I probably subconsciously steer away from due to the awkwardness.
I think if I need to rebase a PR enough while waiting for merge that it's a coordination issue and maybe too much churn in the codebase. There shouldn't be a need to do so. Not sure I'd blame git for that.
I have to be the one to rebase my PR or my signature will become invalid. The only valid way to merge my commits is via fast-forward.
(Do let me know if this has changed, but I've seen any other kind of merge result in the yellow "Unverified" status on GitHub, as I have the thing turned on that requires all commits from me to be signed with my own key.)
That's just the surface concern. Why is the review time so large that you have multiple PRs ongoing? Why is the codebase churning you have conflicting changes that aren't trivial?
No one is obligated to review PRs in a timely manner, nor stop development for me in particular. The entire point of a PR is that I put in all the work to maintain it as long as it is open, and eventually someone may get around to reviewing and potentially merging it. Upstreaming is a volunteer process.
> Let's say mid work you're interrupted and needs to check a an commit. `abc` is your current working copy and `def` is the commit you want to checkout. You can leave your harness behind (`jj new def`), do whatever you need there, then come back (`jj edit abc`). You can also bring your harness with you with `jj rebase -s @ -o def`.
It was not complicated with git either. If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
One key thing is that I find that conflicts are a very good signal for when the intent of the worktree at commit c clashes with the intent of patch p. Especially if you've designed the code to follow the single responsibility principle. I don't want to sweep this under the rug. Instead I want to solve it right away.
A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them. I think there's too much focus on managing files instead of unit of changes (contained in patches).
Same as the index, the stash is also just a commit. It's not that it's impossible to do any of this in git, it's that it's more orthogonal in jj. Commits, the stash, and the index are three features in git, but a single feature in jj. This also means you can bring all of the tools to use on your psudeo-index and psuedo-stash that you use to work with commits.
commits: clean patches that have been integrated somehow (even as a draft version in my local repo)
index: patch in progress (very short lived as I usually add things and commit right after). It's an editing space.
stash: valuable patches in terms of knowledge, but not relevant to any current task
While they look similar, they have different purposes and so interact with different tools.
I code for one purpose (and maybe get distracted for one thing or two) then goes on to clean up the patches and write a proper message. It's not a matter of adding and rejecting hunks. I also do edit them normally. Tooling is not a problem as I spend more time on reading and editing than on tool calls.
Stashing is similar. The patches stored there are individuals, meaning I don't have to worry about dependency when I delete one. I also don't have to worry about location as there's just one stash concept.
You can also find a way to do the same operation in jj, but I want tooling centered around the concept of a patch, not the concept of commits. jj make it awkward to work with patches.
> A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them.
Yes, I agree. Nowadays I use jj but I had the same feel before trying it, and I do think git usually works fine. What does it for me is just that it makes things simpler and there are fewer commands and special cases. I can use the same command I use to stage things and to move some changes from/to any commit (`jj squash -i`, adding `--from` and `--into` as needed). The same command I use to create a new commit is the one I use to merge (`jj new`, a merge is just a commit with more than one parent). It's super easy to change which commit a branch points to (`jj bookmark move`). With a few commands I can do most things and most of the time I just look at the single page CLI reference[0] to figure it out in a few minutes. I still use git when I need one of the (still) unsupported features, which in my case were submodules and LFS.
> If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
Stash: for me, I just find it simpler with jj really. My "stash entries" show up in `jj log` just like everything else, and I immediately know in which parent it's based on. I can use the same commands to deal with the stash as I use for every commit, like I said in the previous paragraph, and I do not need to remember at which index the change was on the stash stack. I can also add a description to it if I want. Surely it's possible to do most of these in git, but in jj I already know how to do all of these as it's the same as any other commit.
> One key thing is that I find that conflicts are a very good signal for when [...] I don't want to sweep this under the rug. Instead I want to solve it right away.
Edit: ah, you're talking about the article. I also don't like leaving conflicts open and I do not use the edit workflow (where you edit commits in history directly). I will either: 1. create a new commit on top of the one I want to edit, then squash and immediately fix conflicts, or 2. work on the latest and squash all the way to the commit I want it on, then fix conflicts. TBF I don't think the way the article does it is too different from what you'd do with git, on git conflicts would only show when you do something like a rebase, a merge, maybe an amend. With the edit workflow it shows up when editing the files. At that point on git you're also "ignoring" the conflicts as you haven't merged / rebased yet.
For me the advantage on `jj`'s conflict handling is that I'll create a new commit on top of the conflicted commit, fix the conflicts there, then review while squashing my fixes (or maybe even comparing to the conflicted commit's parent, with `jj diff --from @--`, this way I can see the whole picture of the fix.
> One of the nice things about jj is you don't need to name a branch.
Maybe it's due to different thinking process. But I can't think of doing a branch without knowing why I would need to do it, which also give me a quick indication of how I should name it. Everything is local anyway so I don't complicate stuff.
You see the description of changes in your log, and so that's often good enough as a name. No need to give it a second one. Here's an example from a project of mine:
It's nicer with color. Anyway, this is an anonymous branch, with two changes on it. "add running compiler image identity" and "harden running image identity fixtures" let me know what that branch is about, without needing to add an extra name onto the branch itself.
I want tooling centered around the concept of a patch, not the concept of commits.
Commits for me are settled patches. I don't go around editing commits that much (and I have the tooling to make it trivial). Because for me, the patch inside has served it purpose. When I found a new purpose for it, the context has already been changed, so even when it saved me a bit of typing, I had to look at it anew.
So only the few commits around my current tasks are in flux. There's not a lot, so rebasing is very easy, even with the git cli. Same with editing a span of commits. It becomes the workspace and thus can easily be modified. Everything else is just on hold. That's why I like named branch. Because I look at it holistically instead of individual commits.
Maybe your workflow is different, and you are always doing surgical treatment to a complicated tree. But I never needed to do so. These days I'm even leaning towards a single patch for a feature or a fix. Way easier for communication.
I think the single commit case makes it even less of a need to name the branch, since the description is very much naming exactly what piece of work it is already.
Knowledge is mass, thinking is force. Needs are what makes us applies that thinking to the present form of knowledge to create new knowledge, and thus output.
Performance doesn’t require understanding. It’s kinda how everyone who has thrown something knows the trajectory is parabolic even when they don’t know that word or the equation of motion involved.
But to transmit the knowledge, it first requires a lot of thinking. Which involves breaking things into components, labeling them and stating their relationship. That’s what understanding is.
> For example, for years desktop apps were built on top of slow and heavy cross-platform frameworks like Electron, because writing them natively was too burdensome
It was not. Just by using QT you were on the fast track to support multiple platforms. And by 2010, most companies were only interested in Windows and MacOS. But today, it’s just laziness. Devs that only know web tech wants to use web tech everywhere, even when it does not fit the job. Hammer and nail style.
> In the past, test suites were mostly a way to catch regressions. In future, they will be essential to provide a verified baseline of correct behaviour?
And who will code these tests? To design good tests, you have to know the product quite well, and to know the product, you have to build it at least once. Because specs are full of knowns unknowns and unknowns unknowns. That’s why the best spec is the code itself.
Even when you know the requirements, you still have to design the test harness, and that depends on the products too. With the same caveat on knowledge.
> That is, roughly, how all automation works: You build the machine that does the humans job, barely, badly. Then you improve the machine
That’s not how automation works. The first thing you build is already taking care of a cumbersome part of the human jobs, even if limited in scope. The improvement part is in reliability and maintenance. Because the core problem is already solved. All that’s left are engineering issues.
So even if the first contraception is horrible, it should be clearly visible which immediate need it intents to solve, even if the full scope of changes is not known yet. But with those, there’s no need behind them, just imagined problems.
> It's hard because you made a fatal assumption: There is only one global memory. How exactly is anyone supposed to reason about such an omnipotent and all powerful concept, where everything can potentially affect anything?
Because parallelism is not that needed, there’s always contention starting from physical constraint. A user can only have one body, a printer can only output one piece of paper at a time,… There are natural areas for parallelism and it’s been already implemented. Memory as a bottleneck has not been a things for decades.
Breaking down things in terms of tasks is not hard. The hard part is discovering that those parts need to communicate. And sometimes they want access to same limited resources. We already have things like array programming that have a parallel view of computation. But no one is rushing to get things done with them.
In my experience, designing tests cases to ensure that they're othogonal and verify your invariants (domain or technical) is very mentally taxing and not something you can truly delegate. The actual typing maybe, but testing is a lot of duplicate code and you can go far with just copy-pasting stuff around and building helpers.
Either the data type is opaque (as in you shouldn’t mess with it and you should use the provided api) or it’s just normal primitives and thus no restrictions.
You don’t usually reach into data structures to modify their properties, especially if it’s for foreign modules.
reply