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

file: improve diff output #327

Merged
merged 1 commit into from
Dec 29, 2020

Conversation

terceiro
Copy link
Contributor

diff This makes the output of a changed file look like this:

INFO : file[/path/to/file] modified will change from 'false' to 'true'
INFO : diff:
INFO : --- /path/to/file (BEFORE)
INFO : +++ /path/to/file (AFTER)
INFO : @@ -1,2 +1,2 @@
INFO : -line 0
INFO : line 1
INFO : +line 2

That's a lot better than displaying a random temporary filename as the
second file.

diff This makes the output of a changed file look like this:

INFO :   file[/path/to/file] modified will change from 'false' to 'true'
INFO :   diff:
INFO :   --- /path/to/file (BEFORE)
INFO :   +++ /path/to/file (AFTER)
INFO :   @@ -1,2 +1,2 @@
INFO :   -line 0
INFO :    line 1
INFO :   +line 2

That's a lot better than displaying a random temporary filename as the
second file.
@unasuke unasuke self-requested a review December 28, 2020 14:10
@unasuke
Copy link
Member

unasuke commented Dec 29, 2020

 INFO :       diff:
DEBUG :       Executing `diff -u --label\=/tmp/http_request_headers.html\ \(BEFORE\) /dev/null --label\=/tmp/http_request_headers.html\ \(AFTER\) /tmp/itamae_tmp/1609226585.4889503/itamae20201229-1116-q23exp`...
DEBUG :         [:post, "/v1.16/containers/8a8cf2b295fe647d87947fc017161fc4e1b2d75aab1856a8ea27e38c23e3cc44/exec", {}, "{\"User\":null,\"AttachStdin\":false,\"AttachStdout\":true,\"AttachStderr\":true,\"Tty\":false,\"Cmd\":[\"/bin/sh\",\"-c\",\"diff -u --label\\\\=/tmp/http_request_headers.html\\\\ \\\\(BEFORE\\\\) /dev/null --label\\\\=/tmp/http_request_headers.html\\\\ \\\\(AFTER\\\\) /tmp/itamae_tmp/1609226585.4889503/itamae20201229-1116-q23exp\"]}"]
DEBUG :         [:post, "/v1.16/exec/79aed478e6cafa39be49f337c867cc03cb1ec045c75bdb5558780f242a912bd2/start", {}, "{\"Tty\":false,\"Detach\":false}"]
DEBUG :         [:get, "/v1.16/exec/79aed478e6cafa39be49f337c867cc03cb1ec045c75bdb5558780f242a912bd2/json", {}, nil]
DEBUG :         exited with 1
 INFO :       --- /tmp/http_request_headers.html (BEFORE)
 INFO :       +++ /tmp/http_request_headers.html (AFTER)
 INFO :       @@ -0,0 +1,12 @@
 INFO :       +{
 INFO :       +  "args": {},
 INFO :       +  "headers": {
 INFO :       +    "Accept": "*/*",
 INFO :       +    "Accept-Encoding": "gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
 INFO :       +    "Host": "httpbin.org",
 INFO :       +    "User-Agent": "Itamae",
 INFO :       +    "X-Amzn-Trace-Id": "Root=1-5fead958-248552aa65b288073c116324"
 INFO :       +  },
 INFO :       +  "origin": "118.240.233.119",
 INFO :       +  "url": "https://httpbin.org/get"
 INFO :       +}
DEBUG :       (in action_get)
before after
image image

Copy link
Member

@unasuke unasuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@unasuke unasuke merged commit 17b8cb0 into itamae-kitchen:master Dec 29, 2020
@unasuke
Copy link
Member

unasuke commented Dec 29, 2020

Released as v1.11.1

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