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

"ginue diff" command #12

Open
the-red opened this issue Jan 10, 2018 · 2 comments
Open

"ginue diff" command #12

the-red opened this issue Jan 10, 2018 · 2 comments

Comments

@the-red
Copy link
Member

the-red commented Jan 10, 2018

複数の環境のJSONを比較するコマンドあれば便利。
こんなイメージ。
ローカルにはどっさりJSONが保存されているが、
欲しいアプリ名・JSONの組み合わせだけを比較できる。

ginue diff development production appname/app_form_layout.json
@the-red
Copy link
Member Author

the-red commented Jul 7, 2018

この第一歩として、ginue pull --altオプションを作りました。
こうすると一部のJSONファイルはxxx-alt.jsonというのが別途作成されます。

アプリIDを含むJSONはアプリIDを固定文字列に置換したり、
順不同になりやすいJSONは条件に沿ってソートしたり、
環境間でノイズになるdiffが出ないように整形しております。

--alt付きでpullした後は、一部JSONを除外してこんなコマンドでdiffとると、
検出すべき差分だけを出してくれるハズ。

diff -x "revision.j*" -x "app.j*" -x "app_views.j*" -x "app_customize.j*" -x "app_form_fields.j*" -x "form.j*" -x "field_acl.j*" -r production development

ginue diffと叩くと、上記diffオプションと同等の処理が走るように検討中ナリ。

@the-red
Copy link
Member Author

the-red commented Feb 28, 2021

これ試してみる
https://github.com/kpdecker/jsdiff

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

No branches or pull requests

1 participant