Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRĂ¼diger Herrmann2015-01-11 15:20:51 +0000
committerMatthias Sohn2015-01-13 10:01:00 +0000
commit3285d2f238993f53d00f5e9f1069a33f3d5ba1a2 (patch)
treedc276d26c29f5bcefe8a693ba54ad57bff86d064
parent7fafd37298c706aee0895451c3d709adca058202 (diff)
downloadjgit-3285d2f238993f53d00f5e9f1069a33f3d5ba1a2.tar.gz
jgit-3285d2f238993f53d00f5e9f1069a33f3d5ba1a2.tar.xz
jgit-3285d2f238993f53d00f5e9f1069a33f3d5ba1a2.zip
[pgm] Prevent commands from writing progress to System.err
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>
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java2
6 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
index 8f051688be..fe2df65541 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java
@@ -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);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
index 8e3ec03c74..186fdd8a22 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
@@ -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())
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
index aa5c90590e..bf454760af 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Gc.java
@@ -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();
}
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
index 42114062b1..4afb6d5f88 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
@@ -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();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index c7c27b4c41..111933790e 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -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)
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
index 2140939839..afa469636c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
@@ -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>();

Back to the top