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

compare more than one env? #9

Open
wanderingstan opened this issue Aug 2, 2019 · 5 comments
Open

compare more than one env? #9

wanderingstan opened this issue Aug 2, 2019 · 5 comments
Assignees

Comments

@wanderingstan
Copy link
Contributor

wanderingstan commented Aug 2, 2019

I'm getting errors on my stan/ui-stuff branch since changing the -c param to only accept one arg. It seemed to be a bug that it took more, since it seems odd to compare current with more than one env, and the instructions said it compared exactly 2:
8fedf34#diff-745d835925dfbedf0741af6a49b9152bL22

But this has broken the -c on my branch, it looks like it really expected there to be a list of files. Was there an expectation that users could compare 2, 3, or more envs at once?

@werg
Copy link
Collaborator

werg commented Aug 5, 2019

@wanderingstan sorry I didn't see this one earlier. I set the -c command to have variable number of parameters, because we ostensibly wanted to have the ability to compare

  1. the current environment to the last commit (0 args -- not implemented)
  2. the current environment to a provided file or URL (1 arg)
  3. two different files / URLs (2 args)

anything above that would be weird.

I see you changed it to only accept one arg -- what do you think of the above approach though?

@wanderingstan
Copy link
Contributor Author

wanderingstan commented Aug 5, 2019

Until we really need option 1, I'd be in favor of keeping --compare to a simple "compare with one other" meaning.

Option 3 makes me wonder, "but can't we just use regular diff for this?" which drives to a maybe deeper question thats been rising in my mind: diffenv right now both "takes a snapshot of current env" and "compares two envs". This leads to some confusion as in, what do we call such a snapshot? Early on we called it "a diffenv", but that gets confusing when we're actually doing a comparison. It might be overthinking it, but I'm toying with the idea that this should split into (1) a tool to dump/snapshot/capture current environment and (2) a tool to diff the outputs of 1 -- if regular diff is not enough.

@werg
Copy link
Collaborator

werg commented Aug 5, 2019

We sort of could have a getenv (or some other name) and a diffenv?

@wanderingstan
Copy link
Contributor Author

wanderingstan commented Aug 5, 2019

Yeah exactly. And again, I'm not 100% sold on the idea, just playing it out.

Also feel like it would also be good to nail down the word for the things we're creating and comparing.

  • env
  • environment
  • development environment snapshot
  • total environment
  • machine state
  • development snapshot
  • ...etc

"env" or "environment" seem the clearest, if that's not confusing. (e.g. your file structure is not strictly part of your environment, but you could make a case that it is when you're running code.)

So then you would use getenv (or dumpenv?) to put everything into a file. And diffenv would be the prefered tool for comparing two envs--but of course you could also use just diff or some other tool.

@werg
Copy link
Collaborator

werg commented Aug 6, 2019

Hmm. listenv?

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