You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2014/11/03 11:43:35 UTC

[1/8] git commit: MATH-1144 New interface for allowing caller to validate (i.e. modify) the set of parameters generated by the optimizer.

Repository: commons-math
Updated Branches:
  refs/heads/master 45ae5c7e4 -> 7df65a5dd


MATH-1144
New interface for allowing caller to validate (i.e. modify) the
set of parameters generated by the optimizer.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/f820d06f
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/f820d06f
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/f820d06f

Branch: refs/heads/master
Commit: f820d06fc0d1204b0cb386214ffeb42ccec669ec
Parents: cee04d1
Author: Gilles <er...@apache.org>
Authored: Mon Oct 13 19:39:27 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Mon Oct 13 19:39:27 2014 +0200

----------------------------------------------------------------------
 .../leastsquares/ParameterValidator.java        | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/f820d06f/src/main/java/org/apache/commons/math3/fitting/leastsquares/ParameterValidator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/ParameterValidator.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/ParameterValidator.java
new file mode 100644
index 0000000..d5b8529
--- /dev/null
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/ParameterValidator.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.math3.fitting.leastsquares;
+
+import org.apache.commons.math3.linear.RealVector;
+
+/**
+ * Interface for validating a set of model parameters.
+ *
+ * @since 3.4
+ */
+public interface ParameterValidator {
+    /**
+     * Validates the set of parameters.
+     *
+     * @param params Input parameters.
+     * @return the validated values.
+     */
+    RealVector validate(RealVector params);
+}


[2/8] git commit: MATH-1144 Allow caller to modify the set of parameters generated by the optimizer.

Posted by er...@apache.org.
MATH-1144
Allow caller to modify the set of parameters generated by the optimizer.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/321fd029
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/321fd029
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/321fd029

Branch: refs/heads/master
Commit: 321fd029ec5c9c3c9717f1ede0add49d8a709a01
Parents: f820d06
Author: Gilles <er...@apache.org>
Authored: Mon Oct 13 19:43:26 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Mon Oct 13 19:43:26 2014 +0200

----------------------------------------------------------------------
 .../leastsquares/LeastSquaresBuilder.java       | 46 ++++++++++++++++-
 .../leastsquares/LeastSquaresFactory.java       | 54 ++++++++++++++------
 .../leastsquares/ValueAndJacobianFunction.java  |  2 +-
 .../fitting/leastsquares/EvaluationTest.java    |  8 +--
 .../LevenbergMarquardtOptimizerTest.java        | 42 +++++++++++++++
 5 files changed, 129 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/321fd029/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresBuilder.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresBuilder.java
