HNHacker News
TopNewBestAskShowJobs

arxanas

1,033 karma · joined August 1, 2012

I'm Waleed Khan, a software engineer working on highly-scalable developer tooling. You can contact me at me@waleedkhan.name or see my resume at https://resume.waleedkhan.name.
submissionscomments
arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
I am working on a TUI tool for Git/jj to handle staging/splitting. Could you tell me more about what workflow would be problematic for you? For example, if you had to select lines that go in the first commit/staging area, does that work? Would it be better or worse if, for each line, you had to decide whether it would go into the first commit/staged vs second commit/unstaged area? Do you ever need to invert the first commit/staging area vs second commit/unstaged area?
arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
Check out https://github.com/martinvonz/jj/blob/main/docs/sapling-comp...

In my opinion:

- Sapling is much more mature/full-featured at this point. - Jujutsu improves source control workflows in a more principled way. - Jujutsu currently supports colocation with a Git repo, while Sapling requires that the Git repo be kept separately.

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
> staging only some files and comitting is much easier than splitting a commit after the fact

Re this point, how is it any different? "Staging" the files is essentially the same as splitting the commit, anyways — it's just that the newly-split contents go into a "staging area" vs a commit. Do you mean that the tooling to accomplish this is not good?

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
> it's not clear to me if the order matters and how many can be listed

It's worth noting that in Git, 1) the order is recorded and tracked in the commit (but almost always doesn't matter), and 2) you can have any number of parents for a commit. A >2-parent commit is called an "octopus merge" in Git, which you can search further to learn about. Thus, the only real difference is that Git defaults to including the current commit as one of the merge parents (and this can't really be disabled via `git merge` itself; you'd have to use one of the plumbing commands and construct the commit manually).

In Git, you can have 0+ parent commits; in Mercurial, you can have 0-2 parent commits; in Jujutsu, you can have 1+ parent commits (except for the special root commit with the zero hash, which is the ancestor of all commits that would otherwise have no parents).

To explicitly answer about the merge parent order, you can see a question like this: https://stackoverflow.com/q/49715421/344643. I suspect that under jj the difference is not nearly as complicated because of how it records conflicts, but I don't know for certain.

> What I meant was that with git status/log the differences between your local clone and the remote are clearly shown

In general, the multi-remote visualization could be improved in jj to handle some common workflows. You can customize the default `log` by setting `revset.log` https://github.com/martinvonz/jj/blob/7751cea47cfe6dd9654275... to show the commits you care about.

If the same branch exists on multiple remotes pointing to different commits, then I believe they're rendered with the remote to disambiguate as e.g. `main@origin`. This originates from Mercurial.

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
Support/discussion happens a fair amount on GitHub Discussions and Issues as well.
arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
> Not until I run some jj command? It's kind of begging for a 'jjd' isn't it? Or if you use an IDE you'd want/need it to be not just saving but doing some kind of 'jj nop'.

In practice, I find that it doesn't matter much. Some people do run `jj` in a loop incidentally (usually they have a live graph-log open on some screen). I suppose that you could get a "local history" feature like in some editors of more fine-grained changes to the codebase in this way. Folks have discussed adding a jj daemon, but so far it's not a priority.

