Skip to content

Add --json to diff, for use from scripts / tooling #110

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

necaris
Copy link

@necaris necaris commented Dec 23, 2022

For some tooling (e.g. editors, prompts) it's helpful to know what
modifications Shadowenv has made, in a short summary. This PR adds a
changes subcommand that does just that: prints out a summary of
the form +added -removed ^updated.

Example of this working with a Starship prompt:
Screenshot 2022-12-23 at 13 47 44

For some tooling (e.g. editors, prompts) it's helpful to know what
modifications Shadowenv has made, in a short summary. This PR adds a
`changes` subcommand that does just that: prints out a summary of
the form `+added -removed ^updated`.
@lugray
Copy link

lugray commented Dec 23, 2022

This seems like a fairly niche use case with incredibly specific output. I'm not sure that it warrants an entire subcommand. It does seem like there's a use case to serve here though. It's quite similar in concept to shadowenv diff. I think that if you were to implement a shadowenv diff --json, a script could process that output to do whatever it wished with it, making it much more generally useful. And a script could process it relatively easily to produce an output like you desire.

@necaris necaris changed the title Add changes subcommand Add --json to diff, for use from scripts / tooling Dec 26, 2022
@necaris necaris marked this pull request as draft December 27, 2022 17:39
@lugray
Copy link

lugray commented Jan 9, 2023

Thanks for taking on the feedback. I think this is going to be a nice feature. I'll be happy to re-review once you mark it ready, or answer any questions you may have in the meantime.

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

Successfully merging this pull request may close these issues.

2 participants