On Thu, Apr 03, 2025 at 08:47:37PM -0700, Martin von Zweigbergk wrote: > Yes, that's close to what we have in mind. I think I just didn't > explain clearly that it's mostly harmless in at least Jujutsu if there > are multiple commits with the same change id. If there are multiple > visible commits with the same change id, then you'll just have to > decide what should happen when the user tries to refer to commits by > change id. We currently let it resolve to all the visible commits with > the given change id. We may change that to be an error instead [1]. > The user can always fall back to using the commit id in such cases. We > call change ids with multiple visible commits "divergent". They > currently show up in red in `jj log`, which I think we all agree makes > them seem unnecessarily scary. We'll probably change that soon [2] > [3]. To support search by change ID you can use refs named something like refs/change-IDs/<change-ID>, and the ref can either point to a singular commit if the change ID is intended to be unique, or it can point to a root commit which lists the commits with that change ID. > So when I said that I think it's quite uncommon to have multiple > commits with the same change id, I didn't mean that as an excuse to > not consider the other cases at all. I just mean that I think the vast > majority of commits are not cherry-picked, so we don't need to > optimize the user experience for that case - it's fine if it's a bit > more complicated to refer to such commits. Fair. Nico --