> I haven't looked more into it than the readme, but that at least doesn't discuss (and I think it's important) withholding commits from the remote(s)? If everything's always(ish) committed, I've lost some control of untracked files or unstaged or locally stashed changes that I now need at the point of pushing; to mark those commits 'private' or something. I assume it does exist, and I'll look for it when I make time to play with it, but I find it slightly concerning (for how good it will be, or how important it's considered to be) that it's not more prominently discussed.

Usually it's pretty obvious to me which of my commits are public or private. When interfacing with GitHub, commits that are not reachable by a branch are definitely private . Additionally, commits without a description are private, and `jj git push` will warn you before allowing you to push them.

There has been some discussion about adopting Mercurial-style "phases" (https://wiki.mercurial-scm.org/Phases), which would explicitly accomplish the goal of marking commits public or private.

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
> jj merge exists but it's not obvious which revisions you are supposed to pass to it

I don't think I understand your confusion. `jj merge` is essentially like Git merge, except that you also normally pass the current commit as one of the revisions. For example, you could write `jj merge @ main` to make a merge commit with the working copy[1] and the `main` branch. Feel free to open a GitHub discussion or drop by the Discord channel to discuss more.

> jj log doesn't even seem to be able to update the HEAD for the parent branch

`git log`/`jj log` are non-mutating operations, so why would you expect that they can update `HEAD`/branches?

[1]: In my workflows, I typically use `@-` instead of `@` in this situation because I consider the working copy commit to contain "uncommitted" changes, but there is a significant complement of users who primarily use `@`, so it depends on your workflow.

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
There is a little more detail here: https://github.com/martinvonz/jj/blob/main/docs/technical/co...

Storing the conflicts symbolically in this way lets you reproduce the conflicts later and even auto-resolve certain conflicts, but it doesn't address resolving the actual contents of conflicts. You could probably use Pijul as a jj backend and get the best of both worlds (if someone were to implement it).

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
> I wonder how this behave if commits get randomly pushed to origin

You would expect the push to fail in the normal way, as if you had manually done the rebase, because your commit history may have diverged. That being said, I don't think this happens much in practice: the automatic rebases are typically for explicit history-rewriting operations that users tend to only do on their local work. If a user prefers to use a "no-rewriting" workflow, then they can certainly do so by simply not issuing the history-rewriting commands.

> anonymous branches are destined to be pushed remotely (to be reviewed and merged) and there is no local merge as far as I can tell, you can name these branches but no "merge back to development branch once done".

I'm not sure what you mean by this. You can do `jj merge` in a similar way to `git merge`, or you can do a rebase workflow.

arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
It's not really different than using Git to work on the same branch. If you and the teammate commit to the same branch, then you'll need to resolve the divergence somehow, usually a merge or rebase, or choose to forcibly overwrite the other's changes.
arxanas··on Jujutsu: A Git-compatible DVCS that is both simple and powerful
The `Backend` interface is not that wide: https://github.com/martinvonz/jj/blob/48b1a1c533f16fc5df5269.... Mostly it just handles reading/writing various objects. You could very plausibly add IPFS support yourself!
arxanas··on Programming languages going above and beyond
I don't understand why you say that my comment is reductive. It's adding nuance to the topic at hand, rather than removing it. The original comment talks about a situation where we constrain ourselves to "rigid types"; the child comment remarks on Rice's theorem having consequences for the analysis of general Turing machines; and I remind the commenter that we have already restricted ourselves to Turing machines satisfying some type system.

Another way to express the same point of view is to say that I am arguing that the Curry-Howard isomorphism is more relevant to the situation at hand than Rice's theorem. (This might be the "promise" that the original commenter was referring to.)

arxanas··on Programming languages going above and beyond
For the case of resource usage, you can see work like https://link.springer.com/chapter/10.1007/978-3-030-81685-8_... "Synthesis with Asymptotic Resource Bounds" which implements bounded resource checking. Of course, there are programs it rejects that it can't prove, but this is the essence of type systems: if you are willing to appease the typechecker, then you can establish facts about runtime properties.

For your case, there may be a simpler dependently-typed solution: in such systems, you can already say things like "given an input natural number n determined at runtime, this functions returns a vector of size n", which bounds the result vector size. One approach could be to disallow explicit memory allocation and require passing a memory allocator as a parameter along with the associated "request" number bounding how many allocations you can do, in a similar dependently-typed way.

arxanas··on Programming languages going above and beyond
Rice's theorem states that there is no general procedure to determine if an arbitrary Turing machine has some property. We are restricting ourselves to programs which typecheck under a certain type system, so there will certainly be a class of properties it can guarantee while still being Turing-complete (such as the bounding of memory, CPU, etc.). That is to say that it's not "theoretically possible in the general case," but we are willing to work with more specific cases, so it's not relevant to invoke Rice's theorem in this situation.
arxanas··on Melange 1.0: Compile OCaml / ReasonML to JavaScript
Why would you need substructural typing to emulate Typescript? Is there a substructural type system feature in TS?

You can accomplish width subtyping with OCaml's "polymorphic variants", which could be used to emulate TS union types more flexibly than traditional sum types.

What are the features of Elm and Purescript that help model TS that OCaml doesn't have?

arxanas··on Where are my Git UI features from the future?
I right-clicked commits not reachable from `HEAD` and the Edit Commit Message option was disabled, so I'm assuming it can only reword commits reachable from `HEAD`.
arxanas··on Branchless Workflow for Git
Yes, it's entirely client-side.
arxanas··on Branchless Workflow for Git
Yes, I am the author.

> I hope my comments did not come across as too negative.

Not at all!

> guess it's time to setup rust and check this out

It's also available on many package managers, such as Homebrew and Nix, although you'd have to build from source for the latest development version.

arxanas··on Where are my Git UI features from the future?
Sorry, my wording was imprecise, see my comment here https://news.ycombinator.com/item?id=34301971
arxanas··on Branchless Workflow for Git
> This seems to be about working with commits, including branched trees/graphs, without creating a named branch..?

That's correct.

arxanas··on Branchless Workflow for Git
https://github.com/martinvonz/jj and http://sapling-scm.com/ are good steps in this direction!
arxanas··on Branchless Workflow for Git
> Is this for a case where a bunch of people branch from master@HEAD (lets call this A), then you need to modify A, so you then need to rebase each branch that branched from A individually?

Mainly it's for when you branch from A multiple times, and then modify A. This can happen if you have some base work that you build multiple features on top of. I routinely do this as part of rapid prototyping, as described here: https://github.com/arxanas/git-branchless/wiki/Workflow:-div...

`git undo` shows a list of operations it'll execute, which you have to confirm before accepting. Of course, it's ultimately a matter of trust in the tools you use.

arxanas··on Branchless Workflow for Git
Trunk-based development is still in use at large companies. Usually they use something like Gerrit or Phabricator.

You could try tools like https://graphite.dev/ or https://reviewable.io/, or Meta's Sapling + ReviewStack.

arxanas··on Where are my Git UI features from the future?
Thanks. I confirmed that you can reword a commit which is reachable from `HEAD`, but not those on other branches in this way, similar to Sublime Merge elsewhere in the comments.
arxanas··on Where are my Git UI features from the future?
It is not! See https://github.com/arxanas/git-branchless/wiki/Architecture#...
arxanas··on Where are my Git UI features from the future?
It's true that it's easy to forget one's early challenges, but we have empirical support that design decisions such as the staging area are objectively difficult for beginners to adopt. See https://investigating-archiving-git.gitlab.io/. Mercurial, of course, doesn't have a staging area.
arxanas··on Where are my Git UI features from the future?
Apologies, but I misunderstood what you meant by the "downstream" conflict situation. That's not possible in git-branchless, but it is possible in Jujutsu, since it stores conflicts as first-class objects, so it can actually proceed with the application of subsequent patches even if a previous patch conflicted.

`git rebase` can be started and aborted, but to start it safely, you have to first set aside all of your existing work in the working copy. You can't really run it on the background or in parallel, which makes it annoying to do operations like rebase all branches, and can ruin build caches, which ends up being a significant problem on larger repositories. It's possible for the UI to show an icon next to each of my branches indicating whether they would rebase onto the main branch successfully, but no interfaces at present do (including my own). Or, for example, I should be able to start dragging a branch to indicate a rebase, and the UI should speculatively check which target branches can be rebased onto successfully and indicate that.

arxanas··on Where are my Git UI features from the future?
On the contrary: I myself have implemented these better operations, and they work great. They also exist in some other VCSes, such as Mercurial and Jujutsu. You can see the `git-branchless` column in the table for comparison with the other clients.

- git reword: https://github.com/arxanas/git-branchless/wiki/Command:-git-...

- git move will perform the magic "see all downstream conflicts", but unfortunately will only show you the number of conflicting files, at present: https://github.com/arxanas/git-branchless/wiki/Command:-git-...

- You cannot undo arbitrary operations with the reflog (nor with `git reset`). See https://github.com/arxanas/git-branchless/wiki/Architecture#.... Besides those points, my `git undo` can even undo some working copy changes: https://github.com/arxanas/git-branchless/wiki/Command:-git-...

arxanas··on Where are my Git UI features from the future?
For example, Git is somewhat ambivalent on the topic, but Fossil SCM is notably very much against rebasing/rewriting history.
arxanas··on Where are my Git UI features from the future?
If I'm reading this correctly, you cannot reword a commit without first checking it out, and you cannot preview merge conflicts without first starting a merge/rebase operation? Those are the criteria as described at https://blog.waleedkhan.name/git-ui-features/#rubric
← PreviousPage 2 of 8Next →