Git development
 help / color / mirror / Atom feed
* Re: [PATCH v3 2/3] fast-import: add option command
From: Shawn O. Pearce @ 2009-08-14 17:39 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Junio C Hamano, Johannes Schindelin, Git List
In-Reply-To: <fabb9a1e0908140937h32a2eac7ka88f76aa417fd631@mail.gmail.com>

Sverre Rabbelier <srabbelier@gmail.com> wrote:
> On Fri, Aug 14, 2009 at 08:37, Shawn O. Pearce<spearce@spearce.org> wrote:
> > Sverre Rabbelier <srabbelier@gmail.com> wrote:
> >> +`option`
> >> +~~~~~~~~
> >> +Processes the specified option so that git fast-import behaves in a
> >> +way that suits the frontend's needs.
> >> +Note that options specified by the frontend are overridden by any
> >> +options the user may specify to git fast-import itself.
> >
> > Wha? ?This disagrees with the code.
> 
> It does? It's saying that the user my override what the frontend
> specifies, which is what the current version does.

Sorry, lack of caffeine.  Rereading the docs makes sense.
 
> >> + ? ? if (!seen_non_option_command)
> >> + ? ? ? ? ? ? parse_argv();
> >
> > This is too late.
> 
> No it's not. Earlier in the patch, at the other
> 'seen_non_option_command', we call parse_argv() as well (which happens
> when a non-option command is issued). This statement is here to deal
> with options that affect an empty stream, such as 'git format-patch
> --import-marks=marks.old --export-marks=marks.new < /dev/null &&
> test_cmp marks.old marks.new'.

Oy, I missed that call.  I looked for it but gave up too soon I guess.
 
> > So yea, I really do think its a good idea for command line options
> > to override stream options, despite what Dscho may think. ?:-)
> 
> Which is what the current version does, yes?

Yes.  :-)

-- 
Shawn.

^ permalink raw reply

* Re: [PATCH v3 2/3] fast-import: add option command
From: Sverre Rabbelier @ 2009-08-14 16:37 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, Johannes Schindelin, Git List
In-Reply-To: <20090814153707.GT1033@spearce.org>

Heya,

On Fri, Aug 14, 2009 at 08:37, Shawn O. Pearce<spearce@spearce.org> wrote:
> Sverre Rabbelier <srabbelier@gmail.com> wrote:
>> +`option`
>> +~~~~~~~~
>> +Processes the specified option so that git fast-import behaves in a
>> +way that suits the frontend's needs.
>> +Note that options specified by the frontend are overridden by any
>> +options the user may specify to git fast-import itself.
>
> Wha?  This disagrees with the code.

It does? It's saying that the user my override what the frontend
specifies, which is what the current version does.

> This is a nasty refactoring, I would prefer to see it done in its
> own commit, "move option_import_marks so it can be called during
> command processing".

Ok, will do.

>> +     // argv hasn't been parsed yet, do so
>> +     if (!seen_non_option_command)
>> +             parse_argv();
>
> This is too late.

No it's not. Earlier in the patch, at the other
'seen_non_option_command', we call parse_argv() as well (which happens
when a non-option command is issued). This statement is here to deal
with options that affect an empty stream, such as 'git format-patch
--import-marks=marks.old --export-marks=marks.new < /dev/null &&
test_cmp marks.old marks.new'.

> So yea, I really do think its a good idea for command line options
> to override stream options, despite what Dscho may think.  :-)

Which is what the current version does, yes?

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply

* Re: [EGIT] Push to GitHub caused corruption
From: John Bito @ 2009-08-14 16:17 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git, Shawn O. Pearce
In-Reply-To: <200908141119.49798.robin.rosenberg.lists@dewire.com>

The repo that was pushed to cause the corruption GitHup has the tree
entry f4f9ecd1875938baa42467dfd6a8134d75fe5de4 in a dangling commit.

I've opened a bug in hopes that will limit the chatter on this list:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286653

The information below is all in there, as well.

$ git fsck --full f4f9ecd1875938baa42467dfd6a8134d75fe5de4
dangling commit 560a391801d1712b625d4ae317a490529a4ccf08

$ git ls-tree f4f9ecd1875938baa42467dfd6a8134d75fe5de4
100644 blob 9324c851e6816962f87cb772ebc34f9c8036d832    .classpath
100644 blob 1cb465bc1e95c2e088376ac06b363a3aa481c9ce    .project
040000 tree f00fa742e906037190ae0cce70ec235fbf6eab83    .settings
100644 blob 7186ec1ee04722679dd9b8c0567fa522ac0495b3    asql.jardesc
040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904    bin-groovy
040000 tree 57548924f1eca854dc8db00844f95d3de2c82957    bin
040000 tree 1156d24cd387c7278bc536d32b09057556a6c60d    lib
040000 tree 3d1f74522c3e7c3c03390fae376446fda6eed306    src

$ git show 560a391801d1712b625d4ae317a490529a4ccf08
commit 560a391801d1712b625d4ae317a490529a4ccf08
Author: John W. Bito <jwbito@XXXX>
Date:   Mon Aug 10 14:01:22 2009 -0700

    Now traverse rows using DB cursor.  Enable statement cache.

diff --git a/ADS/testlib/asql.jar b/ADS/testlib/asql.jar
index bb434c7..155b825 100644
Binary files a/ADS/testlib/asql.jar and b/ADS/testlib/asql.jar differ
diff --git a/ADS/testlib/groovy-all-1.6.1.jar b/ADS/testlib/groovy-all-1.6.1.jar
deleted file mode 100644
index a6252c2..0000000
Binary files a/ADS/testlib/groovy-all-1.6.1.jar and /dev/null differ
diff --git a/ADS/testlib/groovy-all-1.7-beta-1-SNAPSHOT.jar
b/ADS/testlib/groovy-all-1.7-beta-1-SNAPSHOT.jar
new file mode 100644
index 0000000..4d3fec8
Binary files /dev/null and
b/ADS/testlib/groovy-all-1.7-beta-1-SNAPSHOT.jar differ
diff --git a/queryengine/.classpath b/queryengine/.classpath
index 4aab135..9324c85 100644
--- a/queryengine/.classpath
+++ b/queryengine/.classpath
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="ch/viveo/query/test/resources/"
kind="src" path="src"/>
-	<classpathentry
excluding="bin-groovy/|src/|src/ch/viveo/query/test/resources/"
kind="src" path=""/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/nb_binding"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-	<classpathentry kind="con"
path="org.eclipse.datatools.connectivity.jdt.DRIVERLIBRARY/Oracle Thin
Driver"/>
-	<classpathentry kind="lib" path="/nb_binding/lib/xpp3_min-1.1.4c.jar"/>
-	<classpathentry kind="lib" path="/nb_binding/lib/xstream-1.3.1.jar">
-		<attributes>
-			<attribute name="javadoc_location"
value="http://xstream.codehaus.org/javadoc"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="ch/viveo/query/test/resources/"
kind="src" path="src"/>
+	<classpathentry
excluding="bin-groovy/|src/|src/ch/viveo/query/test/resources/"
kind="src" path=""/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/nb_binding"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry kind="con"
path="org.eclipse.datatools.connectivity.jdt.DRIVERLIBRARY/Oracle Thin
Driver"/>
+	<classpathentry kind="lib" path="/nb_binding/lib/xpp3_min-1.1.4c.jar"/>
+	<classpathentry kind="lib" path="/nb_binding/lib/xstream-1.3.1.jar">
+		<attributes>
+			<attribute name="javadoc_location"
value="http://xstream.codehaus.org/javadoc"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/queryengine/.settings/org.codehaus.groovy.eclipse.preferences.prefs
b/queryengine/.settings/org.codehaus.groovy.eclipse.preferences.prefs
old mode 100755
new mode 100644
index 1abf79e..c5e9a2e
--- a/queryengine/.settings/org.codehaus.groovy.eclipse.preferences.prefs
+++ b/queryengine/.settings/org.codehaus.groovy.eclipse.preferences.prefs
@@ -1,4 +1,4 @@
-#Tue May 05 14:16:49 PDT 2009
+#Sat Aug 08 14:15:43 PDT 2009
 eclipse.preferences.version=1
 groovy.compiler.output.path=bin-groovy
 support.groovy=true
