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

Certain commit makes barkeep explode #64

Closed
cespare opened this issue Sep 23, 2011 · 7 comments
Closed

Certain commit makes barkeep explode #64

cespare opened this issue Sep 23, 2011 · 7 comments
Labels

Comments

@cespare
Copy link
Contributor

cespare commented Sep 23, 2011

(From Mike)

The commit <barkeep url>/commits/uploader/707533b291bc6871655425746dae75e28fc14717 produces a 500:

undefined method `+' for nil:NilClass
/Users/caleb/Projects/barkeep/lib/git_helper.rb:195:in `block in tag_diff'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:157:in `each'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:157:in `tag_diff'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:122:in `tag_file'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:99:in `block in get_tagged_commit_diffs'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:75:in `map'
/Users/caleb/Projects/barkeep/lib/git_helper.rb:75:in `get_tagged_commit_diffs'
/Users/caleb/Projects/barkeep/app.rb:161:in `block in <class:Barkeep>'
@mstyer
Copy link

mstyer commented Sep 24, 2011

Looks like it happens on the first commit of any repo; also happens on this one:

http://barkeep.sv2/commits/ingestion-testing/cde12e52685dc8fe3d6ca4d9af1f0a9c5ed2446d

which is the first commit in the ingestion-testing repo.

@bkad
Copy link
Contributor

bkad commented Sep 24, 2011

I'll take a look tonight

@bkad
Copy link
Contributor

bkad commented Sep 26, 2011

i've come to the conclusion that i have no business parsing unified diffs.
usually new files are of the chunk form @@ -0 +1,:diff_length @@, but in this commit, it is of the chunk form @@ -0,0 +1 @@, so our diff parser thinks its a removed file instead of a new one and fails.

It's possible it has something to do with this diff being only one line long

@bkad bkad closed this as completed in 8563d4d Sep 27, 2011
@cespare cespare reopened this Sep 27, 2011
@cespare
Copy link
Contributor Author

cespare commented Sep 27, 2011

This did not fix the issue for me. I get a different stack trace, but there's still a 500 from the same file.

cespare added a commit that referenced this issue Sep 27, 2011
@cespare cespare closed this as completed Sep 27, 2011
@bkad
Copy link
Contributor

bkad commented Sep 28, 2011

1461d6d fixes the exception, but causes the diff to lose information.

the (second) cause of the bug is trailing newlines in diffs getting eaten by String.split("\n"). The fix is to pass a negative max splits argument to .split.

@bkad
Copy link
Contributor

bkad commented Sep 28, 2011

fixed in fb46059

@cespare
Copy link
Contributor Author

cespare commented Sep 28, 2011

Cool, LGTM.

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

No branches or pull requests

3 participants