On Fri, Sep 2, 2016 at 2:49 AM, Volker Diels-Grabsch <[email protected]> wrote:
> Matt Broadstone schrieb:
> > Would it be possible to fix up the .gitattributes for the qpid-cpp git
> > repository? I'm having an incredibly hard time updating the sources for
> the
> > debian packaging because there are many mixed in CRLF files throughout
> the
> > repository (seemingly without rhyme or reason either, i.e. not all .ps1
> or
> > .bat files have CRLF line endings). Anyone know how to clean this up
> easily?
>
> This sounds like it should be really cleaned up in the repository and
> not just on packaging. Maybe the following helps. This is my general
> way to cleanup sources, i.e. not specific for qpid-cpp.
>
>
Yes this was my proposal, by the time we get to the packaging for the
release the damage has been done afaict.
For reference I had to use this sort of frankenstein gitattributes to get
to a place where I could move forward with debian builds:
*.ico binary
*.bmp binary
*.sln eol=crlf
*.vcproj eol=crlf
bindings/qpid/dotnet/**/* eol=crlf
packaging/winsdk/**/* eol=crlf
packaging/windows/**/* eol=crlf
src/qpid/store/ms-sql/**/* eol=crlf
src/windows/**/* eol=crlf
src/CMakeWinVersions.cmake eol=crlf
INSTALL-WINDOWS.txt eol=crlf
docs/design/windows_clfs_store_design.txt eol=crlf
managementgen/qmfgen/templates/CMakeLists.cmake eol=crlf
src/tests/background.ps1 eol=crlf
src/tests/find_prog.ps1 eol=crlf
bindings/qpid/dotnet/src/Logger.h eol=crlf
packaging/winsdk/bld-winsdk.ps1 eol=crlf
bindings/qpid/dotnet/CMakeLists.txt eol=lf
bindings/qpid/dotnet/examples/csharp.example.helloworld/csharp.example.helloworld.cs
eol=lf
packaging/windows/LICENSE.rtf eol=lf
not ideal
> You can cleanup e.g. all "*.cpp" and "*.in" files with a single command:
>
> cd qpid-cpp-0.34
> find * -type f -name '*.cpp' -exec sed 's/\r//g' -i {} \;
> find * -type f -name '*.in' -exec sed 's/\r//g' -i {} \;
>
> These command could be run once for the whole code base and committed.
> Also, an appropriate .gitattributes settings file would help to
> prevent this is the future. Still, it may make sense to put this into
> a dev script or into the Makefile as separate target, so it could be
> re-run in case these issues are accidentally re-introduced.
>
> Variants:
>
> You could pack these commands into a single command via
> "... -name '*.cpp' -o -name '*.in' ...",
> but I prefer multiple commands for better readability.
>
> You could also run this without "-name '*.cpp'" to convert _all_
> files, but that would break binary files such as "qpid-icon.png" which
> you would have to revert manually after the command.
>
> You could use "find ." instead of "find *", but then it would modify
> files under '.git', '.svn' or similar toplevel subdirectories, thus
> killing your version control information. So you would have to backup
> these directories before running the command. On the other hand,
> "find ." would catch toplevel dot-files such as ".gitignore", which
> "find *" can't catch.
>
> HTH,
> Volker
>
> --
> Volker Diels-Grabsch
> ----<<<((()))>>>----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>