Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ Run the benchmarks with the command:

* `mvn -P jmh-benchmark -Dbenchmark.run=true test`

The results can be reviewed visiually by pasting the resulting `jmh-report.json` file into the link:https://jmh.morethan.io/[online JMH visualizer].
The results can be reviewed visually by pasting the resulting `jmh-report.json` file into the link:https://jmh.morethan.io/[online JMH visualizer].
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Command builder for generating changelog in the format {@code GitSCM} expects.
*
* <p>
* The output format is that of <code>git-whatchanged</code>, which looks something like this:
* The output format is that of <code>git log --raw</code>, which looks something like this:
*
* <pre>
* commit dadaf808d99c4c23c53476b0c48e25a181016300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ public void abort() {

@Override
public void execute() throws GitException, InterruptedException {
ArgumentListBuilder args = new ArgumentListBuilder(gitExe, "whatchanged", "--no-abbrev", "-M");
ArgumentListBuilder args = new ArgumentListBuilder(gitExe, "log", "--raw", "--no-abbrev", "-M");
if (isAtLeastVersion(1, 8, 3, 0)) {
args.add("--format=" + RAW);
} else {
Expand All @@ -1318,7 +1318,7 @@ public void execute() throws GitException, InterruptedException {
throw new IllegalStateException();
}

// "git whatchanged" std output gives us byte stream of data
// "git log" std output gives us byte stream of data
// Commit messages in that byte stream are UTF-8 encoded.
// We want to decode bytestream to strings using UTF-8 encoding.
try (WriterOutputStream w = new WriterOutputStream(out, StandardCharsets.UTF_8)) {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/jenkinsci/plugins/gitclient/GitClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ void submoduleUpdate(boolean recursive, boolean remoteTracking, String reference
void addNote(String note, String namespace) throws GitException, InterruptedException;

/**
* Given a Revision, show it as if it were an entry from git whatchanged, so that it
* Given a Revision, show it as if it were an entry from git log --raw, so that it
* can be parsed by GitChangeLogParser.
*
* <p>
Expand All @@ -898,14 +898,14 @@ void submoduleUpdate(boolean recursive, boolean remoteTracking, String reference
* behave differently from {@link #changelog()}.
*
* @param r a {@link org.eclipse.jgit.lib.ObjectId} object.
* @return The git whatchanged output, in <code>raw</code> format.
* @return The git log output, in <code>raw</code> format.
* @throws hudson.plugins.git.GitException if underlying git operation fails.
* @throws java.lang.InterruptedException if interrupted.
*/
List<String> showRevision(ObjectId r) throws GitException, InterruptedException;

/**
* Given a Revision, show it as if it were an entry from git whatchanged, so that it
* Given a Revision, show it as if it were an entry from git log --raw, so that it
* can be parsed by GitChangeLogParser.
*
* <p>
Expand All @@ -918,14 +918,14 @@ void submoduleUpdate(boolean recursive, boolean remoteTracking, String reference
*
* @param from a {@link org.eclipse.jgit.lib.ObjectId} object.
* @param to a {@link org.eclipse.jgit.lib.ObjectId} object.
* @return The git whatchanged output, in <code>raw</code> format.
* @return The git log output, in <code>raw</code> format.
* @throws hudson.plugins.git.GitException if underlying git operation fails.
* @throws java.lang.InterruptedException if interrupted.
*/
List<String> showRevision(ObjectId from, ObjectId to) throws GitException, InterruptedException;

/**
* Given a Revision, show it as if it were an entry from git whatchanged, so that it
* Given a Revision, show it as if it were an entry from <code>git log --raw</code>, so that it
* can be parsed by GitChangeLogParser.
*
* <p>
Expand All @@ -943,7 +943,7 @@ void submoduleUpdate(boolean recursive, boolean remoteTracking, String reference
* @param from a {@link org.eclipse.jgit.lib.ObjectId} object.
* @param to a {@link org.eclipse.jgit.lib.ObjectId} object.
* @param useRawOutput a {java.lang.Boolean} object.
* @return The git whatchanged output, in <code>raw</code> format.
* @return The git log output, in <code>raw</code> format.
* @throws hudson.plugins.git.GitException if underlying git operation fails.
* @throws java.lang.InterruptedException if interrupted.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1394,15 +1394,15 @@
this.includes("HEAD");
}
for (RevCommit commit : walk) {
// git whatachanged doesn't show the merge commits unless -m is given
// git log --raw doesn't show the merge commits unless -m is given
if (commit.getParentCount() > 1) {
continue;
}

formatter.format(commit, null, pw, true);
}
} catch (IOException e) {
throw new GitException("Error: jgit whatchanged in " + workspace + " " + e.getMessage(), e);
throw new GitException("Error: jgit log --raw in " + workspace + " " + e.getMessage(), e);

Check warning on line 1405 in src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 1405 is not covered by tests
} finally {
closeResources();
}
Expand Down Expand Up @@ -1444,7 +1444,7 @@
* Commit to format.
* @param parent
* Optional parent commit to produce the diff against. This only matters
* for merge commits, and git-log/git-whatchanged/etc behaves differently with respect to this.
* for merge commits, and git-log behaves differently with respect to this.
*/
@SuppressFBWarnings(
value = "VA_FORMAT_STRING_USES_NEWLINE",
Expand Down
Loading