<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 21, 2013 at 10:08 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="im">> If anyone wants to do this with git, I can show you how. I think you'll find it's not as nice to work with as you may have hoped, not through a failing of the tool, but because we also communicate through side channels.<br>

<br>
</div></div>Well I think it is insane in 2012 that we all need to stare at the exact same ASCII strings with the exact same placement (each of you thinks is wrong) when we develop shared code, so please teach me how. </blockquote>
<div><br></div><div style>This has a nice picture of the way clean clean and smudge filters work.</div><div style><br></div><div style><a href="http://git-scm.com/book/ch7-2.html#Keyword-Expansion">http://git-scm.com/book/ch7-2.html#Keyword-Expansion</a><br>
</div><div style><br></div><div style>The idea is that you tell git to use your filter in a place that is not checked into the repository:</div><div style><br></div><div style>echo '*.c filter=petscfmt' >> .git/info/attributes</div>
<div style><br></div><div style>(If you wanted it to be checked in, you'd put it in .gitattributes, but we don't want that now.) Then set what the petscfmt filter does</div><div style><br></div><div style>git config filter.petscfmt.clean 'uncrustify read from stdin and write clean version to stdout'</div>
<div style>git config filter.petscfmt.smudge 'uncrustify read from stdin and write smudged version to stdout'</div><div style><br></div><div style>The smudged version is whatever the user wants to interact with, the cleaned version is whatever should go in the PETSc repository. (You can also just edit these filters in .git/config.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Can this be done through some bridge that uses the current hg PETSc repository?<br>
</blockquote><div><br></div><div style>I've been using gitifyhg [1] casually for a couple weeks and I've now moved to it for primary PETSc development. You can clone with<br><br>git clone gitifyhg::ssh://<a href="http://hg@bitbucket.org/petsc/petsc-dev">hg@bitbucket.org/petsc/petsc-dev</a> petsc-dev-git</div>
<div style><br></div><div style>(or, if you want a quick clone, "git clone git@bitbucket.org:jedbrown/petsc-git")</div><div style><br></div><div style>[1] <a href="https://github.com/buchuki/gitifyhg">https://github.com/buchuki/gitifyhg</a><br>
</div></div></div></div>