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.

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]

Reply via email to