Repository navigation
Conversation
This comment was marked as spam.
This comment was marked as spam.
tidy-dev
approved these changes
Nov 4, 2024
niik
deleted the
combined-output-tailstream-based-on-remove-spawnandcomplete
branch
November 5, 2024 10:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #[issue number]
Description
I'm working on multiple fronts to improve GitHub Desktop's handling of large Git output. One problem we're contending with (believe it or not) is the maximum string length in v8 which used to be 256Mb and which I believe is now 512Mb but don't quote me on that.
To avoid marshalling output to strings when we don't have to (diffs for example) we're now using buffer encoding in a few select locations but the combinedOutput is still a string and would negate all optimisations by always ensuring that we create a string totalling stderr + stdout's length.
The sole purpose of combinedOutput is to be able to provide "terminal-like" output to the user (see #9945) so we really don't need more than the tail-end of a long output (that's where the error will be).
As such, this PR introduces a new stream which only retains the last 256kb of output piped through it, ensuring that we can deliver a good experience to users encountering errors while simultaneously ensuring that we don't end up stringifying every commands output unnecessarily.
Screenshots
Release notes
Notes: