<div dir="ltr">Woohoo!  Thanks!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 17, 2022 at 1:20 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The code reformatting has now landed into master and release/3.6 <br>
branches per pull requests <a href="https://github.com/OSGeo/gdal/pull/6937" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/pull/6937</a> and <br>
<a href="https://github.com/OSGeo/gdal/pull/6939" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/pull/6939</a>. I've applied it now since the <br>
number of opened pull requests is low. I've split the reformatting in <br>
one commit per modified directory, to avoid potential issues with UI <br>
like github that could have performance issues with a single huge commit.<br>
<br>
For developers, when you'll have resynchronized your local copy with <br>
master, do the following from the top of your clone so that commits with <br>
code reformatting are ignored when using "git blame"<br>
<br>
git config blame.ignoreRevsFile .git-blame-ignore-revs<br>
<br>
This is documented in <br>
<a href="https://gdal.org/development/dev_practices.html#blame-ignore-file" rel="noreferrer" target="_blank">https://gdal.org/development/dev_practices.html#blame-ignore-file</a><br>
<br>
If you have ongoing work in local branches not sent as PR, and that you <br>
intend to submit as a single-commit (or squashed as a single-commit on <br>
merging), do *not* merge master into it, otherwise you'll get conflicts. <br>
But you can apply the following workflow to reformat your modified files <br>
to comply with the formatting rules:<br>
<br>
git fetch upstream master # assuming 'upstream' points to OSGeo/gdal<br>
git checkout -b reformatted_branch  # to not mess up with your original work<br>
git cherry-pick 5d80bc1 2796f2a b9c28a1 3103e5e 48c9ea8cb4  # to fetch <br>
modified pre-commit hook and .clang-format<br>
pip install pre-commit # if not already done<br>
pre-commit install # if not already done<br>
pre-commit run --files foo/bar.cpp bar/baz.h  # put here the list of <br>
your modified files to reformat<br>
<br>
Copy all your modified files as .cpp.new / .h.new ones for example<br>
<br>
Create a new branch from latest master and copy the .cpp.new / .h.new <br>
files on top of the .cpp / .h ones (or use a merge tool if there have <br>
been conflicting changes in between to only merge your changes)<br>
<br>
If you want your work to be merged as multiple commits, then I'm afraid <br>
you'll have to endure some pain to create copies of modified files by <br>
each commit in their before and after state, reformat those different <br>
versions, generate patches with the diff between the reformated <br>
before/after versions, and use those diffs with git apply to recreate <br>
commits in a new branch on top of latest master<br>
<br>
Even<br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>