Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Jan 30, 2020

It's technically possible for commit messages to contain arbitrary non-NUL bytes. Our commit message parser uses a 64 KiB buffer to read lines, and if lines are too long, it will fail. We've seen some cases where commit message lines are much longer due to historical accidents.

Let's raise the maximum buffer size to 1 MiB to accommodate these situations. Let's also make it easier to track problems by returning a more helpful error message if the buffer size is exceeded.

Fixes git-lfs/git-lfs#4005
/cc @woopla as reporter

@bk2204 bk2204 requested a review from a team January 30, 2020 20:31
Copy link

@woopla woopla left a comment

Choose a reason for hiding this comment

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

LGTM, with the small typo to 'buffer' fixed.

It's technically possible for commit messages to contain arbitrary
non-NUL bytes.  Our commit message parser uses a 64 KiB buffer to read
lines, and if lines are too long, it will fail.  We've seen some cases
where commit message lines are much longer due to historical accidents.

Let's raise the maximum buffer size to 1 MiB to accommodate these
situations.  Let's also make it easier to track problems by returning a
more helpful error message if the buffer size is exceeded.
Copy link
Member

@chrisd8088 chrisd8088 left a comment

Choose a reason for hiding this comment

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

LGTM! (Tried to come up with a humorously long message but failed.)

@bk2204 bk2204 merged commit 66ebd5e into master Feb 3, 2020
@bk2204 bk2204 deleted the large-message branch February 3, 2020 17:00
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.

'bufio.Scanner: token too long' when running 'git-lfs migrate import'

5 participants