keith / git-pile

Stacked diff support for GitHub workflows
MIT License
146 stars 11 forks source link

Thinking out loud: Change ID's #63

Open pjaspers opened 2 weeks ago

pjaspers commented 2 weeks ago

I was reading about jujutsu: https://github.com/martinvonz/jj and a thing that I like was their unique id's, regardless of the sha.

So when they do a log they get back something like this:

Working copy : kntqzsqt d7439b06 (empty) (no description set)

Which seems like a feature I would want in git-pile as well, because it solves the copying of the sha of the PR (which gets changed all the time), when doing an updatepr.

Since the branch names act as the unique identifier, I'm pretty sure we could get some unique short code out of it as well, and since we control the submitpr and updatepr, we could check if the thing that we're passing is either a git sha or a 'Change ID'®.

So far so good!

What I don't like about this idea is that it would mean writing a git pilelog just to be able to show the change id, which I could probably get magit to use, but it would probably be annoying and error prone.

I guess I could stick the change id into the branch name, prefix or suffix wise, and that way I could see it and reference it. The win than would be that we'd always have the same ID to reason about with git pile. Ah no, it should be in the commit message, and that just feels icky.

So, this was a lot of me thinking out loud, I'll probably tinker on it a bit, but wanted to check if there was any interest in this.

keith commented 2 weeks ago

I've been wondering if we could use git notes for this. related convo https://github.com/keith/git-pile/issues/4#issuecomment-2127873691

pjaspers commented 2 weeks ago

Didn’t know about git notes, I think I like it.

Pros:

Cons:

But I don’t really see a way around that last part, probably some gitconfig to give log some new defaults I don’t know about