diff --git a/queryengine/bin-groovy/README b/queryengine/bin-groovy/README
deleted file mode 100644
index 6dd996e..0000000
--- a/queryengine/bin-groovy/README
+++ /dev/null
@@ -1 +0,0 @@
-Folder for Groovy compilation.
diff --git a/queryengine/bin/.settings/org.codehaus.groovy.eclipse.preferences.prefs
b/queryengine/bin/.settings/org.codehaus.groovy.eclipse.preferences.prefs
old mode 100755
new mode 100644
index 1abf79e..c5e9a2e
--- a/queryengine/bin/.settings/org.codehaus.groovy.eclipse.preferences.prefs
+++ b/queryengine/bin/.settings/org.codehaus.groovy.eclipse.preferences.prefs
@@ -1,4 +1,4 @@
-#Tue May 05 14:16:49 PDT 2009
+#Sat Aug 08 14:15:43 PDT 2009
 eclipse.preferences.version=1
 groovy.compiler.output.path=bin-groovy
 support.groovy=true
diff --git a/queryengine/src/ch/viveo/query/TableBinding.groovy
b/queryengine/src/ch/viveo/query/TableBinding.groovy
index 29e0e58..410ebd6 100644
--- a/queryengine/src/ch/viveo/query/TableBinding.groovy
+++ b/queryengine/src/ch/viveo/query/TableBinding.groovy
@@ -7,6 +7,7 @@ import ch.viveo.ads_sql.TableInterface ;
 import ch.viveo.ads_sql.buffer.ClientBuffer;
 import ch.viveo.ads_sql.exceptions.*;
 import groovy.sql.Sql ;
+import groovy.sql.GroovyResultSet ;
 import java.util.logging.Logger;
 import java.util.logging.Level;
 import java.nio.ByteBuffer;
