-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing commits without issue, from tags #19
- Loading branch information
1 parent
700bdfd
commit 22a2c55
Showing
7 changed files
with
150 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
40 changes: 40 additions & 0 deletions
40
src/main/java/se/bjurr/gitchangelog/internal/git/GitRepoDataHelper.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package se.bjurr.gitchangelog.internal.git; | ||
|
||
import static com.google.common.base.Predicates.in; | ||
import static com.google.common.collect.Iterables.filter; | ||
import static com.google.common.collect.Iterables.isEmpty; | ||
import static com.google.common.collect.Lists.newArrayList; | ||
import static com.google.common.collect.Sets.newHashSet; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import se.bjurr.gitchangelog.internal.git.model.GitCommit; | ||
import se.bjurr.gitchangelog.internal.git.model.GitTag; | ||
import se.bjurr.gitchangelog.internal.model.ParsedIssue; | ||
|
||
public class GitRepoDataHelper { | ||
private GitRepoDataHelper() { | ||
} | ||
|
||
public static GitRepoData removeCommitsWithoutIssue(List<ParsedIssue> allParsedIssues, GitRepoData gitRepoData) { | ||
Set<GitCommit> commitsWithIssues = newHashSet(); | ||
for (ParsedIssue parsedIssue : allParsedIssues) { | ||
for (GitCommit gitCommit : parsedIssue.getGitCommits()) { | ||
commitsWithIssues.add(gitCommit); | ||
} | ||
} | ||
List<GitCommit> reducedGitCommits = newArrayList(commitsWithIssues); | ||
|
||
List<GitTag> reducedGitTags = newArrayList(); | ||
for (GitTag gitTag : gitRepoData.getGitTags()) { | ||
Iterable<GitCommit> reducedCommitsInTag = filter(gitTag.getGitCommits(), in(reducedGitCommits)); | ||
if (!isEmpty(reducedCommitsInTag)) { | ||
reducedGitTags.add(new GitTag(gitTag.getName(), newArrayList(reducedCommitsInTag))); | ||
} | ||
} | ||
|
||
return new GitRepoData(reducedGitCommits, reducedGitTags); | ||
} | ||
|
||
} |
This file contains 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
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
...esources/assertions/testThatCommitsWithoutIssueCanBeIgnoredTagsIssuesCommits.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Git Changelog changelog | ||
|
||
Changelog of Git Changelog. | ||
|
||
## JIRA [JIR-1234](http://JIR-1234) JIR-1234 | ||
|
||
### Tomas Bjerre - 2016-02-15 16:30:35 | ||
[cc0fbbd8bc63955](https://server/cc0fbbd8bc63955) | ||
|
||
Adding stuff with a jira JIR-1234 | ||
|
||
## JIRA [JIR-5262](http://JIR-5262) JIR-5262 | ||
|
||
### Tomas Bjerre - 2016-02-15 16:12:02 | ||
[071a14f29020758](https://server/071a14f29020758) | ||
|
||
Adding stuff with a jira | ||
JIR-5262 | ||
|
||
|
||
|
||
------ | ||
|
||
|
||
### Tomas Bjerre - 2016-02-15 16:30:35 | ||
[cc0fbbd8bc63955](https://server/cc0fbbd8bc63955) | ||
|
||
Adding stuff with a jira JIR-1234 | ||
|
||
### Tomas Bjerre - 2016-02-15 16:12:02 | ||
[071a14f29020758](https://server/071a14f29020758) | ||
|
||
Adding stuff with a jira | ||
JIR-5262 |
32 changes: 32 additions & 0 deletions
32
...est/resources/templates/testThatCommitsWithoutIssueCanBeIgnoredTagsIssuesCommits.mustache
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Git Changelog changelog | ||
|
||
Changelog of Git Changelog. | ||
|
||
{{#issues}} | ||
{{#hasLink}} | ||
## {{name}} [{{issue}}]({{link}}) {{title}} | ||
{{/hasLink}} | ||
{{^hasLink}} | ||
## {{name}} {{title}} | ||
{{/hasLink}} | ||
|
||
{{#commits}} | ||
### {{authorName}} - {{commitTime}} | ||
[{{hash}}](https://server/{{hash}}) | ||
|
||
{{{message}}} | ||
|
||
{{/commits}} | ||
{{/issues}} | ||
|
||
|
||
------ | ||
|
||
|
||
{{#commits}} | ||
### {{authorName}} - {{commitTime}} | ||
[{{hash}}](https://server/{{hash}}) | ||
|
||
{{{message}}} | ||
|
||
{{/commits}} |