Community
Participate
Working Groups
Used implementation for ProgressMonitor to test the monitoring: import org.eclipse.jgit.lib.ProgressMonitor; public class MyProgressMonitor implements ProgressMonitor { String currentTaskTitle; @Override public void start(int totalTasks) { System.out.println("Total tasks: " + totalTasks); } @Override public void beginTask(String title, int totalWork) { currentTaskTitle = title; System.out.println("Task started: " + title + " with total work: " + totalWork); } @Override public void update(int completed) { } @Override public void endTask() { System.out.println("Task ended: " + currentTaskTitle); } @Override public boolean isCancelled() { return false; } } Git clone log: Total tasks: 2 Task started: remote: Enumerating objects with total work: 0 Task started: remote: Counting objects with total work: 56 Task started: remote: Compressing objects with total work: 46 Task started: Receiving objects with total work: 56 Task ended: Receiving objects Task started: Resolving deltas with total work: 1 Task ended: Resolving deltas Task started: Checking out files with total work: 23 Task ended: Checking out files In short, 2 tasks reported as total from method 'start', while 6 reported from method 'beginTask' and 3 from method 'endTask'
Tested the same implementation of ProgressMonitor for git fetch. Here is the log: Total tasks: 2 Task started: remote: Enumerating objects with total work: 0 Task started: remote: Counting objects with total work: 5 Task started: remote: Compressing objects with total work: 2 Task started: Receiving objects with total work: 3 Task ended: Receiving objects Task started: Updating references with total work: 1 Task ended: Updating references In short, 2 tasks reported as total from method 'start', while 4 reported from method 'beginTask' and 2 from method 'endTask'
Yes, that's known. Which doesn't mean it shouldn't be fixed, of course. :-) Compare EGit's EclipseGitProgressTransformer, which bridges the JGit ProgressMonitor to Eclipse's IProgressMonitor, and see the Gerrit comments at [1]. [1] https://git.eclipse.org/r/c/egit/egit/+/88434/2/org.eclipse.egit.core/src/org/eclipse/egit/core/EclipseGitProgressTransformer.java#24