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

dont put newlines in refs json output #1571

Merged
merged 1 commit into from
Aug 14, 2015
Merged

dont put newlines in refs json output #1571

merged 1 commit into from
Aug 14, 2015

Conversation

whyrusleeping
Copy link
Member

fixes the newline issue from #1477

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@jbenet jbenet added the status/in-progress In progress label Aug 13, 2015
@@ -135,7 +135,7 @@ Note: list all refs recursively with -r.
return nil, errors.New(obj.Err)
}

return strings.NewReader(obj.Ref), nil
Copy link
Member

Choose a reason for hiding this comment

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

why no newlines? https://en.wikipedia.org/wiki/Line_Delimited_JSON (i think we do want them)

Copy link
Member Author

Choose a reason for hiding this comment

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

there are newlines, just not in the string inside the object. As far as delimiting the json output, that doesnt happen here. We would have to make the change inside the commands/http lib. I can do that in this PR if you like.

Copy link
Member

Choose a reason for hiding this comment

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

ah. not sure what this means then. what's the output diff?

Copy link
Member Author

Choose a reason for hiding this comment

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

basically, instead of putting the newline in the strings we were printing out (as seen in the root comment here: #1477), we print the newlines in the output marshaller. So the output looks exactly the same, and the json objects dont have weird newlines embedded in them.

Copy link
Member

Choose a reason for hiding this comment

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

ahhh got it. 👍

jbenet added a commit that referenced this pull request Aug 14, 2015
dont put newlines in refs json output
@jbenet jbenet merged commit c1380f1 into master Aug 14, 2015
@jbenet jbenet removed the status/in-progress In progress label Aug 14, 2015
@jbenet jbenet deleted the fix/refs-json branch August 14, 2015 02:08
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.

None yet

2 participants