Skip to content

compare more than one env? #9

Open

Description

@wanderingstan

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?

Activity

  1. werg commented on Aug 5, 2019

    @werg
    Collaborator

    @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?

  2. wanderingstan commented on Aug 5, 2019

    @wanderingstan
    ContributorAuthor

    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.

  3. werg commented on Aug 5, 2019

    @werg
    Collaborator

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

  4. wanderingstan commented on Aug 5, 2019

    @wanderingstan
    ContributorAuthor

    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.

  5. werg commented on Aug 6, 2019

    @werg
    Collaborator

    Hmm. listenv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions