]> source.dussan.org Git - jgit.git/commitdiff
[pgm] Prevent commands from writing progress to System.err 51/39351/3
authorRüdiger Herrmann <ruediger.herrmann@gmx.de>
Sun, 11 Jan 2015 15:20:51 +0000 (16:20 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 13 Jan 2015 10:01:00 +0000 (11:01 +0100)
Commands which report progress used to write to System.err. This is not
desirable in cases where jgit.pgm is embedded. This change redirects
progress output to the error stream that is configured by the command.

Change-Id: I01fa5e167437e619448ac201fcb1cbf63bad96d7
Signed-off-by: Rüdiger Herrmann <ruediger.herrmann@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java

index 8f051688be436104893bdf7f75626dd23d7a96a0..fe2df65541c0405fab52c33509fa4a8a0140964a 100644 (file)
@@ -199,7 +199,7 @@ class Diff extends TextBuiltin {
                        } else if (newTree == null)
                                newTree = new FileTreeIterator(db);
 
-                       TextProgressMonitor pm = new TextProgressMonitor();
+                       TextProgressMonitor pm = new TextProgressMonitor(errw);
                        pm.setDelayStart(2, TimeUnit.SECONDS);
                        diffFmt.setProgressMonitor(pm);
                        diffFmt.setPathFilter(pathFilter);
index 8e3ec03c744839245198d43a7dc106b368b61935..186fdd8a22058d591432706d54d2e4bbf32136de 100644 (file)
@@ -123,7 +123,7 @@ class Fetch extends AbstractFetchCommand {
                if (thin != null)
                        fetch.setThin(thin.booleanValue());
                if (quiet == null || !quiet.booleanValue())
-                       fetch.setProgressMonitor(new TextProgressMonitor());
+                       fetch.setProgressMonitor(new TextProgressMonitor(errw));
 
                FetchResult result = fetch.call();
                if (result.getTrackingRefUpdates().isEmpty())
index aa5c90590ec4cae50c0fd8fefc2ef7f720894a5b..bf454760afa81dd7a1d5d3d79054e772dbd54d3c 100644 (file)
@@ -56,6 +56,6 @@ class Gc extends TextBuiltin {
        protected void run() throws Exception {
                Git git = Git.wrap(db);
                git.gc().setAggressive(aggressive)
-                               .setProgressMonitor(new TextProgressMonitor()).call();
+                               .setProgressMonitor(new TextProgressMonitor(errw)).call();
        }
 }
index 42114062b1af8ab818ea7d060647ac068945d756..4afb6d5f88f2730ddb56df6e500ec6e7c459e708 100644 (file)
@@ -71,7 +71,7 @@ class IndexPack extends TextBuiltin {
                                ObjectDirectoryPackParser imp = (ObjectDirectoryPackParser) p;
                                imp.setIndexVersion(indexVersion);
                        }
-                       p.parse(new TextProgressMonitor());
+                       p.parse(new TextProgressMonitor(errw));
                        inserter.flush();
                } finally {
                        inserter.release();
index c7c27b4c41de7030eed46aff91ae0a6fe35b73d0..111933790ea0feecea96a89001de2aa40d6fac0d 100644 (file)
@@ -113,7 +113,7 @@ class Push extends TextBuiltin {
                PushCommand push = git.push();
                push.setDryRun(dryRun);
                push.setForce(force);
-               push.setProgressMonitor(new TextProgressMonitor());
+               push.setProgressMonitor(new TextProgressMonitor(errw));
                push.setReceivePack(receivePack);
                push.setRefSpecs(refSpecs);
                if (all)
index 214093983966704bf3bfb5f58338051c008736c6..afa469636cf4f97f02a8d82b05f4c42237947050 100644 (file)
@@ -110,7 +110,7 @@ class RebuildCommitGraph extends TextBuiltin {
        @Argument(index = 1, required = true, metaVar = "metaVar_refs", usage = "usage_logAllPretty")
        File graph;
 
-       private final ProgressMonitor pm = new TextProgressMonitor();
+       private final ProgressMonitor pm = new TextProgressMonitor(errw);
 
        private Map<ObjectId, ObjectId> rewrites = new HashMap<ObjectId, ObjectId>();