index 7d3ccbb..7b14b37 100644
--- a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresBuilder.java
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresBuilder.java
@@ -47,6 +47,17 @@ public class LeastSquaresBuilder {
     private RealVector start;
     /** weight matrix */
     private RealMatrix weight;
+    /**
+     * Lazy evaluation.
+     *
+     * @since 3.4
+     */
+    private boolean lazyEvaluation;
+    /** Validator.
+     *
+     * @since 3.4
+     */
+    private ParameterValidator paramValidator;
 
 
     /**
@@ -55,7 +66,15 @@ public class LeastSquaresBuilder {
      * @return a new {@link LeastSquaresProblem}.
      */
     public LeastSquaresProblem build() {
-        return LeastSquaresFactory.create(model, target, start, weight, checker, maxEvaluations, maxIterations);
+        return LeastSquaresFactory.create(model,
+                                          target,
+                                          start,
+                                          weight,
+                                          checker,
+                                          maxEvaluations,
+                                          maxIterations,
+                                          lazyEvaluation,
+                                          paramValidator);
     }
 
     /**
@@ -179,4 +198,29 @@ public class LeastSquaresBuilder {
         return this;
     }
 
+    /**
+     * Configure whether evaluation will be lazy or not.
+     *
+     * @param newValue Whether to perform lazy evaluation.
+     * @return this object.
+     *
+     * @since 3.4
+     */
+    public LeastSquaresBuilder lazyEvaluation(final boolean newValue) {
+        lazyEvaluation = newValue;
+        return this;
+    }
+
+    /**
+     * Configure the validator of the model parameters.
+     *
+     * @param newValidator Parameter validator.
+     * @return this object.
+     *
+     * @since 3.4
+     */
+    public LeastSquaresBuilder parameterValidator(final ParameterValidator newValidator) {
+        paramValidator = newValidator;
+        return this;
+    }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/321fd029/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresFactory.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresFactory.java
index 917acfc..1a92ac9 100644
--- a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresFactory.java
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LeastSquaresFactory.java
@@ -56,22 +56,33 @@ public class LeastSquaresFactory {
      * @param maxIterations  the maximum number to times to iterate in the algorithm
      * @param lazyEvaluation Whether the call to {@link Evaluation#evaluate(RealVector)}
      * will defer the evaluation until access to the value is requested.
+     * @param paramValidator Model parameters validator.
      * @return the specified General Least Squares problem.
+     *
+     * @since 3.4
      */
     public static LeastSquaresProblem create(final MultivariateJacobianFunction model,
                                              final RealVector observed,
                                              final RealVector start,
+                                             final RealMatrix weight,
                                              final ConvergenceChecker<Evaluation> checker,
                                              final int maxEvaluations,
                                              final int maxIterations,
-                                             final boolean lazyEvaluation) {
-        return new LocalLeastSquaresProblem(model,
-                                            observed,
-                                            start,
-                                            checker,
-                                            maxEvaluations,
-                                            maxIterations,
-                                            lazyEvaluation);
+                                             final boolean lazyEvaluation,
+                                             final ParameterValidator paramValidator) {
+        final LeastSquaresProblem p = new LocalLeastSquaresProblem(model,
+                                                                   observed,
+                                                                   start,
+                                                                   checker,
+                                                                   maxEvaluations, 
+                                                                   maxIterations,
+                                                                   lazyEvaluation,
+                                                                   paramValidator);
+        if (weight != null) {
+            return weightMatrix(p, weight);
+        } else {
+            return p;
+        }
     }
 
     /**
@@ -92,13 +103,15 @@ public class LeastSquaresFactory {
                                              final ConvergenceChecker<Evaluation> checker,
                                              final int maxEvaluations,
                                              final int maxIterations) {
-        return new LocalLeastSquaresProblem(model,
-                                            observed,
-                                            start,
-                                            checker,
-                                            maxEvaluations,
-                                            maxIterations,
-                                            false);
+        return create(model,
+                      observed,
+                      start,
+                      null,
+                      checker,
+                      maxEvaluations,
+                      maxIterations,
+                      false,
+                      null);
     }
 
     /**
@@ -345,6 +358,8 @@ public class LeastSquaresFactory {
         private final RealVector start;
         /** Whether to use lazy evaluation. */
         private final boolean lazyEvaluation;
+        /** Model parameters validator. */
+        private final ParameterValidator paramValidator;
 
         /**
          * Create a {@link LeastSquaresProblem} from the given data.
@@ -357,6 +372,7 @@ public class LeastSquaresFactory {
          * @param maxIterations  the allowed iterations
          * @param lazyEvaluation Whether the call to {@link Evaluation#evaluate(RealVector)}
          * will defer the evaluation until access to the value is requested.
+         * @param paramValidator Model parameters validator.
          */
         LocalLeastSquaresProblem(final MultivariateJacobianFunction model,
                                  final RealVector target,
@@ -364,12 +380,14 @@ public class LeastSquaresFactory {
                                  final ConvergenceChecker<Evaluation> checker,
                                  final int maxEvaluations,
                                  final int maxIterations,
-                                 boolean lazyEvaluation) {
+                                 final boolean lazyEvaluation,
+                                 final ParameterValidator paramValidator) {
             super(maxEvaluations, maxIterations, checker);
             this.target = target;
             this.model = model;
             this.start = start;
             this.lazyEvaluation = lazyEvaluation;
+            this.paramValidator = paramValidator;
 
             if (lazyEvaluation &&
                 !(model instanceof ValueAndJacobianFunction)) {
@@ -398,7 +416,9 @@ public class LeastSquaresFactory {
         /** {@inheritDoc} */
         public Evaluation evaluate(final RealVector point) {
             // Copy so optimizer can change point without changing our instance.
-            final RealVector p = point.copy();
+            final RealVector p = paramValidator == null ?
+                point.copy() :
+                paramValidator.validate(point.copy());
 
             if (lazyEvaluation) {
                 return new LazyUnweightedEvaluation((ValueAndJacobianFunction) model,

http://git-wip-us.apache.org/repos/asf/commons-math/blob/321fd029/src/main/java/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.java
index 39e7ae4..180e328 100644
--- a/src/main/java/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.java
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/ValueAndJacobianFunction.java
@@ -23,7 +23,7 @@ import org.apache.commons.math3.linear.RealVector;
  * A interface for functions that compute a vector of values and can compute their
  * derivatives (Jacobian).
  *
- * @since 3.3
+ * @since 3.4
  */
 public interface ValueAndJacobianFunction extends MultivariateJacobianFunction {
     /**

http://git-wip-us.apache.org/repos/asf/commons-math/blob/321fd029/src/test/java/org/apache/commons/math3/fitting/leastsquares/EvaluationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/EvaluationTest.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/EvaluationTest.java
index 9cfbe0b..a53b3f7 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/EvaluationTest.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/EvaluationTest.java
@@ -226,7 +226,7 @@ public class EvaluationTest {
 
         final LeastSquaresProblem p
             = LeastSquaresFactory.create(LeastSquaresFactory.model(dummyModel(), dummyJacobian()),
-                                         dummy, dummy, null, 0, 0, true);
+                                         dummy, dummy, null, null, 0, 0, true, null);
 
         // Should not throw because actual evaluation is deferred.
         final Evaluation eval = p.evaluate(dummy);
@@ -263,7 +263,7 @@ public class EvaluationTest {
 
         try {
             // Should throw.
-            LeastSquaresFactory.create(m1, dummy, dummy, null, 0, 0, true);
+            LeastSquaresFactory.create(m1, dummy, dummy, null, null, 0, 0, true, null);
             Assert.fail("Expecting MathIllegalStateException");
         } catch (MathIllegalStateException e) {
             // Expected.
@@ -282,7 +282,7 @@ public class EvaluationTest {
             };
 
         // Should pass.
-        LeastSquaresFactory.create(m2, dummy, dummy, null, 0, 0, true);
+        LeastSquaresFactory.create(m2, dummy, dummy, null, null, 0, 0, true, null);
     }
 
     @Test
@@ -291,7 +291,7 @@ public class EvaluationTest {
 
         final LeastSquaresProblem p
             = LeastSquaresFactory.create(LeastSquaresFactory.model(dummyModel(), dummyJacobian()),
-                                         dummy, dummy, null, 0, 0, false);
+                                         dummy, dummy, null, null, 0, 0, false, null);
 
         try {
             // Should throw.

http://git-wip-us.apache.org/repos/asf/commons-math/blob/321fd029/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
index b2c8f54..46658db 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
@@ -268,6 +268,48 @@ public class LevenbergMarquardtOptimizerTest
     }
 
     @Test
+    public void testParameterValidator() {
+        // Setup.
+        final double xCenter = 123.456;
+        final double yCenter = 654.321;
+        final double xSigma = 10;
+        final double ySigma = 15;
+        final double radius = 111.111;
+        final long seed = 3456789L;
+        final RandomCirclePointGenerator factory
+            = new RandomCirclePointGenerator(xCenter, yCenter, radius,
+                                             xSigma, ySigma,
+                                             seed);
+        final CircleProblem circle = new CircleProblem(xSigma, ySigma);
+
+        final int numPoints = 10;
+        for (Vector2D p : factory.generate(numPoints)) {
+            circle.addPoint(p.getX(), p.getY());
+        }
+
+        // First guess for the center's coordinates and radius.
+        final double[] init = { 90, 659, 115 };
+        final Optimum optimum
+            = optimizer.optimize(builder(circle).maxIterations(50).start(init).build());
+        final int numEval = optimum.getEvaluations();
+        Assert.assertTrue(numEval > 1);
+
+        // Build a new problem with an validator that amounts to cheating.
+        final ParameterValidator cheatValidator
+            = new ParameterValidator() {
+                    public RealVector validate(RealVector params) {
+                        // Cheat: return the optimum found previously.
+                        return optimum.getPoint();
+                    }
+                };
+
+        final Optimum cheatOptimum
+            = optimizer.optimize(builder(circle).maxIterations(50).start(init).parameterValidator(cheatValidator).build());
+        final int cheatNumEval = cheatOptimum.getEvaluations();
+        Assert.assertTrue(cheatNumEval < numEval);
+    }
+
+    @Test
     public void testEvaluationCount() {
         //setup
         LeastSquaresProblem lsp = new LinearProblem(new double[][] {{1}}, new double[] {1})


[4/8] git commit: MATH-1144 Point must be retrieved after the call to "evaluate" (to ensure that the validated parameters are actually used by the optimizer).

Posted by er...@apache.org.
MATH-1144
Point must be retrieved after the call to "evaluate" (to ensure that
the validated parameters are actually used by the optimizer).


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/566c4d59
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/566c4d59
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/566c4d59

Branch: refs/heads/master
Commit: 566c4d59a177be4b65d17540576eeb34d28d24ce
Parents: 4c5cda2
Author: Gilles <er...@apache.org>
Authored: Wed Oct 15 22:14:46 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Wed Oct 15 22:14:46 2014 +0200

----------------------------------------------------------------------
 .../fitting/leastsquares/GaussNewtonOptimizer.java    |  1 +
 .../leastsquares/LevenbergMarquardtOptimizer.java     | 14 +++++++-------
 .../leastsquares/LevenbergMarquardtOptimizerTest.java |  1 +
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/566c4d59/src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
index 6ee88f6..bc4503c 100644
--- a/src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/GaussNewtonOptimizer.java
@@ -230,6 +230,7 @@ public class GaussNewtonOptimizer implements LeastSquaresOptimizer {
             current = lsp.evaluate(currentPoint);
             final RealVector currentResiduals = current.getResiduals();
             final RealMatrix weightedJacobian = current.getJacobian();
+            currentPoint = current.getPoint();
 
             // Check convergence.
             if (previous != null) {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/566c4d59/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
index dac53d2..358d240 100644
--- a/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizer.java
@@ -294,16 +294,14 @@ public class LevenbergMarquardtOptimizer implements LeastSquaresOptimizer {
 
     /** {@inheritDoc} */
     public Optimum optimize(final LeastSquaresProblem problem) {
-        //pull in relevant data from the problem as locals
+        // Pull in relevant data from the problem as locals.
         final int nR = problem.getObservationSize(); // Number of observed data.
         final int nC = problem.getParameterSize(); // Number of parameters.
-        final double[] currentPoint = problem.getStart().toArray();
-        //counters
+        // Counters.
         final Incrementor iterationCounter = problem.getIterationCounter();
         final Incrementor evaluationCounter = problem.getEvaluationCounter();
-        //convergence criterion
-        final ConvergenceChecker<Evaluation> checker
-                = problem.getConvergenceChecker();
+        // Convergence criterion.
+        final ConvergenceChecker<Evaluation> checker = problem.getConvergenceChecker();
 
         // arrays shared with the other private methods
         final int solvedCols  = FastMath.min(nR, nC);
@@ -327,9 +325,10 @@ public class LevenbergMarquardtOptimizer implements LeastSquaresOptimizer {
         // Evaluate the function at the starting point and calculate its norm.
         evaluationCounter.incrementCount();
         //value will be reassigned in the loop
-        Evaluation current = problem.evaluate(new ArrayRealVector(currentPoint));
+        Evaluation current = problem.evaluate(problem.getStart());
         double[] currentResiduals = current.getResiduals().toArray();
         double currentCost = current.getCost();
+        double[] currentPoint = current.getPoint().toArray();
 
         // Outer loop.
         boolean firstIteration = true;
@@ -447,6 +446,7 @@ public class LevenbergMarquardtOptimizer implements LeastSquaresOptimizer {
                 current = problem.evaluate(new ArrayRealVector(currentPoint));
                 currentResiduals = current.getResiduals().toArray();
                 currentCost = current.getCost();
+                currentPoint = current.getPoint().toArray();
 
                 // compute the scaled actual reduction
                 double actRed = -1.0;

http://git-wip-us.apache.org/repos/asf/commons-math/blob/566c4d59/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
index b6373d4..c6910ff 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
@@ -307,6 +307,7 @@ public class LevenbergMarquardtOptimizerTest
             = optimizer.optimize(builder(circle).maxIterations(50).start(init).parameterValidator(cheatValidator).build());
         final int cheatNumEval = cheatOptimum.getEvaluations();
         Assert.assertTrue(cheatNumEval < numEval);
+        System.out.println("n=" + numEval + " nc=" + cheatNumEval);
     }
 
     @Test


[3/8] git commit: Typo.

Posted by er...@apache.org.
Typo.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4c5cda21
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4c5cda21
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4c5cda21

Branch: refs/heads/master
Commit: 4c5cda210eecd7f82c4ce88e3092dbcd13db5b48
Parents: 321fd02
Author: Gilles <er...@apache.org>
Authored: Wed Oct 15 14:48:11 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Wed Oct 15 14:48:11 2014 +0200

----------------------------------------------------------------------
 .../fitting/leastsquares/LevenbergMarquardtOptimizerTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/4c5cda21/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
index 46658db..b6373d4 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
@@ -294,7 +294,7 @@ public class LevenbergMarquardtOptimizerTest
         final int numEval = optimum.getEvaluations();
         Assert.assertTrue(numEval > 1);
 
-        // Build a new problem with an validator that amounts to cheating.
+        // Build a new problem with a validator that amounts to cheating.
         final ParameterValidator cheatValidator
             = new ParameterValidator() {
                     public RealVector validate(RealVector params) {


Re: [6/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math

Posted by Gilles <gi...@harfang.homelinux.org>.
Hello.

On Mon, 3 Nov 2014 11:56:44 +0100, Dennis Hendriks wrote:
> Hi all,
>
> The mail below seems to suggest a bunch of files were changed,

The message looks indeed misleading. I did not touch those files;
"git" did, in order to update my local copy.
[Cf. the post which I've just sent to the list.]

Regards,
Gilles

> but
> how from this e-mail can I get a link to the actual diff of this
> commit? I tried the 'Diff' link below (to
> http://git-wip-us.apache.org/repos/asf/commons-math/diff/29b19362),
> but it gives me a page with some metadate (dates/times/etc), and the
> text 'Trivial merge', but no actual diff of any kind. The other links
> don't lead to pages with actual diffs either...
>
> Best,
> Dennis
>
>
>
> On 11/03/2014 11:43 AM, erans@apache.org wrote:
>> Merge branch 'master' of 
>> https://git-wip-us.apache.org/repos/asf/commons-math
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>> Commit: 
>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/29b19362
>> Tree: 
>> http://git-wip-us.apache.org/repos/asf/commons-math/tree/29b19362
>> Diff: 
>> http://git-wip-us.apache.org/repos/asf/commons-math/diff/29b19362
>>
>> Branch: refs/heads/master
>> Commit: 29b193629150c9a38949a6afa5b620cdb4d7f6a6
>> Parents: a516976 e89a80d
>> Author: Gilles <er...@apache.org>
>> Authored: Mon Oct 20 23:20:09 2014 +0200
>> Committer: Gilles <er...@apache.org>
>> Committed: Mon Oct 20 23:20:09 2014 +0200
>>
>> 
>> ----------------------------------------------------------------------
>>   pom.xml                                         |  12 +-
>>   src/changes/changes.xml                         |  12 +
>>   .../interpolation/AkimaSplineInterpolator.java  | 225 ++++++
>>   .../BicubicSplineInterpolatingFunction.java     | 620 
>> +++------------
>>   .../BicubicSplineInterpolator.java              | 141 +---
>>   .../TricubicSplineInterpolator.java             |  35 +-
>>   .../exception/MathIllegalStateException.java    |   5 +-
>>   .../math3/exception/util/LocalizedFormats.java  |   1 +
>>   .../ode/nonstiff/RungeKuttaIntegrator.java      |  14 +-
>>   .../math3/stat/descriptive/rank/Percentile.java |   2 +-
>>   .../math3/stat/inference/BinomialTest.java      |   3 +-
>>   .../math3/stat/inference/ChiSquareTest.java     |  14 +-
>>   .../commons/math3/stat/inference/GTest.java     |  18 +-
>>   .../math3/stat/inference/MannWhitneyUTest.java  |   3 +-
>>   .../math3/stat/inference/OneWayAnova.java       |   8 +-
>>   .../commons/math3/stat/inference/TTest.java     |  11 +-
>>   .../stat/inference/WilcoxonSignedRankTest.java  |   3 +-
>>   .../org/apache/commons/math3/util/FastMath.java | 334 +++++++++
>>   .../apache/commons/math3/util/KthSelector.java  |   2 +-
>>   .../util/LocalizedFormats_fr.properties         |   1 +
>>   src/site/site.xml                               |   2 +-
>>   src/site/xdoc/developers.xml                    |  26 +-
>>   src/site/xdoc/index.xml                         |   7 +-
>>   .../AkimaSplineInterpolatorTest.java            | 227 ++++++
>>   .../BicubicSplineInterpolatingFunctionTest.java | 746 
>> +++++--------------
>>   .../BicubicSplineInterpolatorTest.java          | 217 ++++--
>>   ...PolynomialBicubicSplineInterpolatorTest.java |  10 +-
>>   .../interpolation/SplineInterpolatorTest.java   |  42 +-
>>   .../TricubicSplineInterpolatorTest.java         |   2 +-
>>   .../AbstractIntegerDistributionTest.java        |  21 +-
>>   .../exception/util/LocalizedFormatsTest.java    |   3 +-
>>   .../leastsquares/EvaluationRmsCheckerTest.java  |   2 +-
>>   .../ClassicalRungeKuttaIntegratorTest.java      |  24 +
>>   .../util/FastMathStrictComparisonTest.java      |  22 +-
>>   .../apache/commons/math3/util/FastMathTest.java | 429 ++++++++++-
>>   35 files changed, 1841 insertions(+), 1403 deletions(-)
>> 
>> ----------------------------------------------------------------------
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [6/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math

Posted by Dennis Hendriks <D....@tue.nl>.
Hi all,

The mail below seems to suggest a bunch of files were changed, but how from 
this e-mail can I get a link to the actual diff of this commit? I tried the 
'Diff' link below (to 
http://git-wip-us.apache.org/repos/asf/commons-math/diff/29b19362), but it 
gives me a page with some metadate (dates/times/etc), and the text 'Trivial 
merge', but no actual diff of any kind. The other links don't lead to pages 
with actual diffs either...

Best,
Dennis



On 11/03/2014 11:43 AM, erans@apache.org wrote:
> Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math
>
>
> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
> Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/29b19362
> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/29b19362
> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/29b19362
>
> Branch: refs/heads/master
> Commit: 29b193629150c9a38949a6afa5b620cdb4d7f6a6
> Parents: a516976 e89a80d
> Author: Gilles <er...@apache.org>
> Authored: Mon Oct 20 23:20:09 2014 +0200
> Committer: Gilles <er...@apache.org>
> Committed: Mon Oct 20 23:20:09 2014 +0200
>
> ----------------------------------------------------------------------
>   pom.xml                                         |  12 +-
>   src/changes/changes.xml                         |  12 +
>   .../interpolation/AkimaSplineInterpolator.java  | 225 ++++++
>   .../BicubicSplineInterpolatingFunction.java     | 620 +++------------
>   .../BicubicSplineInterpolator.java              | 141 +---
>   .../TricubicSplineInterpolator.java             |  35 +-
>   .../exception/MathIllegalStateException.java    |   5 +-
>   .../math3/exception/util/LocalizedFormats.java  |   1 +
>   .../ode/nonstiff/RungeKuttaIntegrator.java      |  14 +-
>   .../math3/stat/descriptive/rank/Percentile.java |   2 +-
>   .../math3/stat/inference/BinomialTest.java      |   3 +-
>   .../math3/stat/inference/ChiSquareTest.java     |  14 +-
>   .../commons/math3/stat/inference/GTest.java     |  18 +-
>   .../math3/stat/inference/MannWhitneyUTest.java  |   3 +-
>   .../math3/stat/inference/OneWayAnova.java       |   8 +-
>   .../commons/math3/stat/inference/TTest.java     |  11 +-
>   .../stat/inference/WilcoxonSignedRankTest.java  |   3 +-
>   .../org/apache/commons/math3/util/FastMath.java | 334 +++++++++
>   .../apache/commons/math3/util/KthSelector.java  |   2 +-
>   .../util/LocalizedFormats_fr.properties         |   1 +
>   src/site/site.xml                               |   2 +-
>   src/site/xdoc/developers.xml                    |  26 +-
>   src/site/xdoc/index.xml                         |   7 +-
>   .../AkimaSplineInterpolatorTest.java            | 227 ++++++
>   .../BicubicSplineInterpolatingFunctionTest.java | 746 +++++--------------
>   .../BicubicSplineInterpolatorTest.java          | 217 ++++--
>   ...PolynomialBicubicSplineInterpolatorTest.java |  10 +-
>   .../interpolation/SplineInterpolatorTest.java   |  42 +-
>   .../TricubicSplineInterpolatorTest.java         |   2 +-
>   .../AbstractIntegerDistributionTest.java        |  21 +-
>   .../exception/util/LocalizedFormatsTest.java    |   3 +-
>   .../leastsquares/EvaluationRmsCheckerTest.java  |   2 +-
>   .../ClassicalRungeKuttaIntegratorTest.java      |  24 +
>   .../util/FastMathStrictComparisonTest.java      |  22 +-
>   .../apache/commons/math3/util/FastMathTest.java | 429 ++++++++++-
>   35 files changed, 1841 insertions(+), 1403 deletions(-)
> ----------------------------------------------------------------------
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[6/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math

Posted by er...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/29b19362
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/29b19362
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/29b19362

Branch: refs/heads/master
Commit: 29b193629150c9a38949a6afa5b620cdb4d7f6a6
Parents: a516976 e89a80d
Author: Gilles <er...@apache.org>
Authored: Mon Oct 20 23:20:09 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Mon Oct 20 23:20:09 2014 +0200

----------------------------------------------------------------------
 pom.xml                                         |  12 +-
 src/changes/changes.xml                         |  12 +
 .../interpolation/AkimaSplineInterpolator.java  | 225 ++++++
 .../BicubicSplineInterpolatingFunction.java     | 620 +++------------
 .../BicubicSplineInterpolator.java              | 141 +---
 .../TricubicSplineInterpolator.java             |  35 +-
 .../exception/MathIllegalStateException.java    |   5 +-
 .../math3/exception/util/LocalizedFormats.java  |   1 +
 .../ode/nonstiff/RungeKuttaIntegrator.java      |  14 +-
 .../math3/stat/descriptive/rank/Percentile.java |   2 +-
 .../math3/stat/inference/BinomialTest.java      |   3 +-
 .../math3/stat/inference/ChiSquareTest.java     |  14 +-
 .../commons/math3/stat/inference/GTest.java     |  18 +-
 .../math3/stat/inference/MannWhitneyUTest.java  |   3 +-
 .../math3/stat/inference/OneWayAnova.java       |   8 +-
 .../commons/math3/stat/inference/TTest.java     |  11 +-
 .../stat/inference/WilcoxonSignedRankTest.java  |   3 +-
 .../org/apache/commons/math3/util/FastMath.java | 334 +++++++++
 .../apache/commons/math3/util/KthSelector.java  |   2 +-
 .../util/LocalizedFormats_fr.properties         |   1 +
 src/site/site.xml                               |   2 +-
 src/site/xdoc/developers.xml                    |  26 +-
 src/site/xdoc/index.xml                         |   7 +-
 .../AkimaSplineInterpolatorTest.java            | 227 ++++++
 .../BicubicSplineInterpolatingFunctionTest.java | 746 +++++--------------
 .../BicubicSplineInterpolatorTest.java          | 217 ++++--
 ...PolynomialBicubicSplineInterpolatorTest.java |  10 +-
 .../interpolation/SplineInterpolatorTest.java   |  42 +-
 .../TricubicSplineInterpolatorTest.java         |   2 +-
 .../AbstractIntegerDistributionTest.java        |  21 +-
 .../exception/util/LocalizedFormatsTest.java    |   3 +-
 .../leastsquares/EvaluationRmsCheckerTest.java  |   2 +-
 .../ClassicalRungeKuttaIntegratorTest.java      |  24 +
 .../util/FastMathStrictComparisonTest.java      |  22 +-
 .../apache/commons/math3/util/FastMathTest.java | 429 ++++++++++-
 35 files changed, 1841 insertions(+), 1403 deletions(-)
----------------------------------------------------------------------



[7/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math

Posted by er...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/4a6bf542
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/4a6bf542
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/4a6bf542

Branch: refs/heads/master
Commit: 4a6bf542e1929503f354d0afccc76e19d1cae177
Parents: 29b1936 79ae77f
Author: Gilles <er...@apache.org>
Authored: Tue Oct 21 10:32:41 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Tue Oct 21 10:32:41 2014 +0200

----------------------------------------------------------------------
 .../BicubicSplineInterpolatingFunction.java     | 624 +++++++++++++---
 .../BicubicSplineInterpolator.java              | 146 +++-
 ...ewiseBicubicSplineInterpolatingFunction.java | 195 +++++
 .../PiecewiseBicubicSplineInterpolator.java     |  64 ++
 ...hingPolynomialBicubicSplineInterpolator.java |   4 +-
 .../TricubicSplineInterpolator.java             |  35 +-
 .../BicubicSplineInterpolatingFunctionTest.java | 746 ++++++++++++++-----
 .../BicubicSplineInterpolatorTest.java          | 217 ++----
 ...eBicubicSplineInterpolatingFunctionTest.java | 280 +++++++
 .../PiecewiseBicubicSplineInterpolatorTest.java | 277 +++++++
 .../TricubicSplineInterpolatorTest.java         |   2 +-
 11 files changed, 2144 insertions(+), 446 deletions(-)
----------------------------------------------------------------------



[5/8] git commit: Debug output commented out.

Posted by er...@apache.org.
Debug output commented out.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/a5169769
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/a5169769
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/a5169769

Branch: refs/heads/master
Commit: a516976947341e0e18bcc0858d85d34cd0c02cdb
Parents: 566c4d5
Author: Gilles <er...@apache.org>
Authored: Wed Oct 15 22:22:43 2014 +0200
Committer: Gilles <er...@apache.org>
Committed: Wed Oct 15 22:22:43 2014 +0200

----------------------------------------------------------------------
 .../fitting/leastsquares/LevenbergMarquardtOptimizerTest.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/a5169769/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
index c6910ff..7dff7a9 100644
--- a/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math3/fitting/leastsquares/LevenbergMarquardtOptimizerTest.java
@@ -307,7 +307,7 @@ public class LevenbergMarquardtOptimizerTest
             = optimizer.optimize(builder(circle).maxIterations(50).start(init).parameterValidator(cheatValidator).build());
         final int cheatNumEval = cheatOptimum.getEvaluations();
         Assert.assertTrue(cheatNumEval < numEval);
-        System.out.println("n=" + numEval + " nc=" + cheatNumEval);
+        // System.out.println("n=" + numEval + " nc=" + cheatNumEval);
     }
 
     @Test


Re: [Math] Filtering message from git?

Posted by Gilles <gi...@harfang.homelinux.org>.
Hi.

On Tue, 04 Nov 2014 15:27:49 +0100, luc wrote:
> Hi Gilles,
>
> Le 2014-11-04 14:05, Gilles a écrit :
>> Hello.
>> On Mon, 03 Nov 2014 21:25:10 +0100, Luc Maisonobe wrote:
>>> Le 03/11/2014 20:57, Luc Maisonobe a écrit :
>>>> Le 03/11/2014 12:09, Gilles a écrit :
>>>>> Hi.
>>>> Hi Gilles,
>>>>
>>>>> Three posts such as the following were sent to this ML:
>>>>>
>>>>>> Merge branch 'master' of
>>>>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>>>>>
>>>>>> Project: 
>>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>>>>> Commit:
>>>>>> 
>>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
>>>>>> Tree: 
>>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
>>>>>> Diff: 
>>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>>>>>> Branch: refs/heads/master
>>>>>> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>>>>> Parents: 4a6bf54 45ae5c7
>>>>>> Author: Gilles <er...@apache.org>
>>>>>> Authored: Sun Nov 2 23:22:11 2014 +0100
>>>>>> Committer: Gilles <er...@apache.org>
>>>>>> Committed: Sun Nov 2 23:22:11 2014 +0100
>>>>>>
>>>>>>
>>>>>> 
>>>>>> ----------------------------------------------------------------------
>>>>>>  src/changes/changes.xml                         |  3 +
>>>>>>  .../math3/ode/ContinuousOutputModel.java        | 71
>>>>>> ++++++++++++++++++--
>>>>>>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>>>>>>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>>>>>>  4 files changed, 105 insertions(+), 18 deletions(-)
>>>>>>
>>>>>> 
>>>>>> ----------------------------------------------------------------------
>>>>> They seem like a report on what happened on my local repository 
>>>>> so
>>>>> that I could commit local changes after the main repository had 
>>>>> been
>>>>> updated.
>>>>> This kind of message looks utterly useless and distracts from 
>>>>> those
>>>>> that report actual changes to the main repository.
>>>>> Don't you think that they should be filtered out?
>>>> I'm not sure.
>>>>
>>>>> If not, can you explain their purpose?
>>>> I think this is due to the very strict handling of history by Git. 
>>>> Each
>>>> commit is completely linked with its parent and the commit hash 
>>>> takes
>>>> this link into account. In other words, the commit does not depend 
>>>> only
>>>> on what it contains but also on what point in the history it is 
>>>> applied to.
>>>> A side effect is that if the main repository history is:
>>>> A -> B -> C -> D
>>>> and at this point you clone it and start working on a local 
>>>> change, your
>>>> local history will be as follows:
>>>> A -> B -> C -> D
>>>>                  |
>>>>                  -> G1 -> G2 -> G3
>>>> Then, someone else pushes other modifications on the main 
>>>> repository,
>>>> which still only has D as its head, so the main repository history 
>>>> becomes:
>>>> A -> B -> C -> D -> E -> F
>>>> On your local clone, you merge these changes and get:
>>>> A -> B -> C -> D -> E -> F---------
>>>>                  |                  |
>>>>                  -> G1 -> G2 -> G3 --> G4
>>>> where G4 is a merge.
>>>> This can occur several time.
>>>> When you finally push your work back to the repository, it pushes 
>>>> the
>>>> full history of your current head to become the new head. So you 
>>>> will
>>>> see G1, G2, G3 (and this is really what you want, as it means you 
>>>> can do
>>>> small incremental changes without losing anything), but it will 
>>>> also see
>>>> some merge about thing you did not do yourself.
>> Thanks for the detailed description. I could vaguely imagine 
>> something
>> of the like, and that "git" must of course keep track of all the 
>> history.
>> However the issue was more about avoiding confusion that could (and 
>> did)
>> arise from a message reporting a "trivial" local change that nobody
>> cares about but "git").
>>
>>> For the record, there is a way to completely avoid this merge, by
>>> replacing the branch with a new one "replaying" the commits G1, G2 
>>> ...
>>> on top of F instead of their original start commit which was D. 
>>> This is
>>> done using "git rebase". After a rebase, G1 parent becomes F and 
>>> the
>>> merge is done in a simpler linear way, this is what Git calls a
>>> "fast-forward" merge. However, I would not recommend using rebase,
>>> especially to someone not already accustomed to Git.
>> Why?
>> At first sight, from the perspective of the other contributors, 
>> shouldn't
>> it be done that way.
>
> Yes, it could, but rebase may be dangerous and create really
> confusing history.
> The main problem I did encounter with rebase, when I started using
> Git without
> fully understanding the consequence of my commands, is that once 
> something
> has been pushed to a remote repository, you should not rebase it
> later on locally
> and push again. Rebase is good as long as it is done only on one
> repository, just
> before pushing it remotely. Rebase does what Git calls "history
> rewriting" and
> if this can be safe on a completely controlled and local environment, 
> it is a
> source of big problems if done on an history line that has already
> been shared.
>
>> Shouldn't we define workflow guidelines that would help avoid 
>> confusion?
>
> This would be nice.

The example below, I actually meant as belonging to that document to be 
created
in the "doc" directory of the code repository.
I did not really need the information right here right now. ;-)
[I have some comment, perhaps to clarify the proposed document.]

>
>> You could perhaps list the sequence of git commands that are most 
>> suitable
>> in each scenario that corresponds to basic usage in the context of 
>> CM.
>> One of them would be the situation described above (e.g. a 
>> contributor
>> works on a feature while the "origin" is evolving). So:
>> 1. Update the local copy
>> 2a. Create a branch (?)

This should certainly be explained, e.g. if it's best to create one 
branch for
each feature, or one branch (a bug fix) that depends on another (design 
change
needed to fix the issue, but independent of it).

>> 2b. Change local files
>> 3. View the changes
>> 4. "Add" (stage?) files
>
> This is done using "git add <filename>"
>
>> 5. Commit files (locally)
>> 6. View the changes in the committed files (not as obvious as point 
>> 3!)
>> 7. Keep the local repository in sync with origin
>> 8. "rebase" (?)
>
> This would be perfect up to this point, and if everything is clean 
> there,
> the next steps would be :
>
> 8b. merge the branch back to the local master branch

Example of explicit command, e.g. based on the 2-branch scenario above.

> 8c. push the new updated local master branch to the reference Apache
> repository
>
>
>> 9a. How to locally "uncommit" (?) files?
>
> Just remove them and commit the removal (this commit and the 
> preceding
> ones can be collapsed in the following step).

Wouldn't that create yet another layer of insignificant changes: Rather
than have "nothing" in the history, we'd have a log of
1. File creation
2. File removal
for a file that would have never existed on the reference repository.

>
>> 9b. How to change the commit log?
>
> When you merge the development branch back to the master branch, you 
> can use
> the flag --edit to change the commit log, and you can use the flag
> --squash to combine
> everything into a single change.

Ah, that's very important, in order to limit the flow of automatic
posts to this ML.

> If you want to pick up several commits one by one, and ignore a few
> of them along the
> branch history, then instead of a merge you can use git cherry-pick
> to select exactly
> the parts of the changes you want to include in the master branch.

How to be sure that nothing would be missing from the reference
repository (e.g. local changes make it possible to compile locally,
but will fail remotely)?

Is it possible to create another "view" (a branch?) of the local 
repository
with only the "cherry-picked" selection?

>> 9c. How to "unstage" (?) files?
>
> Before the commit, this is done using "git reset HEAD <filename>". If
> the file
> has already been committed, you should "git rm" and commit the 
> removel.

Does this keep local changes?

While "git checkout -- <file>" would wipe out any trace of changes?

>
>> 10a. How to see/select what will be "push"ed?
>
> What is pushed is simply the commit themselves. You can review them
> with "git log" and
> its numerous options.

I had mentioned that it was not obvious because "git diff" shows the 
diff
before the files are committed, but afterwards, you have to add the 
name
of the reference (branch?).


So, will you set up a "git CM mini-howto"? :-)

Thanks,
Gilles


>> 10b. Commit ("push") to the main repository
>>
>>>
>>>> Here, commit 7df65 is a merge commit. It does not really include 
>>>> any
>>>> change, but only records the fact the current point in history has 
>>>> two
>>>> parents as it is the result of merging (here without any conflict)
>>>> commits 4a6bf54 (which was also a previous merge in your local 
>>>> history)
>>>> and 45ae5c7 (which was the head of main repository). If you follow 
>>>> the
>>>> link "Diff" from the message, you will see this commit is labeled 
>>>> as
>>>> "trivial merge" without any modified files associated.
>>>> Perhaps you could ask INFRA
>> With my currently limited knowledge of "git", I won't dare enter in 
>> a
>> discussion where I might not understand some of the answers or 
>> requests
>> for further information... [E.g. Is the problem there, or BKAC?]
>
> The more I think about it, the more I think the behavior is 
> intentional,
> as it is not straightforward to get the full list of files from 
> previous
> commits. It is not a bad thing IMHO as the merge is a good place to 
> summarize
> all the changes done on the parents.
>
> best regards,
> Luc
>
>>
>> Best regards,
>> Gilles
>>
>>>> why the message from merge commit 7df65 does
>>>> contain the list of files modified by one of its parent commit 
>>>> (here
>>>> 45ae5c7) instead of an empty list as there was no conflict between 
>>>> the
>>>> merge. If I run "git show --format=fuller 7df65" to have an 
>>>> extensive
>>>> description of the commit, I only get:
>>>> commit 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>>> Merge: 4a6bf54 45ae5c7
>>>> Author:     Gilles <er...@apache.org>
>>>> AuthorDate: Sun Nov 2 23:22:11 2014 +0100
>>>> Commit:     Gilles <er...@apache.org>
>>>> CommitDate: Sun Nov 2 23:22:11 2014 +0100
>>>> Merge branch 'master' of
>>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>>> Also looking at the list of files changed, it seems it includes 
>>>> files
>>>> from several commits in the branches, not only the last changed 
>>>> files:
>>>> commit 45ae5c7 only changed ContinuousOutputModel.java and not
>>>> StepInterpolator.java which was changed by an earlier commit in 
>>>> the
>>>> history. So I really don't know how the files list is created and 
>>>> put
>>>> into the message. Perhaps INFRA knows.
>>>> best regards,
>>>> Luc
>>>>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Filtering message from git?

Posted by luc <lu...@spaceroots.org>.
Hi Gilles,

Le 2014-11-04 14:05, Gilles a écrit :
> Hello.
> 
> On Mon, 03 Nov 2014 21:25:10 +0100, Luc Maisonobe wrote:
>> Le 03/11/2014 20:57, Luc Maisonobe a écrit :
>>> Le 03/11/2014 12:09, Gilles a écrit :
>>>> Hi.
>>> 
>>> Hi Gilles,
>>> 
>>>> 
>>>> Three posts such as the following were sent to this ML:
>>>> 
>>>>> Merge branch 'master' of
>>>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>>>> 
>>>>> 
>>>>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>>>> Commit:
>>>>> 
>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
>>>>> Tree: 
>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
>>>>> Diff: 
>>>>> http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>>>>> 
>>>>> Branch: refs/heads/master
>>>>> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>>>> Parents: 4a6bf54 45ae5c7
>>>>> Author: Gilles <er...@apache.org>
>>>>> Authored: Sun Nov 2 23:22:11 2014 +0100
>>>>> Committer: Gilles <er...@apache.org>
>>>>> Committed: Sun Nov 2 23:22:11 2014 +0100
>>>>> 
>>>>> 
>>>>> 
>>>>> ----------------------------------------------------------------------
>>>>>  src/changes/changes.xml                         |  3 +
>>>>>  .../math3/ode/ContinuousOutputModel.java        | 71
>>>>> ++++++++++++++++++--
>>>>>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>>>>>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>>>>>  4 files changed, 105 insertions(+), 18 deletions(-)
>>>>> 
>>>>> 
>>>>> ----------------------------------------------------------------------
>>>> 
>>>> They seem like a report on what happened on my local repository so
>>>> that I could commit local changes after the main repository had been
>>>> updated.
>>>> This kind of message looks utterly useless and distracts from those
>>>> that report actual changes to the main repository.
>>>> 
>>>> Don't you think that they should be filtered out?
>>> 
>>> I'm not sure.
>>> 
>>>> If not, can you explain their purpose?
>>> 
>>> I think this is due to the very strict handling of history by Git. 
>>> Each
>>> commit is completely linked with its parent and the commit hash takes
>>> this link into account. In other words, the commit does not depend 
>>> only
>>> on what it contains but also on what point in the history it is 
>>> applied to.
>>> 
>>> A side effect is that if the main repository history is:
>>> 
>>>   A -> B -> C -> D
>>> 
>>> and at this point you clone it and start working on a local change, 
>>> your
>>> local history will be as follows:
>>> 
>>>   A -> B -> C -> D
>>>                  |
>>>                  -> G1 -> G2 -> G3
>>> 
>>> Then, someone else pushes other modifications on the main repository,
>>> which still only has D as its head, so the main repository history 
>>> becomes:
>>> 
>>>   A -> B -> C -> D -> E -> F
>>> 
>>> On your local clone, you merge these changes and get:
>>> 
>>>   A -> B -> C -> D -> E -> F---------
>>>                  |                  |
>>>                  -> G1 -> G2 -> G3 --> G4
>>> 
>>> where G4 is a merge.
>>> 
>>> This can occur several time.
>>> 
>>> When you finally push your work back to the repository, it pushes the
>>> full history of your current head to become the new head. So you will
>>> see G1, G2, G3 (and this is really what you want, as it means you can 
>>> do
>>> small incremental changes without losing anything), but it will also 
>>> see
>>> some merge about thing you did not do yourself.
> 
> Thanks for the detailed description. I could vaguely imagine something
> of the like, and that "git" must of course keep track of all the 
> history.
> 
> However the issue was more about avoiding confusion that could (and 
> did)
> arise from a message reporting a "trivial" local change that nobody
> cares about but "git").
> 
>> For the record, there is a way to completely avoid this merge, by
>> replacing the branch with a new one "replaying" the commits G1, G2 ...
>> on top of F instead of their original start commit which was D. This 
>> is
>> done using "git rebase". After a rebase, G1 parent becomes F and the
>> merge is done in a simpler linear way, this is what Git calls a
>> "fast-forward" merge. However, I would not recommend using rebase,
>> especially to someone not already accustomed to Git.
> 
> Why?
> At first sight, from the perspective of the other contributors, 
> shouldn't
> it be done that way.

Yes, it could, but rebase may be dangerous and create really confusing 
history.
The main problem I did encounter with rebase, when I started using Git 
without
fully understanding the consequence of my commands, is that once 
something
has been pushed to a remote repository, you should not rebase it later 
on locally
and push again. Rebase is good as long as it is done only on one 
repository, just
before pushing it remotely. Rebase does what Git calls "history 
rewriting" and
if this can be safe on a completely controlled and local environment, it 
is a
source of big problems if done on an history line that has already been 
shared.

> 
> Shouldn't we define workflow guidelines that would help avoid 
> confusion?

This would be nice.

> 
> You could perhaps list the sequence of git commands that are most 
> suitable
> in each scenario that corresponds to basic usage in the context of CM.
> One of them would be the situation described above (e.g. a contributor
> works on a feature while the "origin" is evolving). So:
> 1. Update the local copy
> 2a. Create a branch (?)
> 2b. Change local files
> 3. View the changes
> 4. "Add" (stage?) files

This is done using "git add <filename>"

> 5. Commit files (locally)
> 6. View the changes in the committed files (not as obvious as point 3!)
> 7. Keep the local repository in sync with origin
> 8. "rebase" (?)

This would be perfect up to this point, and if everything is clean 
there,
the next steps would be :

8b. merge the branch back to the local master branch
8c. push the new updated local master branch to the reference Apache 
repository


> 9a. How to locally "uncommit" (?) files?

Just remove them and commit the removal (this commit and the preceding
ones can be collapsed in the following step).

> 9b. How to change the commit log?

When you merge the development branch back to the master branch, you can 
use
the flag --edit to change the commit log, and you can use the flag 
--squash to combine
everything into a single change.

If you want to pick up several commits one by one, and ignore a few of 
them along the
branch history, then instead of a merge you can use git cherry-pick to 
select exactly
the parts of the changes you want to include in the master branch.

> 9c. How to "unstage" (?) files?

Before the commit, this is done using "git reset HEAD <filename>". If 
the file
has already been committed, you should "git rm" and commit the removel.

> 10a. How to see/select what will be "push"ed?

What is pushed is simply the commit themselves. You can review them with 
"git log" and
its numerous options.

> 10b. Commit ("push") to the main repository
> 
>> 
>>> 
>>> Here, commit 7df65 is a merge commit. It does not really include any
>>> change, but only records the fact the current point in history has 
>>> two
>>> parents as it is the result of merging (here without any conflict)
>>> commits 4a6bf54 (which was also a previous merge in your local 
>>> history)
>>> and 45ae5c7 (which was the head of main repository). If you follow 
>>> the
>>> link "Diff" from the message, you will see this commit is labeled as
>>> "trivial merge" without any modified files associated.
>>> 
>>> Perhaps you could ask INFRA
> 
> With my currently limited knowledge of "git", I won't dare enter in a
> discussion where I might not understand some of the answers or requests
> for further information... [E.g. Is the problem there, or BKAC?]

The more I think about it, the more I think the behavior is intentional,
as it is not straightforward to get the full list of files from previous
commits. It is not a bad thing IMHO as the merge is a good place to 
summarize
all the changes done on the parents.

best regards,
Luc

> 
> 
> Best regards,
> Gilles
> 
>>> why the message from merge commit 7df65 does
>>> contain the list of files modified by one of its parent commit (here
>>> 45ae5c7) instead of an empty list as there was no conflict between 
>>> the
>>> merge. If I run "git show --format=fuller 7df65" to have an extensive
>>> description of the commit, I only get:
>>> 
>>> commit 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>> Merge: 4a6bf54 45ae5c7
>>> Author:     Gilles <er...@apache.org>
>>> AuthorDate: Sun Nov 2 23:22:11 2014 +0100
>>> Commit:     Gilles <er...@apache.org>
>>> CommitDate: Sun Nov 2 23:22:11 2014 +0100
>>> 
>>>     Merge branch 'master' of
>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>> 
>>> Also looking at the list of files changed, it seems it includes files
>>> from several commits in the branches, not only the last changed 
>>> files:
>>> commit 45ae5c7 only changed ContinuousOutputModel.java and not
>>> StepInterpolator.java which was changed by an earlier commit in the
>>> history. So I really don't know how the files list is created and put
>>> into the message. Perhaps INFRA knows.
>>> 
>>> best regards,
>>> Luc
>>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Filtering message from git?

Posted by Gilles <gi...@harfang.homelinux.org>.
Hello.

On Mon, 03 Nov 2014 21:25:10 +0100, Luc Maisonobe wrote:
> Le 03/11/2014 20:57, Luc Maisonobe a écrit :
>> Le 03/11/2014 12:09, Gilles a écrit :
>>> Hi.
>>
>> Hi Gilles,
>>
>>>
>>> Three posts such as the following were sent to this ML:
>>>
>>>> Merge branch 'master' of
>>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>>>
>>>>
>>>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>>> Commit:
>>>> 
>>>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
>>>> Tree: 
>>>> http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
>>>> Diff: 
>>>> http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>>>>
>>>> Branch: refs/heads/master
>>>> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>>> Parents: 4a6bf54 45ae5c7
>>>> Author: Gilles <er...@apache.org>
>>>> Authored: Sun Nov 2 23:22:11 2014 +0100
>>>> Committer: Gilles <er...@apache.org>
>>>> Committed: Sun Nov 2 23:22:11 2014 +0100
>>>>
>>>>
>>>> 
>>>> ----------------------------------------------------------------------
>>>>  src/changes/changes.xml                         |  3 +
>>>>  .../math3/ode/ContinuousOutputModel.java        | 71
>>>> ++++++++++++++++++--
>>>>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>>>>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>>>>  4 files changed, 105 insertions(+), 18 deletions(-)
>>>>
>>>> 
>>>> ----------------------------------------------------------------------
>>>
>>> They seem like a report on what happened on my local repository so
>>> that I could commit local changes after the main repository had 
>>> been
>>> updated.
>>> This kind of message looks utterly useless and distracts from those
>>> that report actual changes to the main repository.
>>>
>>> Don't you think that they should be filtered out?
>>
>> I'm not sure.
>>
>>> If not, can you explain their purpose?
>>
>> I think this is due to the very strict handling of history by Git. 
>> Each
>> commit is completely linked with its parent and the commit hash 
>> takes
>> this link into account. In other words, the commit does not depend 
>> only
>> on what it contains but also on what point in the history it is 
>> applied to.
>>
>> A side effect is that if the main repository history is:
>>
>>   A -> B -> C -> D
>>
>> and at this point you clone it and start working on a local change, 
>> your
>> local history will be as follows:
>>
>>   A -> B -> C -> D
>>                  |
>>                  -> G1 -> G2 -> G3
>>
>> Then, someone else pushes other modifications on the main 
>> repository,
>> which still only has D as its head, so the main repository history 
>> becomes:
>>
>>   A -> B -> C -> D -> E -> F
>>
>> On your local clone, you merge these changes and get:
>>
>>   A -> B -> C -> D -> E -> F---------
>>                  |                  |
>>                  -> G1 -> G2 -> G3 --> G4
>>
>> where G4 is a merge.
>>
>> This can occur several time.
>>
>> When you finally push your work back to the repository, it pushes 
>> the
>> full history of your current head to become the new head. So you 
>> will
>> see G1, G2, G3 (and this is really what you want, as it means you 
>> can do
>> small incremental changes without losing anything), but it will also 
>> see
>> some merge about thing you did not do yourself.

Thanks for the detailed description. I could vaguely imagine something
of the like, and that "git" must of course keep track of all the 
history.

However the issue was more about avoiding confusion that could (and 
did)
arise from a message reporting a "trivial" local change that nobody
cares about but "git").

> For the record, there is a way to completely avoid this merge, by
> replacing the branch with a new one "replaying" the commits G1, G2 
> ...
> on top of F instead of their original start commit which was D. This 
> is
> done using "git rebase". After a rebase, G1 parent becomes F and the
> merge is done in a simpler linear way, this is what Git calls a
> "fast-forward" merge. However, I would not recommend using rebase,
> especially to someone not already accustomed to Git.

Why?
At first sight, from the perspective of the other contributors, 
shouldn't
it be done that way.

Shouldn't we define workflow guidelines that would help avoid 
confusion?

You could perhaps list the sequence of git commands that are most 
suitable
in each scenario that corresponds to basic usage in the context of CM.
One of them would be the situation described above (e.g. a contributor
works on a feature while the "origin" is evolving). So:
1. Update the local copy
2a. Create a branch (?)
2b. Change local files
3. View the changes
4. "Add" (stage?) files
5. Commit files (locally)
6. View the changes in the committed files (not as obvious as point 3!)
7. Keep the local repository in sync with origin
8. "rebase" (?)
9a. How to locally "uncommit" (?) files?
9b. How to change the commit log?
9c. How to "unstage" (?) files?
10a. How to see/select what will be "push"ed?
10b. Commit ("push") to the main repository

>
>>
>> Here, commit 7df65 is a merge commit. It does not really include any
>> change, but only records the fact the current point in history has 
>> two
>> parents as it is the result of merging (here without any conflict)
>> commits 4a6bf54 (which was also a previous merge in your local 
>> history)
>> and 45ae5c7 (which was the head of main repository). If you follow 
>> the
>> link "Diff" from the message, you will see this commit is labeled as
>> "trivial merge" without any modified files associated.
>>
>> Perhaps you could ask INFRA

With my currently limited knowledge of "git", I won't dare enter in a
discussion where I might not understand some of the answers or requests
for further information... [E.g. Is the problem there, or BKAC?]


Best regards,
Gilles

>> why the message from merge commit 7df65 does
>> contain the list of files modified by one of its parent commit (here
>> 45ae5c7) instead of an empty list as there was no conflict between 
>> the
>> merge. If I run "git show --format=fuller 7df65" to have an 
>> extensive
>> description of the commit, I only get:
>>
>> commit 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>> Merge: 4a6bf54 45ae5c7
>> Author:     Gilles <er...@apache.org>
>> AuthorDate: Sun Nov 2 23:22:11 2014 +0100
>> Commit:     Gilles <er...@apache.org>
>> CommitDate: Sun Nov 2 23:22:11 2014 +0100
>>
>>     Merge branch 'master' of
>> https://git-wip-us.apache.org/repos/asf/commons-math
>>
>> Also looking at the list of files changed, it seems it includes 
>> files
>> from several commits in the branches, not only the last changed 
>> files:
>> commit 45ae5c7 only changed ContinuousOutputModel.java and not
>> StepInterpolator.java which was changed by an earlier commit in the
>> history. So I really don't know how the files list is created and 
>> put
>> into the message. Perhaps INFRA knows.
>>
>> best regards,
>> Luc
>>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Filtering message from git? (Was: [8/8] git commit: Merge branch 'master' [...])

Posted by Luc Maisonobe <lu...@spaceroots.org>.
Le 03/11/2014 20:57, Luc Maisonobe a écrit :
> Le 03/11/2014 12:09, Gilles a écrit :
>> Hi.
> 
> Hi Gilles,
> 
>>
>> Three posts such as the following were sent to this ML:
>>
>>> Merge branch 'master' of
>>> https://git-wip-us.apache.org/repos/asf/commons-math
>>>
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>>> Commit:
>>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
>>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
>>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>>>
>>> Branch: refs/heads/master
>>> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>>> Parents: 4a6bf54 45ae5c7
>>> Author: Gilles <er...@apache.org>
>>> Authored: Sun Nov 2 23:22:11 2014 +0100
>>> Committer: Gilles <er...@apache.org>
>>> Committed: Sun Nov 2 23:22:11 2014 +0100
>>>
>>>
>>> ----------------------------------------------------------------------
>>>  src/changes/changes.xml                         |  3 +
>>>  .../math3/ode/ContinuousOutputModel.java        | 71
>>> ++++++++++++++++++--
>>>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>>>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>>>  4 files changed, 105 insertions(+), 18 deletions(-)
>>>
>>> ----------------------------------------------------------------------
>>
>> They seem like a report on what happened on my local repository so
>> that I could commit local changes after the main repository had been
>> updated.
>> This kind of message looks utterly useless and distracts from those
>> that report actual changes to the main repository.
>>
>> Don't you think that they should be filtered out?
> 
> I'm not sure.
> 
>> If not, can you explain their purpose?
> 
> I think this is due to the very strict handling of history by Git. Each
> commit is completely linked with its parent and the commit hash takes
> this link into account. In other words, the commit does not depend only
> on what it contains but also on what point in the history it is applied to.
> 
> A side effect is that if the main repository history is:
> 
>   A -> B -> C -> D
> 
> and at this point you clone it and start working on a local change, your
> local history will be as follows:
> 
>   A -> B -> C -> D
>                  |
>                  -> G1 -> G2 -> G3
> 
> Then, someone else pushes other modifications on the main repository,
> which still only has D as its head, so the main repository history becomes:
> 
>   A -> B -> C -> D -> E -> F
> 
> On your local clone, you merge these changes and get:
> 
>   A -> B -> C -> D -> E -> F---------
>                  |                  |
>                  -> G1 -> G2 -> G3 --> G4
> 
> where G4 is a merge.
> 
> This can occur several time.
> 
> When you finally push your work back to the repository, it pushes the
> full history of your current head to become the new head. So you will
> see G1, G2, G3 (and this is really what you want, as it means you can do
> small incremental changes without losing anything), but it will also see
> some merge about thing you did not do yourself.

For the record, there is a way to completely avoid this merge, by
replacing the branch with a new one "replaying" the commits G1, G2 ...
on top of F instead of their original start commit which was D. This is
done using "git rebase". After a rebase, G1 parent becomes F and the
merge is done in a simpler linear way, this is what Git calls a
"fast-forward" merge. However, I would not recommend using rebase,
especially to someone not already accustomed to Git.

best regards,
Luc

> 
> Here, commit 7df65 is a merge commit. It does not really include any
> change, but only records the fact the current point in history has two
> parents as it is the result of merging (here without any conflict)
> commits 4a6bf54 (which was also a previous merge in your local history)
> and 45ae5c7 (which was the head of main repository). If you follow the
> link "Diff" from the message, you will see this commit is labeled as
> "trivial merge" without any modified files associated.
> 
> Perhaps you could ask INFRA why the message from merge commit 7df65 does
> contain the list of files modified by one of its parent commit (here
> 45ae5c7) instead of an empty list as there was no conflict between the
> merge. If I run "git show --format=fuller 7df65" to have an extensive
> description of the commit, I only get:
> 
> commit 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
> Merge: 4a6bf54 45ae5c7
> Author:     Gilles <er...@apache.org>
> AuthorDate: Sun Nov 2 23:22:11 2014 +0100
> Commit:     Gilles <er...@apache.org>
> CommitDate: Sun Nov 2 23:22:11 2014 +0100
> 
>     Merge branch 'master' of
> https://git-wip-us.apache.org/repos/asf/commons-math
> 
> Also looking at the list of files changed, it seems it includes files
> from several commits in the branches, not only the last changed files:
> commit 45ae5c7 only changed ContinuousOutputModel.java and not
> StepInterpolator.java which was changed by an earlier commit in the
> history. So I really don't know how the files list is created and put
> into the message. Perhaps INFRA knows.
> 
> best regards,
> Luc
> 
>>
>> Regards,
>> Gilles
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Filtering message from git? (Was: [8/8] git commit: Merge branch 'master' [...])

Posted by Luc Maisonobe <lu...@spaceroots.org>.
Le 03/11/2014 12:09, Gilles a écrit :
> Hi.

Hi Gilles,

> 
> Three posts such as the following were sent to this ML:
> 
>> Merge branch 'master' of
>> https://git-wip-us.apache.org/repos/asf/commons-math
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>> Commit:
>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>>
>> Branch: refs/heads/master
>> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
>> Parents: 4a6bf54 45ae5c7
>> Author: Gilles <er...@apache.org>
>> Authored: Sun Nov 2 23:22:11 2014 +0100
>> Committer: Gilles <er...@apache.org>
>> Committed: Sun Nov 2 23:22:11 2014 +0100
>>
>>
>> ----------------------------------------------------------------------
>>  src/changes/changes.xml                         |  3 +
>>  .../math3/ode/ContinuousOutputModel.java        | 71
>> ++++++++++++++++++--
>>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>>  4 files changed, 105 insertions(+), 18 deletions(-)
>>
>> ----------------------------------------------------------------------
> 
> They seem like a report on what happened on my local repository so
> that I could commit local changes after the main repository had been
> updated.
> This kind of message looks utterly useless and distracts from those
> that report actual changes to the main repository.
> 
> Don't you think that they should be filtered out?

I'm not sure.

> If not, can you explain their purpose?

I think this is due to the very strict handling of history by Git. Each
commit is completely linked with its parent and the commit hash takes
this link into account. In other words, the commit does not depend only
on what it contains but also on what point in the history it is applied to.

A side effect is that if the main repository history is:

  A -> B -> C -> D

and at this point you clone it and start working on a local change, your
local history will be as follows:

  A -> B -> C -> D
                 |
                 -> G1 -> G2 -> G3

Then, someone else pushes other modifications on the main repository,
which still only has D as its head, so the main repository history becomes:

  A -> B -> C -> D -> E -> F

On your local clone, you merge these changes and get:

  A -> B -> C -> D -> E -> F---------
                 |                  |
                 -> G1 -> G2 -> G3 --> G4

where G4 is a merge.

This can occur several time.

When you finally push your work back to the repository, it pushes the
full history of your current head to become the new head. So you will
see G1, G2, G3 (and this is really what you want, as it means you can do
small incremental changes without losing anything), but it will also see
some merge about thing you did not do yourself.

Here, commit 7df65 is a merge commit. It does not really include any
change, but only records the fact the current point in history has two
parents as it is the result of merging (here without any conflict)
commits 4a6bf54 (which was also a previous merge in your local history)
and 45ae5c7 (which was the head of main repository). If you follow the
link "Diff" from the message, you will see this commit is labeled as
"trivial merge" without any modified files associated.

Perhaps you could ask INFRA why the message from merge commit 7df65 does
contain the list of files modified by one of its parent commit (here
45ae5c7) instead of an empty list as there was no conflict between the
merge. If I run "git show --format=fuller 7df65" to have an extensive
description of the commit, I only get:

commit 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
Merge: 4a6bf54 45ae5c7
Author:     Gilles <er...@apache.org>
AuthorDate: Sun Nov 2 23:22:11 2014 +0100
Commit:     Gilles <er...@apache.org>
CommitDate: Sun Nov 2 23:22:11 2014 +0100

    Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/commons-math

Also looking at the list of files changed, it seems it includes files
from several commits in the branches, not only the last changed files:
commit 45ae5c7 only changed ContinuousOutputModel.java and not
StepInterpolator.java which was changed by an earlier commit in the
history. So I really don't know how the files list is created and put
into the message. Perhaps INFRA knows.

best regards,
Luc

> 
> Regards,
> Gilles
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[Math] Filtering message from git? (Was: [8/8] git commit: Merge branch 'master' [...])

Posted by Gilles <gi...@harfang.homelinux.org>.
Hi.

Three posts such as the following were sent to this ML:

> Merge branch 'master' of 
> https://git-wip-us.apache.org/repos/asf/commons-math
>
>
> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
> Commit: 
> http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
> Tree: 
> http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
> Diff: 
> http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d
>
> Branch: refs/heads/master
> Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
> Parents: 4a6bf54 45ae5c7
> Author: Gilles <er...@apache.org>
> Authored: Sun Nov 2 23:22:11 2014 +0100
> Committer: Gilles <er...@apache.org>
> Committed: Sun Nov 2 23:22:11 2014 +0100
>
> 
> ----------------------------------------------------------------------
>  src/changes/changes.xml                         |  3 +
>  .../math3/ode/ContinuousOutputModel.java        | 71 
> ++++++++++++++++++--
>  .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
>  .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
>  4 files changed, 105 insertions(+), 18 deletions(-)
> 
> ----------------------------------------------------------------------

They seem like a report on what happened on my local repository so
that I could commit local changes after the main repository had been
updated.
This kind of message looks utterly useless and distracts from those
that report actual changes to the main repository.

Don't you think that they should be filtered out?
If not, can you explain their purpose?

Regards,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[8/8] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math

Posted by er...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-math


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/7df65a5d
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/7df65a5d
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/7df65a5d

Branch: refs/heads/master
Commit: 7df65a5ddf59b564af1d753b89d30f8dc33a2c5d
Parents: 4a6bf54 45ae5c7
Author: Gilles <er...@apache.org>
Authored: Sun Nov 2 23:22:11 2014 +0100
Committer: Gilles <er...@apache.org>
Committed: Sun Nov 2 23:22:11 2014 +0100

----------------------------------------------------------------------
 src/changes/changes.xml                         |  3 +
 .../math3/ode/ContinuousOutputModel.java        | 71 ++++++++++++++++++--
 .../math3/ode/sampling/StepInterpolator.java    | 28 ++++++--
 .../math3/ode/ContinuousOutputModelTest.java    | 21 ++++--
 4 files changed, 105 insertions(+), 18 deletions(-)
----------------------------------------------------------------------