Skip to content

Commit

Permalink
Traversing commit tree by parents #23
Browse files Browse the repository at this point in the history
 * To find all commits in all tags.
  • Loading branch information
tomasbjerre committed Apr 9, 2016
1 parent c5db80f commit 24d97de
Show file tree
Hide file tree
Showing 14 changed files with 389 additions and 189 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sudo: false
language: java
env:
- secure: "f78upMWhPViLh2W9jLjkjikZgSJCd9LuJVZF227JFSLGV8+DC0YbHQi6pYmpejhTT9H1OTqXyQ5c16QEQzutx6O63iyWdvWtIHtuct66jWPUp1NL3EAlK9F4NdG/9sbdEcElgrQxEArjYB5w+UZ+1uJucc1oMqIWbWQ089tvdx1VYZYRdP3pdLOoqgAqi4/GOxj8vRO9lIY7kc9IhEDDAfzNrGV8/LKao9f1pEOI+XcVDMOovRcstkMJZ5kqAep7xZTURGScKE6dMm58IEPDQAfbbGxAaJTO1HiNhFt6u2n+Z/oXZS8zlD/mcTA2acE6Ip7AMplSrac3bkzhwULwVu1PeDhteS9cwhpwJ/B3dR5sDAA+U/4WkfDV5VyyWVn8Z7Jy5nzDyUrtZBiPCzUyKDEaKc0mlLjWJjGiboq3ACnn62CE+VWQz9J0vnjxrwwqLcZbAtPzbFn3myYNbrf2qHt7n9eL3l9c9mkzYCfC6hz1oqsa35cimL6NXzjbRPu8ruyZdDcOdPBlVcdQ/g8ZhTslo5SCi4yukGQ0NbdPF0bJ4JXmBT49KUGbPOrCqdzoe+or04uJ6KkbLsO+bSGtVcidMuUeeylhfUBMtZs8XBKB2o3WWpZKjCUlKDl/vfDmlP7G+1Bd6lR11F1Z5jmtPLBzKlURrAMPVSk4EwFLNeQ="
jdk:
- oraclejdk8
- oraclejdk7
Expand All @@ -12,7 +14,7 @@ before_script:
- git pull
- git log --graph --full-history --all --color --date=short --pretty=format:"%Cred%x09%h %Creset%ad%Cgreen%d %Creset %s %C(bold)(%an)%Creset"
script:
- ./gradlew build --stacktrace -i
- ./gradlew build -DGITHUB_OAUTH2TOKEN=$GITHUB_OAUTH2TOKEN --stacktrace -i
after_script:
- find -name TEST* -exec cat {} \;
notifications:
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Changelog of Git Changelog.

## Next release
## 1.40
### GitHub [#23](https://github.com/tomasbjerre/git-changelog-lib/issues/23) changelog is generating incorrect order of commits/Issues

**Adding feature to ignore tags by regexp**

* Also testing tag in feature branch

[19aa174570e2d5e](https://github.com/tomasbjerre/git-changelog-lib/commit/19aa174570e2d5e) Tomas Bjerre *2016-04-06 20:34:01*
[8166ec7dfd456df](https://github.com/tomasbjerre/git-changelog-lib/commit/8166ec7dfd456df) Tomas Bjerre *2016-04-06 20:39:27*


### Other changes
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/se/bjurr/gitchangelog/api/GitChangelogApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ public void toMediaWiki(String username, String password, String url, String tit
* @throws GitChangelogRepositoryException
*/
public Changelog getChangelog() throws GitChangelogRepositoryException {
return getChangelog(new GitRepo(new File(settings.getFromRepo())));
try (GitRepo gitRepo = new GitRepo(new File(settings.getFromRepo()))) {
return getChangelog(gitRepo);
} catch (IOException e) {
throw new GitChangelogRepositoryException("", e);
}
}

/**
Expand All @@ -368,7 +372,7 @@ public String render() throws GitChangelogRepositoryException {
new Object[] { this.getChangelog(), settings.getExtendedVariables() } //
).flush();
return writer.toString();
} catch (IOException e) {
} catch (Exception e) {
// Should be impossible!
throw propagate(e);
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/se/bjurr/gitchangelog/api/model/Commit.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Commit(String authorName, String authorEmailAddress, String commitTime, L
this.message = checkNotNull(message, "message").trim();
this.commitTime = checkNotNull(commitTime, "commitTime");
this.commitTimeLong = checkNotNull(commitTimeLong, "commitTimeLong");
this.hash = checkNotNull(hash, "hash");
this.hash = toHash(checkNotNull(hash, "hash"));
}

public String getHash() {
Expand Down Expand Up @@ -119,4 +119,8 @@ static private List<String> toNoEmptyStringsList(String message) {
public String toString() {
return "hash: " + hash + " message: " + message;
}

private static String toHash(String input) {
return input.substring(0, 15);
}
}
Loading

0 comments on commit 24d97de

Please # to comment.