@@ -19,20 +20,20 @@ import java.lang.IllegalStateException
  *
  */
 public class TableBinding implements TableInterface {
+	private static final Logger log =
Logger.getLogger(getClass().getSimpleName());
+
 	private final Structure str;
 	private final Table tab;
 	private final def db;
 	private final def allFieldNames;
-	private final Set<Object> allColumnNames;
+	private final Set<String> allColumnNames;
 	private boolean valid;
 	private boolean open;
 	private def uri;
-	private def rowSet;
+	private GroovyResultSet resultSet;
 	private def queryParams;
 	private def queryKey;
 	private int queryMatchType;
-	private boolean rowSetUsed;
-	private static final Logger log =
Logger.getLogger(getClass().getSimpleName());
 	private final String readQuery;
 	private final String maxUriQuery;
 	private final String sequenceQuery;
@@ -195,8 +196,7 @@ public class TableBinding implements TableInterface {
 	
 	void select(int lockOption){
 		log.log(Level.FINEST, "Parameters: {0}", queryParams)
-		rowSet = db.rows(tab.keys.(lockOption ? "queryStringLock" :
"queryString") (queryKey, queryMatchType), queryParams);
-		rowSetUsed = false;
+		resultSet = db.rowCursor(tab.keys.(lockOption ? "queryStringLock" :
"queryString") (queryKey, queryMatchType), queryParams);
 	}
 	
 	public void selectRange(int keyNumber, int matchOption, ByteBuffer
startValues, ByteBuffer endValues) {
@@ -209,29 +209,23 @@ public class TableBinding implements TableInterface {
 	}

 	private reset() {
-		rowSet = null;
-		rowSetUsed = false
+		if (resultSet && !resultSet.isClosed())
+			resultSet.close();
 	}
 	
 	public int retrieveUris(ByteBuffer result, int lockOption) {
-		if (null == rowSet) {
+		if (null == resultSet) {
 			if (!queryKey)
 				throw new IllegalStateException("No row set available for ${tab.name}");
 			else {
 				select(lockOption);
-				log.log(Level.FINEST, "Select URIs returns {0}: {1}",
rowSet.size(), rowSet)
 			}
 		}
-		if (rowSetUsed)
-			return 0;
-		rowSetUsed = true;
 		IntBuffer urilist = result.asIntBuffer();
 		int count = 0;
-		rowSet.each {
-			if (urilist.position() < urilist.limit()) {
-				urilist.put(it.uri as int)
-				count ++;
-			}
+		while (urilist.position() < urilist.limit() && resultSet.next()) {
+			urilist.put(resultSet.uri as int)
+			count ++;
 		}
 		log.log(Level.FINEST, "retrieveUris returning {0} uris", count);
 		//TODO hold pagination state so next request returns following list elements
@@ -239,6 +233,7 @@ public class TableBinding implements TableInterface {
 	}
 	
 	public void close() {
+		reset();
 		valid = false;
 		open = false;
 		//TODO remove the reference to this in the Process instance
diff --git a/queryengine/src/ch/viveo/query/TableBindingTest.groovy
b/queryengine/src/ch/viveo/query/TableBindingTest.groovy
index 8e2a389..aa448d1 100644
--- a/queryengine/src/ch/viveo/query/TableBindingTest.groovy
+++ b/queryengine/src/ch/viveo/query/TableBindingTest.groovy
@@ -8,7 +8,6 @@ import org.junit.Test
 import org.junit.Before
 import org.junit.After;

-import groovy.sql.Sql;
 import java.nio.ByteBuffer;
 import java.nio.IntBuffer;

@@ -18,6 +17,9 @@ import ch.viveo.ads_sql.TableInterface
 import ch.viveo.ads_sql.buffer.ClientBuffer
 import ch.viveo.ads_sql.test.TestData

+import ch.viveo.query.mgr.Process;
+import ch.viveo.query.sql.SqlCursor;
+
 /**
  * @author John W. Bito
  *
@@ -27,13 +29,17 @@ public class TableBindingTest extends GroovyTestCase {
     def db = null;
     def str, res, fdf, keys;
     ByteBuffer buff;
+
+    public static final String TEST_DRIVER = 'oracle.jdbc.driver.OracleDriver';

     @Before
     public void setUp() throws Exception {
         resource = TestData.genericResource("clienp01.info.xml", this);
         fdf = new FDFTranslator().readXML(new FileReader(resource));
         str = FDFTranslator.createStructure(fdf);
-        db = Sql.newInstance("jdbc:oracle:thin:nbquali5/nbquali51@localhost:1521:nb");
+        Class.forName(TEST_DRIVER)
+        System.setProperty(Process.JDBC_DRIVER_PROPERTY, TEST_DRIVER)
+        db = SqlCursor.newInstance("jdbc:oracle:thin:nbquali5/nbquali51@localhost:1521:nb");
         def tab = new Table("uri_clienp01");
 		res = new TableBinding(str, tab, db);
 		keys = new KeyBinding(tab, str, fdf.key.code);
@@ -65,6 +71,10 @@ public class TableBindingTest extends GroovyTestCase {
 		def rec = readLast();
 		String query = "select * from uri_clienp01 where uri=${res.uri}";
 		def sqlData = db.firstRow(query);
+		sqlData.each { k, v ->
+			println k + "->" + v?.class + "=" + v
+			
+		}
 		assertEquals(sqlData["MAJ0H"], rec["MAJ0H"].value);
 		assertTrue(res.getUnboundColumns().isEmpty());
 		assertTrue(res.getUnboundFields().isEmpty());
@@ -121,7 +131,7 @@ public class TableBindingTest extends GroovyTestCase {
 		
 		res.selectRange(0, TableInterface.MATCHGEKEY1LEKEY2, start, end);
 		res.select(01);
-		assertEquals(12, res.rowSet.size());
+		assertEquals(4, res.queryParams.size());
 	}
 	
 	@Test
diff --git a/queryengine/src/ch/viveo/query/mgr/Process.groovy
b/queryengine/src/ch/viveo/query/mgr/Process.groovy
index 9613e2a..5bce4ed 100644
--- a/queryengine/src/ch/viveo/query/mgr/Process.groovy
+++ b/queryengine/src/ch/viveo/query/mgr/Process.groovy
@@ -4,13 +4,13 @@
 package ch.viveo.query.mgr ;

 import java.nio.ByteBuffer ;
-import groovy.sql.Sql;
 import java.sql.Connection;

 import ch.viveo.ads_sql.FDFTranslator;
 import ch.viveo.ads_sql.TableInterface;

 import ch.viveo.query.*;
+import ch.viveo.query.sql.SqlCursor;

 /**
  * Handle the lifecycle of PDs (Process Definition) and the resources
that map to SQL queries
@@ -28,6 +28,7 @@ public class Process{
 	def dbConnection = null;
 	
 	public static final String CONNECTION_PROPERTY = "ch.viveo.db.connect";
+	public static final String JDBC_DRIVER_PROPERTY = "ch.viveo.db.driver";
 	
 	FDFTranslator loader = null;
 	
@@ -49,10 +50,13 @@ public class Process{
 	private def getConnection() {
 		if (!dbConnection) {
 			String connSpec = System.getProperty(CONNECTION_PROPERTY);
+			String driverName = System.getProperty(JDBC_DRIVER_PROPERTY);
 			if (!connSpec)
 				throw new IllegalArgumentException("$CONNECTION_PROPERTY not set");
-			Class.forName("oracle.jdbc.driver.OracleDriver"); // TODO setup a
proper initialization
-			dbConnection = Sql.newInstance(connSpec);
+			if (driverName)
+				dbConnection = SqlCursor.newInstance(connSpec, driverName);
+			else
+				dbConnection = SqlCursor.newInstance(connSpec);
 		}
 		return dbConnection;
 	}
diff --git a/queryengine/src/ch/viveo/query/sql/SqlCursor.java
b/queryengine/src/ch/viveo/query/sql/SqlCursor.java
new file mode 100644
index 0000000..232ccd3
--- /dev/null
+++ b/queryengine/src/ch/viveo/query/sql/SqlCursor.java
@@ -0,0 +1,149 @@
+/**
+ *
+ */
+package ch.viveo.query.sql;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Properties;
+
+import javax.sql.DataSource;
+
+import groovy.sql.GroovyResultSet;
+import groovy.sql.GroovyResultSetProxy;
+import groovy.sql.Sql;
+
+/**
+ * @author IBM User
+ *
+ */
+public class SqlCursor extends Sql {
+
+	/**
+	 * @param dataSource
+	 */
+	public SqlCursor(DataSource dataSource) {
+		super(dataSource);
+		setCacheStatements(true);
+	}
+
+	/**
+	 * @param connection
+	 */
+	public SqlCursor(Connection connection) {
+		super(connection);
+		setCacheStatements(true);
+	}
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL.
+     *
+     * @param url a database url of the form
+     *            <code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @return a new Sql instance with a connection
+     * @throws SQLException if a database access error occurs
+     */
+    public static SqlCursor newInstance(String url) throws SQLException {
+        Connection connection = DriverManager.getConnection(url);
+        return new SqlCursor(connection);
+    }
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL
+     * and some properties.
+     *
+     * @param url        a database url of the form
+     *                   <code>
jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @param properties a list of arbitrary string tag/value pairs
+     *                   as connection arguments; normally at least a
"user" and
+     *                   "password" property should be included
+     * @return a new Sql instance with a connection
+     * @throws SQLException if a database access error occurs
+     */
+    public static SqlCursor newInstance(String url, Properties
properties) throws SQLException {
+        Connection connection = DriverManager.getConnection(url, properties);
+        return new SqlCursor(connection);
+    }
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL,
+     * some properties and a driver class name.
+     *
+     * @param url             a database url of the form
+     *                        <code>
jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @param properties      a list of arbitrary string tag/value pairs
+     *                        as connection arguments; normally at
least a "user" and
+     *                        "password" property should be included
+     * @param driverClassName the fully qualified class name of the
driver class
+     * @return a new Sql instance with a connection
+     * @throws SQLException           if a database access error occurs
+     * @throws ClassNotFoundException if the class cannot be found or loaded
+     */
+    public static SqlCursor newInstance(String url, Properties
properties, String driverClassName)
+            throws SQLException, ClassNotFoundException {
+        loadDriver(driverClassName);
+        return newInstance(url, properties);
+    }
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL,
+     * a username and a password.
+     *
+     * @param url      a database url of the form
+     *                 <code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @param user     the database user on whose behalf the connection
+     *                 is being made
+     * @param password the user's password
+     * @return a new Sql instance with a connection
+     * @throws SQLException if a database access error occurs
+     */
+    public static SqlCursor newInstance(String url, String user,
String password) throws SQLException {
+        Connection connection = DriverManager.getConnection(url,
user, password);
+        return new SqlCursor(connection);
+    }
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL,
+     * a username, a password and a driver class name.
+     *
+     * @param url             a database url of the form
+     *                        <code>
jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @param user            the database user on whose behalf the connection
+     *                        is being made
+     * @param password        the user's password
+     * @param driverClassName the fully qualified class name of the
driver class
+     * @return a new Sql instance with a connection
+     * @throws SQLException           if a database access error occurs
+     * @throws ClassNotFoundException if the class cannot be found or loaded
+     */
+    public static SqlCursor newInstance(String url, String user,
String password, String driverClassName) throws SQLException,
+            ClassNotFoundException {
+        loadDriver(driverClassName);
+        return newInstance(url, user, password);
+    }
+
+    /**
+     * Creates a new Sql instance given a JDBC connection URL
+     * and a driver class name.
+     *
+     * @param url             a database url of the form
+     *                        <code>
jdbc:<em>subprotocol</em>:<em>subname</em></code>
+     * @param driverClassName the fully qualified class name of the
driver class
+     * @return a new Sql instance with a connection
+     * @throws SQLException           if a database access error occurs
+     * @throws ClassNotFoundException if the class cannot be found or loaded
+     */
+    public static SqlCursor newInstance(String url, String
driverClassName) throws SQLException, ClassNotFoundException {
+        loadDriver(driverClassName);
+        return newInstance(url);
+    }
+
+    public GroovyResultSet rowCursor(String sql, List<Object> params)
throws SQLException {
+    	ResultSet rs = executePreparedQuery(sql, params);
+    	return new GroovyResultSetProxy(rs).getImpl();
+    }
+
+}
diff --git a/queryengine/src/nb.sql b/queryengine/src/nb.sql
index 277ff44..7c2c875 100644
--- a/queryengine/src/nb.sql
+++ b/queryengine/src/nb.sql
@@ -100,4 +100,8 @@ delete from clienp01 where uri > 1500;
 desc uri_clienp01;

 select distinct nom0x from clienp01
-select uri from clienp01 where nom0x = 'CL99898000'
\ No newline at end of file
+select uri from clienp01 where nom0x = 'CL99898000'
+
+alter table uri_clienp01 add  (time timestamp)
+alter table uri_clienp01 drop column time
+update uri_clienp01 set time = current_timestamp
\ No newline at end of file


On Fri, Aug 14, 2009 at 02:19, Robin
Rosenberg<robin.rosenberg.lists@dewire.com> wrote:
> f4f9ecd1875938baa42467dfd6a8134d75fe5de4

^ permalink raw reply related

* Re: merging individual files
From: Chris Marshall @ 2009-08-14 16:14 UTC (permalink / raw)
  To: git
In-Reply-To: <4A858B3B.3000208@drmicha.warpmail.net>

Michael J Gruber <git <at> drmicha.warpmail.net> writes:
> > If you're on br1, I would:
> > 
> > git rebase -i X^
> > # change "pick" to "edit" in front of X in the list you get
> > git checkout X^ -- f3 f4 f5
> > git commit --amend
> > git checkout X -- f3 f4 f5
> > git commit
> 
> followed by
> 
> git rebase --continue
> 
> of course ;)
> 
> > 
> > For the 2nd commit, using the -c option may be beneficial.
> > 
> > Cheers,
> > Michael
> > 
> 
> 

Michael:

Thanks so much for your help, this is a lot of fun!

It occurs to me that another way (that doesn't use rebase) would be this:
git branch -m br1 br1-old
git checkout br1-old
git reset HEAD~
git checkout -b br1
git add f1
git commit -m "f1"
git add f2 f3
git commit -m "f2"
git branch -d br1-old (history eraser button ;-)

git checkout master
git merge br1~ (which now only pulls f1's changes)
(work for a while)
git merge br1 (which now pulls f2 and f3).

I like this sequence because it's so explicit about what's going on.

Are there any conceptual problems going this route that I am missing that might
screw up history?

Chris Marshall

^ permalink raw reply

* Re: merging individual files
From: Michael J Gruber @ 2009-08-14 16:05 UTC (permalink / raw)
  Cc: Chris Marshall, git
In-Reply-To: <4A858298.4020702@drmicha.warpmail.net>

Michael J Gruber venit, vidit, dixit 14.08.2009 17:28:
> Chris Marshall venit, vidit, dixit 14.08.2009 16:31:
>> Michael J Gruber <git <at> drmicha.warpmail.net> writes:
>>>> This strikes me as not too bad of a procedure, as long as there is a 
>> graceful
>>>> way of determining the most recent common ancestor of br1 and master.  
>> What's
>>>> the simplest way of doing that?
>>>>
>>>
>>> That would be simply git merge-base master br1.
>>>
>>> BUT: The main problem here is that git is not file based, but
>>> revision/commit/tree based. In the above, you're basically losing all
>>> the history common_ancestor_commit..br1 which produced br1's version of
>>> f1 and f2, in the sense that a git log master will not show that part of
>>> the history at all.
>>
>> Well put, I agree.  One of the main arguments I am going to use to try to 
>> convince my fellows to switch from perforce to git is the usefulness of git 
>> blame.  I would be defeating that with my procedure.
>>
>>>
>>> If it makes sense to change f1 and f2 without changing f3 that probably
>>> means that the pertinent commit should have been split. Is it an option
>>> for you to rewrite br1's history? That would be the most gittish solution.
>>
>> Yes, I like the idea of rewriting br1's history.
>>
>> So, given that f1, f2, ..., fn were changed together in one commit X on br1, I 
>> want to break f1 and f2 out of X and put them into X', then leave the rest of 
>> the f3,...,fn changes in Y'.
>>
>> Let's say X was the last commit on br1.  
>>
>> What would the commands to do that look like?
>>
> 
> If you're on br1, I would:
> 
> git rebase -i X^
> # change "pick" to "edit" in front of X in the list you get
> git checkout X^ -- f3 f4 f5
> git commit --amend
> git checkout X -- f3 f4 f5
> git commit

followed by

git rebase --continue

of course ;)

> 
> For the 2nd commit, using the -c option may be beneficial.
> 
> Cheers,
> Michael
> 

^ permalink raw reply

* http-push sends MKCOL command to create remote directory MKCOL http://user@server:80/url/.git/refs/ that already exists
From: willievu @ 2009-08-14 15:42 UTC (permalink / raw)
  To: git


Steps will reproduce the problem:
1. create a bare & shared repository locally and copy to remote server
2. create a local repository. add and commit some files
3. git push to the remote server

$ git push --verbose --thin upload HEAD
Pushing to http://user@server/url/.git/
Password:
Fetching remote heads...
  refs/
  refs/heads/
  refs/tags/
updating 'refs/heads/master' using 'HEAD'
  from 0000000000000000000000000000000000000000
  to   0120f45ebfd90501868e990bfbb9f50fb0a8ebae

<<<<< Here, a MKCOL http://user@server:80/url/.git/refs/ request is sent.  
The WebDAV server returns a HTTP 500 Internal Server Error.  Then, the 
following message continues:

Unable to create branch path http://user@server/url/.git/refs/
Unable to lock remote branch refs/heads/master
error: failed to push some refs to 'http://user@server/url/.git/'

This is the server:

Server: Oracle9iAS/9.0.2.3.0 Oracle HTTP Server (Unix) mod_plsql/9.0.2.6.0b 
DAV/1.0.3.2.4-0119 (OraDAV enabled) mod_osso/9.0.2.0.0 mod_ossl/9.0.2.0.0 
mod_fastcgi/2.2.12 mod_perl/1.26 mod_oc4j/3.0

Is MKCOL expected even for existing directory in the remote repository?  Is
this a WebDAV server problem that 500 is returned?

-- 
View this message in context: http://n2.nabble.com/http-push-sends-MKCOL-command-to-create-remote-directory-MKCOL-http%3A--user%40server%3A80-url-.git-refs--that-already-exists-tp3445796p3445796.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [PATCH v3 2/3] fast-import: add option command
From: Shawn O. Pearce @ 2009-08-14 15:37 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Junio C Hamano, Johannes Schindelin, Git List
In-Reply-To: <1250190156-4752-3-git-send-email-srabbelier@gmail.com>

Sverre Rabbelier <srabbelier@gmail.com> wrote:
> +`option`
> +~~~~~~~~
> +Processes the specified option so that git fast-import behaves in a
> +way that suits the frontend's needs.
> +Note that options specified by the frontend are overridden by any
> +options the user may specify to git fast-import itself.

Wha?  This disagrees with the code.

> +static void read_marks(void)
> +{
> +	char line[512];
> +	FILE *f = fopen(input_file, "r");
...
> +static void option_import_marks(const char *marks)
>  {
> -	char line[512];
> -	FILE *f = fopen(input_file, "r");

This is a nasty refactoring, I would prefer to see it done in its
own commit, "move option_import_marks so it can be called during
command processing".

> @@ -2517,9 +2556,16 @@ int main(int argc, const char **argv)
>  			parse_checkpoint();
>  		else if (!prefixcmp(command_buf.buf, "progress "))
>  			parse_progress();
> +		else if (!prefixcmp(command_buf.buf, "option "))
> +			parse_option();
>  		else
>  			die("Unsupported command: %s", command_buf.buf);
>  	}
> +
> +	// argv hasn't been parsed yet, do so
> +	if (!seen_non_option_command)
> +		parse_argv();

This is too late.  Options like --date-format or --max-pack-size or
--depth or --active-branches all influence the command processing
above.  Parsing these at the end means they have no affect on the
import, which is wrong.

Oh, and --active-branches or --max-pack-size or --depth are really
good examples of things that maybe you do want to override on the
command line.  They have impact only on memory usage of the running
import process, and the local disk usage.  Maybe the frontend has
given too many active branches for your physical memory, and you
want a lower threshold.

So yea, I really do think its a good idea for command line options
to override stream options, despite what Dscho may think.  :-)

-- 
Shawn.

^ permalink raw reply

* Re: merging individual files
From: Michael J Gruber @ 2009-08-14 15:28 UTC (permalink / raw)
  To: Chris Marshall; +Cc: git
In-Reply-To: <loom.20090814T135614-375@post.gmane.org>

Chris Marshall venit, vidit, dixit 14.08.2009 16:31:
> Michael J Gruber <git <at> drmicha.warpmail.net> writes:
>>> This strikes me as not too bad of a procedure, as long as there is a 
> graceful
>>> way of determining the most recent common ancestor of br1 and master.  
> What's
>>> the simplest way of doing that?
>>>
>>
>> That would be simply git merge-base master br1.
>>
>> BUT: The main problem here is that git is not file based, but
>> revision/commit/tree based. In the above, you're basically losing all
>> the history common_ancestor_commit..br1 which produced br1's version of
>> f1 and f2, in the sense that a git log master will not show that part of
>> the history at all.
> 
> Well put, I agree.  One of the main arguments I am going to use to try to 
> convince my fellows to switch from perforce to git is the usefulness of git 
> blame.  I would be defeating that with my procedure.
> 
>>
>> If it makes sense to change f1 and f2 without changing f3 that probably
>> means that the pertinent commit should have been split. Is it an option
>> for you to rewrite br1's history? That would be the most gittish solution.
> 
> Yes, I like the idea of rewriting br1's history.
> 
> So, given that f1, f2, ..., fn were changed together in one commit X on br1, I 
> want to break f1 and f2 out of X and put them into X', then leave the rest of 
> the f3,...,fn changes in Y'.
> 
> Let's say X was the last commit on br1.  
> 
> What would the commands to do that look like?
> 

If you're on br1, I would:

git rebase -i X^
# change "pick" to "edit" in front of X in the list you get
git checkout X^ -- f3 f4 f5
git commit --amend
git checkout X -- f3 f4 f5
git commit

For the 2nd commit, using the -c option may be beneficial.

Cheers,
Michael

^ permalink raw reply

* [PATCH] git-config: Parse config files leniently
From: Michael J Gruber @ 2009-08-14 15:10 UTC (permalink / raw)
  To: git; +Cc: David Reitter, Jakub Narebski, Junio C Hamano
In-Reply-To: <A5CDBB91-E889-4849-953A-2C1DB4A04513@gmail.com>

Currently, git config dies as soon as there is a parsing error. This is
especially unfortunate in case a user tries to correct config mistakes
using git config -e.

Instead, issue a warning only and treat the rest of the line as a
comment (ignore it). This benefits not only git config -e users.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Reported-by: David Reitter <david.reitter@gmail.com>
---
The diff and stat are overstatements. I had to shift that whole for loop
by one tab stop but diff (with or without --color-words) does not recognize
this. Nothing inside the loop is changed.
The outer while makes sure that
* we switch to comment mode after a parsing error
* we return eventually no matter whether the file ends with \n or not.

Test had to be adjusted as well.

 config.c                |   80 ++++++++++++++++++++++++----------------------
 t/t1303-wacky-config.sh |    4 +-
 2 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/config.c b/config.c
index e87edea..5e0af5d 100644
--- a/config.c
+++ b/config.c
@@ -207,50 +207,54 @@ static int git_parse_file(config_fn_t fn, void *data)
 	static const unsigned char *utf8_bom = (unsigned char *) "\xef\xbb\xbf";
 	const unsigned char *bomptr = utf8_bom;
 
-	for (;;) {
-		int c = get_next_char();
-		if (bomptr && *bomptr) {
-			/* We are at the file beginning; skip UTF8-encoded BOM
-			 * if present. Sane editors won't put this in on their
-			 * own, but e.g. Windows Notepad will do it happily. */
-			if ((unsigned char) c == *bomptr) {
-				bomptr++;
+	while (!config_file_eof) {
+		for (;;) {
+			int c = get_next_char();
+			if (bomptr && *bomptr) {
+				/* We are at the file beginning; skip UTF8-encoded BOM
+				 * if present. Sane editors won't put this in on their
+				 * own, but e.g. Windows Notepad will do it happily. */
+				if ((unsigned char) c == *bomptr) {
+					bomptr++;
+					continue;
+				} else {
+					/* Do not tolerate partial BOM. */
+					if (bomptr != utf8_bom)
+						break;
+					/* No BOM at file beginning. Cool. */
+					bomptr = NULL;
+				}
+			}
+			if (c == '\n') {
+				if (config_file_eof)
+					return 0;
+				comment = 0;
 				continue;
-			} else {
-				/* Do not tolerate partial BOM. */
-				if (bomptr != utf8_bom)
+			}
+			if (comment || isspace(c))
+				continue;
+			if (c == '#' || c == ';') {
+				comment = 1;
+				continue;
+			}
+			if (c == '[') {
+				baselen = get_base_var(var);
+				if (baselen <= 0)
 					break;
-				/* No BOM at file beginning. Cool. */
-				bomptr = NULL;
+				var[baselen++] = '.';
+				var[baselen] = 0;
+				continue;
 			}
-		}
-		if (c == '\n') {
-			if (config_file_eof)
-				return 0;
-			comment = 0;
-			continue;
-		}
-		if (comment || isspace(c))
-			continue;
-		if (c == '#' || c == ';') {
-			comment = 1;
-			continue;
-		}
-		if (c == '[') {
-			baselen = get_base_var(var);
-			if (baselen <= 0)
+			if (!isalpha(c))
+				break;
+			var[baselen] = tolower(c);
+			if (get_value(fn, data, var, baselen+1) < 0)
 				break;
-			var[baselen++] = '.';
-			var[baselen] = 0;
-			continue;
 		}
-		if (!isalpha(c))
-			break;
-		var[baselen] = tolower(c);
-		if (get_value(fn, data, var, baselen+1) < 0)
-			break;
+		warning("bad config file line %d in %s", config_linenr, config_file_name);
+		comment = 1;
 	}
-	die("bad config file line %d in %s", config_linenr, config_file_name);
+	return -1;
 }
 
 static int parse_unit_factor(const char *end, unsigned long *val)
diff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh
index 080117c..be850c5 100755
--- a/t/t1303-wacky-config.sh
+++ b/t/t1303-wacky-config.sh
@@ -9,7 +9,7 @@ setup() {
 }
 
 check() {
-	echo "$2" >expected
+	printf "$2\n" >expected
 	git config --get "$1" >actual 2>&1
 	test_cmp actual expected
 }
@@ -44,7 +44,7 @@ LONG_VALUE=$(printf "x%01021dx a" 7)
 test_expect_success 'do not crash on special long config line' '
 	setup &&
 	git config section.key "$LONG_VALUE" &&
-	check section.key "fatal: bad config file line 2 in .git/config"
+	check section.key "warning: bad config file line 2 in .git/config\nwarning: bad config file line 2 in .git/config"
 '
 
 test_done
-- 
1.6.4.225.gb589e

^ permalink raw reply related

* Re: merging individual files
From: Chris Marshall @ 2009-08-14 14:31 UTC (permalink / raw)
  To: git
In-Reply-To: <4A851887.5010701@drmicha.warpmail.net>

Michael J Gruber <git <at> drmicha.warpmail.net> writes:
> > This strikes me as not too bad of a procedure, as long as there is a 
graceful
> > way of determining the most recent common ancestor of br1 and master.  
What's
> > the simplest way of doing that?
> > 
> 
> That would be simply git merge-base master br1.
> 
> BUT: The main problem here is that git is not file based, but
> revision/commit/tree based. In the above, you're basically losing all
> the history common_ancestor_commit..br1 which produced br1's version of
> f1 and f2, in the sense that a git log master will not show that part of
> the history at all.

Well put, I agree.  One of the main arguments I am going to use to try to 
convince my fellows to switch from perforce to git is the usefulness of git 
blame.  I would be defeating that with my procedure.

> 
> If it makes sense to change f1 and f2 without changing f3 that probably
> means that the pertinent commit should have been split. Is it an option
> for you to rewrite br1's history? That would be the most gittish solution.

Yes, I like the idea of rewriting br1's history.

So, given that f1, f2, ..., fn were changed together in one commit X on br1, I 
want to break f1 and f2 out of X and put them into X', then leave the rest of 
the f3,...,fn changes in Y'.

Let's say X was the last commit on br1.  

What would the commands to do that look like?

^ permalink raw reply

* Re: git config -> "fatal: bad config file"
From: Jakub Narebski @ 2009-08-14 14:28 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: David Reitter, git
In-Reply-To: <4A85724C.5060406@drmicha.warpmail.net>

Michael J Gruber <git@drmicha.warpmail.net> writes:
> David Reitter venit, vidit, dixit 14.08.2009 15:38:

> > I made a mistake editing my config file using "git config -e".  This  
> > caused git commands to fail.
> > 
> > Trying to fix the problem, I did
> > 
> > git config -e
> > fatal: bad config file line 7 in .git/config
> > 
> > I think the refusal to edit a broken config file is not a good idea.   
> > It's easy to fix for me of course by editing .git/config directly, but  
> > git-config should probably not read the config file at all.
> > 
> > Thanks for your consideration.
> > 
> 
> git needs to read the file because the editor could be configured there!
> The only option would be to make git config -e continue past that error.

Well, it shows you which file the error is, but I think as a special
case "git config [file] --edit" should show also (absolute?) pathname
of the file it tired to open.

core.editor can be in any place.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply

* Re: git config -> "fatal: bad config file"
From: David Reitter @ 2009-08-14 14:26 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git
In-Reply-To: <4A85724C.5060406@drmicha.warpmail.net>

On Aug 14, 2009, at 10:18 AM, Michael J Gruber wrote:

> git needs to read the file because the editor could be configured  
> there!
> The only option would be to make git config -e continue past that  
> error.


Syntax errors in .git/config could lead to warnings. Since the file is  
primarily line-oriented anyways (except for groups), recovery should  
be easy.

Also, you could have git-config -e edit a temporary file, check the  
file for errors after editing and then move it to .git/config.

^ permalink raw reply

* Re: git config -> "fatal: bad config file"
From: Michael J Gruber @ 2009-08-14 14:18 UTC (permalink / raw)
  To: David Reitter; +Cc: git
In-Reply-To: <A5CDBB91-E889-4849-953A-2C1DB4A04513@gmail.com>

David Reitter venit, vidit, dixit 14.08.2009 15:38:
> I made a mistake editing my config file using "git config -e".  This  
> caused git commands to fail.
> 
> Trying to fix the problem, I did
> 
> git config -e
> fatal: bad config file line 7 in .git/config
> 
> I think the refusal to edit a broken config file is not a good idea.   
> It's easy to fix for me of course by editing .git/config directly, but  
> git-config should probably not read the config file at all.
> 
> Thanks for your consideration.
> 

git needs to read the file because the editor could be configured there!
The only option would be to make git config -e continue past that error.

Michael

^ permalink raw reply

* git config -> "fatal: bad config file"
From: David Reitter @ 2009-08-14 13:38 UTC (permalink / raw)
  To: git

I made a mistake editing my config file using "git config -e".  This  
caused git commands to fail.

Trying to fix the problem, I did

git config -e
fatal: bad config file line 7 in .git/config

I think the refusal to edit a broken config file is not a good idea.   
It's easy to fix for me of course by editing .git/config directly, but  
git-config should probably not read the config file at all.

Thanks for your consideration.

^ permalink raw reply

* trailling whitespace with git am ?
From: PICCA Frédéric-Emmanuel @ 2009-08-14 10:42 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]

hello

I attached a patch that someone sent to me
the public repository is
http://repo.or.cz/w/diffractometer.git

this patch must be apply on the next branch

but when I try to use
git am, I have this sort of message:

mordor% git am /home/picca/Projets/patches/0001-Add-the-POGO-TO-DELETE-comment-to-ComputedAnglesClea.patch 
Applying: 'Add the POGO TO DELETE comment to ComputedAnglesClear command'
/tmp/diffractometer/.git/rebase-apply/patch:13: trailing whitespace.

/tmp/diffractometer/.git/rebase-apply/patch:14: trailing whitespace.
	/* POGO TO DELETE */
error: patch failed: src/Diffractometer/Diffractometer.cpp:2023
error: src/Diffractometer/Diffractometer.cpp: patch does not apply
Patch failed at 0001 'Add the POGO TO DELETE comment to ComputedAnglesClear command'
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".


so git do not want to apply it.

I was looking in the patch file about thoses trailing whitespace but I found nothing
until I rewrote myself this complicate patch :)
then I produced a diff beetween my patch and the original one.

I also attached it.
using emacs/vi I saw immediately the problem... It was a dos/unix file format problem. So the first message of git am was no helpfull at all for me. It would be nice to detect this format
problem when applying the patch and says something like
this patch is in dos format on an unix platform I can not apply it.

the a short explaination of what solution are possibles for the users.

now the question is:

what must I tell to that person if I want to work with her (as she is charming the forget about here is a no op :))
change your editor or is it a git configuration problem ? I suppose she is using msygit but I can not affirm this.

thanks

Frédéric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-the-POGO-TO-DELETE-comment-to-ComputedAnglesClea.patch --]
[-- Type: text/x-patch; name="0001-Add-the-POGO-TO-DELETE-comment-to-ComputedAnglesClea.patch", Size: 899 bytes --]

From 2ad19d21660e7a94cba0e7eaedbb867208832ca2 Mon Sep 17 00:00:00 2001
From: teresa <tnunez@mail.desy.de>
Date: Fri, 14 Aug 2009 10:46:09 +0200
Subject: [PATCH] 'Add the POGO TO DELETE comment to ComputedAnglesClear command'

---
 src/Diffractometer/Diffractometer.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp
index 5d2a55d..98add35 100644
--- a/src/Diffractometer/Diffractometer.cpp
+++ b/src/Diffractometer/Diffractometer.cpp
@@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()
 	DEBUG_STREAM << "Diffractometer::computed_angles_clear(): entering... !" << endl;
 
 	//	Add your own code to control device here
+
+	/* POGO TO DELETE */
 	_computedAngles_size = 0;
 	if(attr_ComputedAngles_read) {
 		delete [] attr_ComputedAngles_read;
-- 
1.6.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: toto.diff --]
[-- Type: text/x-patch; name="toto.diff", Size: 1881 bytes --]

1,25c1,25
< From 58ed93432f043ee5b2ad44d92a769eddcef4cffa Mon Sep 17 00:00:00 2001
< From: =?utf-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@synchrotron-soleil.fr>
< Date: Fri, 14 Aug 2009 12:10:50 +0200
< Subject: [PATCH] * test
< 
< ---
<  src/Diffractometer/Diffractometer.cpp |    2 ++
<  1 files changed, 2 insertions(+), 0 deletions(-)
< 
< diff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp
< index 5d2a55d..98add35 100644
< --- a/src/Diffractometer/Diffractometer.cpp
< +++ b/src/Diffractometer/Diffractometer.cpp
< @@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()
<  	DEBUG_STREAM << "Diffractometer::computed_angles_clear(): entering... !" << endl;
<  
<  	//	Add your own code to control device here
< +
< +	/* POGO TO DELETE */
<  	_computedAngles_size = 0;
<  	if(attr_ComputedAngles_read) {
<  		delete [] attr_ComputedAngles_read;
< -- 
< 1.6.3.3
< 
---
> From 2ad19d21660e7a94cba0e7eaedbb867208832ca2 Mon Sep 17 00:00:00 2001
> From: teresa <tnunez@mail.desy.de>
> Date: Fri, 14 Aug 2009 10:46:09 +0200
> Subject: [PATCH] 'Add the POGO TO DELETE comment to ComputedAnglesClear command'
> 
> ---
>  src/Diffractometer/Diffractometer.cpp |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/Diffractometer/Diffractometer.cpp b/src/Diffractometer/Diffractometer.cpp
> index 5d2a55d..98add35 100644
> --- a/src/Diffractometer/Diffractometer.cpp
> +++ b/src/Diffractometer/Diffractometer.cpp
> @@ -2023,6 +2023,8 @@ void Diffractometer::computed_angles_clear()
>  	DEBUG_STREAM << "Diffractometer::computed_angles_clear(): entering... !" << endl;
>  
>  	//	Add your own code to control device here
> +
> +	/* POGO TO DELETE */
>  	_computedAngles_size = 0;
>  	if(attr_ComputedAngles_read) {
>  		delete [] attr_ComputedAngles_read;
> -- 
> 1.6.4
> 

^ permalink raw reply related

* [PATCH] revert: Remove printing fullstop after the commit hash
From: Amit Shah @ 2009-08-14  9:56 UTC (permalink / raw)
  To: git; +Cc: Amit Shah

Copy-pasting the commit id from a revert message selects
the trailing fullstop as well which has to be removed
after pasting. That's inefficient.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 builtin-revert.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-revert.c b/builtin-revert.c
index 151aa6a..7f0c22c 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -346,7 +346,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 			add_to_msg(", reversing\nchanges made to ");
 			add_to_msg(sha1_to_hex(parent->object.sha1));
 		}
-		add_to_msg(".\n");
+		add_to_msg("\n");
 	} else {
 		base = parent;
 		next = commit;
-- 
1.6.2.5

^ permalink raw reply related

* Re: [PATCH v2] git-cvsimport: add support for cvs pserver password  scrambling.
From: Dirk Hörner @ 2009-08-14  9:46 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Johannes Schindelin, Nanako Shiraishi
In-Reply-To: <7vskfusvpq.fsf@alter.siamese.dyndns.org>

Hi Junio,

On Fri, Aug 14, 2009 at 9:25 AM, Junio C Hamano<gitster@pobox.com> wrote:
> Thanks.
>
> While I appreciate your effort to add a test, I'd rather not apply the
> test part of your patch for two reasons:
>
>  - It is not a test against a real cvs pserver but is a whitebox test to
>   verify that the program says what the program is supposed to spit out
>   to the network; and
>
>  - It still is a network test that will fail if the TCP port is occupied
>   for whatever reason when the test is run, which will make automated
>   build and test cycle unreliable.
>
> Unfortunately, I do not see an easy way to run a real cvs pserver
> listening to a local unix domain socket under $TRASH_DIRECTORY, which
> would solve both of the above issues.
>

I agree with you, the tests are not the best. As Dscho stated in one
of the replies to the last version of this patch, the cvs pserver is
quite good to test with because it uses stdin/stdout for
communication. The main problem is git-cvsimport, which right now only
supports tcp sockets.

Ciao,
Dirk

^ permalink raw reply

* Re: [PATCH] Fix "unpack-objects --strict"
From: Frank Lichtenheld @ 2009-08-14  9:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Martin Koegler
In-Reply-To: <7vd46zbjae.fsf@alter.siamese.dyndns.org>

On Thu, Aug 13, 2009 at 12:33:45PM -0700, Junio C Hamano wrote:
> When unpack-objects is run under the --strict option, objects that have
> pointers to other objects are verified for the reachability at the end, by
> calling check_object() on each of them, and letting check_object to walk
> the reachable objects from them using fsck_walk() recursively.
> 
> The function however misunderstands the semantics of fsck_walk() function
> when it makes a call to it, setting itself as the callback.  fsck_walk()
> expects the callback function to return a non-zero value to signal an
> error (negative value causes an immediate abort, positive value is still
> an error but allows further checks on sibling objects) and return zero to
> signal a success.  The function however returned 1 on some non error
> cases, and to cover up this mistake, complained only when fsck_walk() did
> not detect any error.
> 
> To fix this double-bug, make the function return zero on all success
> cases, and also check for non-zero return from fsck_walk() for an error.

I've applied this patch and your small follow-up patch here and the error
indeed disappears. I can't comment on the semantical correctness of the
patch.

Thanks,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

^ permalink raw reply

* Re: [EGIT] Push to GitHub caused corruption
From: Robin Rosenberg @ 2009-08-14  9:19 UTC (permalink / raw)
  To: John Bito; +Cc: git, Shawn O. Pearce
In-Reply-To: <3ae83b000908111552o53189a44h45fc44f124850483@mail.gmail.com>

onsdag 12 augusti 2009 00:52:29 skrev John Bito <jwbito@gmail.com>:
> Running git fsck -full on the repo that I pushed from is clean.
> Here's the git fsck -full from GitHub
>        <mojombo>       git fsck --full
>        <mojombo>       broken link from tree
> f4f9ecd1875938baa42467dfd6a8134d75fe5de4 to tree
> 57548924f1eca854dc8db00844f95d3de2c82957
>        <mojombo>       broken link from tree
> f4f9ecd1875938baa42467dfd6a8134d75fe5de4 to tree
> 3d1f74522c3e7c3c03390fae376446fda6eed306
>        <mojombo>       missing tree 3d1f74522c3e7c3c03390fae376446fda6eed306
>        <mojombo>       missing tree 57548924f1eca854dc8db00844f95d3de2c82957
>        <mojombo>       dangling commit ab6ce47159c1eaff0e4bae19291679267de9f669
> 
> The repo on GitHub is back where it was before the push.  I have a
> copy of the corrupt one from GitHub (358MB tar.gz).  If there's
> something I can do that would help to improve JGit/EGit, please let me
> know.

I guess we'd like to try to recreate the problem, unless we see some obvious clue. What
does the tres with missing links look like, i.e. f4f9ecd1875938baa42467dfd6a8134d75fe5de4.

On the recreation side we'd probably need to recreate a repo that looks somewhat like the
github repo before the crash. We can do that by taking a copy of your existing (good) repo,
reset branches and  clone it. Then push from yet another copy and hopefully it will blow up
again.

Can we be sure it wasn't corrupt before the jgit push? 
Did f4f9ecd1875938baa42467dfd6a8134d75fe5de4 exist before the push or was it new?

-- robin

^ permalink raw reply

* Re: [RFC PATCH 0/2] add a --delete option to git push
From: Jakub Narebski @ 2009-08-14  8:50 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Junio C Hamano, Git List
In-Reply-To: <1250226349-20397-1-git-send-email-srabbelier@gmail.com>

On Fri, 14 August 2009, Sverre Rabbelier wrote:

> This is in reply to a brief conversation I had with jnareb on #git
> about the blogpost "5 things git could learn from hg", or something
> like that (can't find it right now).

Thanks.

It was "Five Features from Mercurial That Would Make Git Suck Less"
http://nubyonrails.com/articles/five-features-from-mercurial-that-would-make-git-suck-less

Those five features were:
1. "<scm> init <directory>" (done)
2. "hg commit --close-branch" vs slightly cryptic 
   "git push origin :refs/heads/feature-tweak", which can be written
   simply as "git push origin :feature-tweak" I think.
   (that is what this patch series is about)
3. Numeric local references, e.g. 18:a432bc and "hg checkout 18"...
   but more realistic example would be "hg checkout 6324" :-P
4. sensible defaults: meaning of revert, staging area (i.e. commit -a)
5. "hg serve" (gitweb and a kind of git-daemon equivalent)

See the alleged blog for details (I call it 'alleged blog' because real 
blog has comments which work, and are shown soon after posting them).

-- 
Jakub Narebski
Poland

^ permalink raw reply

* Re: [PATCH] Work around performance bug in subprocess.Popen.communicate()
From: Karl Wiberg @ 2009-08-14  8:12 UTC (permalink / raw)
  To: Erik Sandberg; +Cc: Catalin Marinas, git
In-Reply-To: <e87cdfda0908140026x21b8aad3x82417d4b1c8016f4@mail.gmail.com>

On 2009-08-14 09:26:06 +0200, Erik Sandberg wrote:

> Wouldn't it be better to only use the write() workaround when
> sys.version indicates that the Python bug may be present, and use
> communicate() properly otherwise?

In my opinion: no. The workaround has no negative effect (since we
know that git is well-behaved). Making it conditional would only make
the code more complex, without gaining us anything.

-- 
Karl Wiberg, Virtutech

^ permalink raw reply

* Re: merging individual files
From: Michael J Gruber @ 2009-08-14  7:55 UTC (permalink / raw)
  To: Chris Marshall; +Cc: git
In-Reply-To: <loom.20090813T192334-7@post.gmane.org>

Chris Marshall venit, vidit, dixit 13.08.2009 22:16:
> Suppose that merging branch dev1 into master would result in three files, f1,
> f2, and f3 being changed, and that I only want to merge the changes for f1 and
> f2 and not the changes for f3 currently.  Later on, I want to accept the f3
> changes.  Suppose further that the changes to f1, f2, and f3 occurred in a
> single commit to branch dev1.
> 
> What is the simplest way to use git to achieve that effect?
> 
> More generally, I need a way to accept the changes for one or two files while
> rejecting the changes for a potentially large number of files, then later on 
> accepting the changes for the large number of files.
> 
> I work at a company where perforce is currently used for all development and am
> trying to work out the git equivalents to all of the perforce flows we use. 
> This workflow is the only one that I am stumped on.
> 
> One solution that occurs to me is to create a temporary branch off of the (most
> recent) common ancestor of master and br1, let's say br2, checkout the files
> from br1 that I want to merge into master and commit those to br2, then merge
> br2 into master:
> 
> git checkout common_ancestor_commit
> git checkout -b br2
> git checkout br1 f1 f2
> git commit
> git checkout master
> git merge br2
> git branch -d br2
> 
> This strikes me as not too bad of a procedure, as long as there is a graceful
> way of determining the most recent common ancestor of br1 and master.  What's
> the simplest way of doing that?
> 

That would be simply git merge-base master br1.

BUT: The main problem here is that git is not file based, but
revision/commit/tree based. In the above, you're basically losing all
the history common_ancestor_commit..br1 which produced br1's version of
f1 and f2, in the sense that a git log master will not show that part of
the history at all.

If it makes sense to change f1 and f2 without changing f3 that probably
means that the pertinent commit should have been split. Is it an option
for you to rewrite br1's history? That would be the most gittish solution.

Alternatively, you could
git checkout master
git merge --no-commit br1
git checkout --ours f3
git commit # add a note about f3 in the commit message

That way at least you have the full history on master. Note that this
will tell git that br1 is merged in, that is you can't use merge later
on to pull in the changes to f3.
Then, when you want to get that change to f3, you can br1's version of
f3 using git checkout br1 -- f3 and committing that to master. But you
should really rewrite br1 ;)

Michael

^ permalink raw reply

* Re: [RFC PATCH 1/2] add a --delete option to git push
From: Junio C Hamano @ 2009-08-14  7:51 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Jakub Narebski, Git List
In-Reply-To: <7vab22ubr5.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> I do not mean that this new feature is useless nor stupid.  Being able to
> say "git push --delete branch1 branch2" matches _a_ mental model (perhaps
> Hg inspired one) _very_ naturally.  There are branches on the other side,
> and there is a special operation called 'delete' that you can inflict on
> them.
>
> But it is a different mental model of how git natively does "push".
> ...
> These are both valid models.  They just do not mix, so let's avoid
> confusion by not allowing both at the same time.

One more thing.  I suspect that adding --delete and nothing else probably
makes things worse than not doing anything.

In a mental model where "push there --delete $branch" is natural, there
are branches on the other side, and when you run 'push' command, you name
the special operation, 'delete', that you would want to inflict on them.

In such a world, there probably are other (perhaps not so special)
operations you can inflict on the branches on the other side as well.
They are probably called something like:

	push there --create $branch $commit
	push there --update $branch $commit

If you give them only --delete without completing the vocabulary by giving
these operations as well, you would force people to mix "git native" world
model (i.e. there is no "mode" nor "opration"; there is only "list of
instructions, each of which encodes the equivalent of 'mode'") with this
Hg-inspired world model.

^ permalink raw reply

* Re: [PATCH] Fix "unpack-objects --strict"
From: Junio C Hamano @ 2009-08-14  7:41 UTC (permalink / raw)
  To: Martin Koegler; +Cc: Frank Lichtenheld, git
In-Reply-To: <20090814060307.GA31721@auto.tuwien.ac.at>

Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:

> What about this check:
>> @@ -184,7 +184,7 @@ static int check_object(struct object *obj, int type, void *data)
>>       if (!obj)
>>  		return 0;
>
> This is neccessary to skip already written objects (eg. blobs,
> obj_list[i].obj == NULL).

You can fix that issue by teaching write_rest() to check what it feeds
check_object(), can't you?

> I'm not sure, if fsck_walk can call check_object with obj == NULL
> under some (rare) conditions. If yes, the return code should be
> changed to 1.

I think that is a sensible change to signal an error regardless.  For
example, fsck_walk_tree() will make a callback to you (meaning, walk()
function pointer points at your check_object() function) like this:

	while (tree_entry(&desc, &entry)) {
		int result;

		if (S_ISGITLINK(entry.mode))
			continue;
		if (S_ISDIR(entry.mode))
			result = walk(&lookup_tree(entry.sha1)->object, OBJ_TREE, data);

so while you are checking a tree object you received, upon hitting a
subtree of that tree, it will lookup_tree() it, and if that tree is
missing, you will be called with NULL.

On top of the previous patch, a fix would look like this, I think, but
please double check.

Thanks.

 builtin-unpack-objects.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index 2522c2d..bae00ea 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -181,7 +181,7 @@ static void write_cached_object(struct object *obj)
 static int check_object(struct object *obj, int type, void *data)
 {
 	if (!obj)
-		return 0;
+		return 1;
 
 	if (obj->flags & FLAG_WRITTEN)
 		return 0;
@@ -209,8 +209,10 @@ static int check_object(struct object *obj, int type, void *data)
 static void write_rest(void)
 {
 	unsigned i;
-	for (i = 0; i < nr_objects; i++)
-		check_object(obj_list[i].obj, OBJ_ANY, 0);
+	for (i = 0; i < nr_objects; i++) {
+		if (obj_list[i].obj)
+			check_object(obj_list[i].obj, OBJ_ANY, 0);
+	}
 }
 
 static void added_object(unsigned nr, enum object_type type,

^ permalink raw reply related

* Re: [PATCH] Fix "unpack-objects --strict"
From: Junio C Hamano @ 2009-08-14  7:31 UTC (permalink / raw)
  To: Martin Koegler; +Cc: Frank Lichtenheld, git
In-Reply-To: <20090814071949.GA2342@auto.tuwien.ac.at>

Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:

> I'm talking on the server side of a push operation (receive-pack), not
> the client side. The patchset should prevent invalid data from
> entering the repository, thereby preventing upload-pack (during further
> fetch operation) and other git programs (eg. called from gitweb) from
> failing/segfaulting.

upload-pack won't feed starting from a random object for a reason, so your
worry is unfounded.

I'd agree gitweb may be a problem.  Ideally it should restrict itself from
anything reachable from the refs of he repository---patches welcome.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox