Skip to content

Conversation

@nubs
Copy link
Contributor

@nubs nubs commented Jul 21, 2015

This tool should be able to build release notes even for a repository that has no prior releases. One problem with such a repository is that we go back to the very first commit in the repository when viewing the history (by design). This commit has no parents (it should be fairly unique in this regard).

This code was expecting there to always be a parent commit and was causing an underflow exception when trying to access the first vertex in the set of parent vertices. A simple check on isEmpty lets us handle this case. It's not an error case, but we do need to stop iterating (there is no new current to walk to). The last commit (or first commit depending on your POV) will still get included it the list of "first parents" since it may include important changes and should be represented by the release notes.

nubs added 2 commits July 21, 2015 17:21
This tool should be able to build release notes even for a repository
that has no prior releases.  One problem with such a repository is that
we go back to the very first commit in the repository when viewing the
history (by design).  This commit has no parents (it should be fairly
unique in this regard).

This code was expecting there to always be a parent commit and was
causing an underflow exception when trying to access the first vertex in
the set of parent vertices.  A simple check on `isEmpty` lets us handle
this case.  It's not an error case, but we do need to stop iterating
(there is no new `current` to walk to).  The last commit (or first
commit depending on your POV) will still get included it the list of
"first parents" since it may include important changes and should be
represented by the release notes.
guywithnose pushed a commit that referenced this pull request Jul 21, 2015
Don't die on the first commit to a repository.
@guywithnose guywithnose merged commit 9e0fc76 into guywithnose:master Jul 21, 2015
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