Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document metadata format #183

Open
stepancheg opened this issue Mar 24, 2022 · 2 comments
Open

Document metadata format #183

stepancheg opened this issue Mar 24, 2022 · 2 comments

Comments

@stepancheg
Copy link
Contributor

I upgraded stgit, and now zsh prompt does not show current patch.

stgit metadata format changed, so old code reading metadata in zsh no longer works.

code

There are no applied/unapplied files in .git folder now.

AFAIU something like this is needed now:

git show refs/stacks/br:stack.json

Having a document could be helpful.

@jpgrayson
Copy link
Collaborator

Thanks for this feedback.

I did not realize that zsh's vcs_info module had StGit support. Good to know!

And yes, the zsh vcs_info module seems to be relying on StGit's old stack metadata which was completely removed in the StGit v1.0 release. The preferred mechanism for zsh to get the stack's applied and unapplied patch lists would be by running stg series --noprefix --applied and stg series --noprefix --unapplied, but if that's too expensive, then inspecting refs/stacks/<branch>:stack.json directly would be okay too, but with the caveat that the current metadata format was introduced in StGit v1.2, and so inspecting stack.json would only work for v1.2 and later. I do expect the current stack metadata format to be stable for the foreseeable future.

I'll also note that StGit ships with its own zsh completions which are up-to-date and far more complete and feature-rich than the completions that zsh ships with. One of these days I need to ask the zsh folks to remove their StGit completions.

I'm going to leave this open as a reminder to improve StGit's user-facing documentation of its stack metadata format.

@jpgrayson
Copy link
Collaborator

As a follow-up on this issue, I've contributed a change to zsh that updates its vcs_info to be compatible with StGit versions going back 8-9 years and up to the latest 2.x releases. I would expect this change to be in the zsh release (i.e. whatever comes after zsh 5.9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants