<div class="gmail_quote">On Thu, Jun 9, 2011 at 21:21, Iulian Grindeanu <span dir="ltr"><<a href="mailto:iulian@mcs.anl.gov">iulian@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":e9">I reproduced the error, I didn't install yet your code.<br>
(I just used imesh load, after setting the table)<br>
/*<br>
* <span class="il">load_adj</span>.cpp<br>
*<br>
* Created on: Jun 9, 2011<br>
*/<br>
<br>
#include "TestRunner.hpp"</div></blockquote></div><br><div>It's not at all clear how you compile this because it depends through TestRunner.hpp on a bunch of internal files that are not installed. In some sense, it look like it is only buildable within the source tree. I see some ways to improve this process:</div>
<div><br></div><div>1. Install the necessary files so that the tests and examples can be relocated and compiled using the standard build rules.</div><div><br></div><div>2. Make a test of the bug to run in the automated tests. Perhaps that is excessive in this case, but bear in mind that untested code is usually broken.</div>
<div><br></div><div>3. Use a distributed SCM with local branches so that you can easily manage the patch that adds the example/test code. This can be a tiny amount of work. For example, you could just modify the files in-place, then</div>
<div><br></div><div>$ git checkout -b load-adj-bug</div><div>$ git add load_adj.cpp Makefile.am</div><div>$ git commit -m'Example demonstrating bug in iMesh_load() after iMesh_setAdjTable()'</div><div>$ git send-email --to jed@59A2.org HEAD^</div>
<div>$ git checkout master</div><div><br></div><div>The last line leaves you back at your clean state without the clutter of this example that you don't want to push upstream. The "load-adj-bug" branch lives on, strictly within your local repository, until you delete it (or merge it), but it's out of the way. If you want to test it against a more recent copy of MOAB, you can</div>
<div><br></div><div>$ git rebase master load-adj-bug # re-applies the patch (series) to "master"</div><div>$ make</div><div><br></div><div><br></div><div>While typing this, I have followed the same procedure in the terminal, the patch for which is attached as a demonstration of the concept. It was about 15 seconds to create and attach the patch and I can apply a patch like this from email in about five seconds. The difference between minutes and seconds from email to running code is significant, in my opinion.</div>
<div><br></div><div>Notes:</div><div>1. Subversion can create a patch too, but you can't commit it without sending it upstream, so it's not versioned and recoverable. It's also completely non-intelligent (because the data model doesn't have the semantic information) if you want to reapply the patch on a later version of the source tree.</div>
<div><br></div><div>2. Git can pull and push from a subversion repository so using git locally is independent of using git on the upstream host.</div>