| 1 Aug 2025 |
raitobezarius (DECT: 7248) | In reply to @emilazy:matrix.org I will probably just keep creating non-formatted diffs, since… well, CI is happy with it and I'm totally happy with that as well | 16:30:53 |
raitobezarius (DECT: 7248) | In reply to @emilazy:matrix.org (the algorithm is simply: to rebase a commit that takes state A to state B across formatting, format A and B to produce A' and B' and diff B' against A'. Git mergetools or jj fix or whatever only enter the picture in how you make this happen; the algorithm itself works 100% reliably to produce the commit you would have produced if the change was written post-format) Don't get me wrong, I totally believe you that this is achievable | 16:31:08 |
raitobezarius (DECT: 7248) | Formatting is, to me, more than a technical discussion so I don't want you to lose time over something that I believe will disappoint more the participants than the ultimate achieved outcome | 16:31:55 |
emily | (I find it discouraging that I am having to manually do code formatting tasks (albeit likely formatting-standard-noncompliant ones) because I cannot reasonably use the tooling fwiw) | 16:32:02 |
raitobezarius (DECT: 7248) | Obviously, this can be revisited in the future | 16:32:04 |
emily | (I do know there are other Lix contributors using Jujutsu so I wonder what the workflow being used to deal with this is, but I suspect it involves editor hooks) | 16:32:56 |
raitobezarius (DECT: 7248) | Maybe I should forcibly switch myself to Jujutsu to understand what can be achieved | 16:33:15 |
Qyriad | we are likely doing that soon | 16:33:30 |
raitobezarius (DECT: 7248) | But really, this is the best I can offer at this point in time | 16:33:28 |
Charles | do iiiiiiit | 16:33:31 |
Qyriad | puck uses Jujutsu iwrc | 16:33:41 |
Qyriad | idk what she does with Lix with it | 16:33:47 |
emily | I have seen jade_ active in Jujutsu spaces too at least | 16:33:55 |
helle (just a stray cat girl) | yes, she has been trying to convince me to use it as well | 16:35:08 |
emily | as long as you have a formatting tool that can work in-memory on entire files (treefmt with the right configuration achieves this, clang-format can do it, nixfmt can do it, etc.) you can jj fix -s X on any X that has formatting-related conflicts (e.g., from a rebase or merge or revert) and the remaining conflicts in X and its children will be exactly the non-formatting ones. (jj fix -s X is also the tool that fixes formatting in X and its children in the absence of any conflicts)
I wouldn't call this a Jujutsu perk though because as I said the exact same results can be achieved with Git and insofar as it is more awkward to do so it is only the usual Jujutsu–Git delta of awkwardness
| 16:36:02 |
Charles | jj is great. i was hesitant to try it because i felt pretty comfortable with git despite its terrible ux but i regret not trying jj sooner because it's genuinely a huge improvement | 16:36:08 |
raitobezarius (DECT: 7248) | In reply to @emilazy:matrix.org
as long as you have a formatting tool that can work in-memory on entire files (treefmt with the right configuration achieves this, clang-format can do it, nixfmt can do it, etc.) you can jj fix -s X on any X that has formatting-related conflicts (e.g., from a rebase or merge or revert) and the remaining conflicts in X and its children will be exactly the non-formatting ones. (jj fix -s X is also the tool that fixes formatting in X and its children in the absence of any conflicts)
I wouldn't call this a Jujutsu perk though because as I said the exact same results can be achieved with Git and insofar as it is more awkward to do so it is only the usual Jujutsu–Git delta of awkwardness
yes but let's be clear again | 16:36:35 |
raitobezarius (DECT: 7248) | i don't want to make Lix a project that is jj-only | 16:36:43 |
raitobezarius (DECT: 7248) | or usable very much only if you use jj | 16:36:49 |
emily | see my second paragraph :( | 16:36:54 |
raitobezarius (DECT: 7248) | ok sorry :( | 16:37:01 |
emily | I really feel like there is a knowledge gap in how much simple merge tooling that Git supports as well as Jujutsu will resolve all formatting conflict issues automatically and that a small amount of documentation could resolve this, but I also understand that it's effectively not up for discussion | 16:37:27 |
raitobezarius (DECT: 7248) | because when you drum it too hard, I hear "let's make the experience great for jj users and for git… well doable but enjoy" | 16:37:27 |
emily | alright. I was replying to you talking about the Jujutsu workflow around this. if you had asked about Git I could have given that information too :) | 16:37:54 |
raitobezarius (DECT: 7248) | it's a risk aversion thing | 16:37:54 |
raitobezarius (DECT: 7248) | yeah what i was focusing on is "emilazy cannot format their diffs nicely with jj on lix contributions, so i will try jj and understand what is broken or what could be improved" | 16:38:29 |
raitobezarius (DECT: 7248) | and maybe write docs on how to use jj with lix and stuff | 16:38:35 |
raitobezarius (DECT: 7248) | if it's a one line config or something that can injected in the dev shell | 16:38:48 |
emily | (fwiw: https://github.com/emilio/clang-format-merge/blob/master/clang-format-merge. shipping something of this complexity in the repo will make git mergetool automatically resolve all formatting conflicts) | 16:39:38 |
emily | if it was this simple I already would have solved the issue and not chimed in re: WeetHet's problems
- there are no pre-commit hooks by design
- the current tooling to run fixers like formatters across commits, and to resolve formatting-related conflicts, is great but oriented around in-memory tools (whereas the partial Git stuff currently used can rely on doing a full slow checkout on each commit of a stack and computing the diff). (the partial reformatting regime means that this makes things harder for me even if I ignore formatting, because I can rebase over some code someone touched that then got reformatted and have conflicts that cannot be trivially resolved in one command due to the current scheme not formatting whole files)
- (I am often making changes with dumb editors and doing things in general weird ways so even if I set up editor hooks I would still want to be able to reliably check and fix a whole stack for formatting, especially since I am frequently squashing things from one commit to another and splitting commits etc.)
I think the options are using a colocated repository so the Git reformatter thing can work (and hoping that it works with detached HEAD) and rigorously ensuring I always have it get run by editors etc., or writing a manual slow script that checks out commits in sequence to fix them up and cannot easily be used to resolve conflicts unless I put in even more work
| 16:44:41 |