This series of patches extends git-cvsserver to support telling the CVS client to set the -kb (binary) mode for files that git considers to be binary (and not for text files). It includes updates to documentation and tests. By default the new binary support is not enabled. To enable it, you should set "gitcvs.usecrlfattr" and "gitcvs.allbinary=guess", as described in the updated documentation. ----------------- This patch series is usable now, but there are some things I'm not sure about, and things that could still use improvement: 1. As currently implemented, the second patch (for checking file attributes) forks a separate instance of git-check-attr for every file it needs to look up in the repository. Each invocation involves reading the index file, so things may get kind of slow if there are a whole lot of files in the repository. It might be worth reorganizing things so that it can ask about multiple files in one invocation of git-check-attr, but such a change would probably be invasive enough to warrant a separate patch. 2. Is there a better/more intuitive way of configuring this? Perhaps "gitcvs.autocrlf" that is similar to "core.autocrlf"? But it seems unfriendly to drop default and "gitcvs.allbinary" modes; some users may have set things up such that those modes are needed. 3. I'm not sure about the best way to handle repeatably changing current directory. The first patch tries to make a somewhat general mechanism to manage it, but I keep thinking in the back of my mind that it might be better to set up a working directory first thing, and then minimize any further directory changes after that. Does anyone have any thoughts about this? 4. Possibly additional enhancements including: a. Strip out '\r' from "text" files, so when the CVS client adds '\r', you don't wind up with double '\r's per line. b. Additional conversions like in convert.c, done on server side. Including safecrlf, smudge/clean filters, etc. c. If a new .gitattributes file is sent by the client, use it in preference over the one from the most recent commit. As it is now, a user might need to commit the new .gitattributes before committing anything else. This might be much easier if a new overall design for setting up and using a working directory was used (see above). 5. It might make things clearer to refactor the special case transmitfile() modes to be implemented as separate functions that use open_blob_or_die(). Probably a separate patch, if done at all. 6. Additional tweaks to the documentation? For example, should there be a note on "core.autocrlf" that binary support in emulation tools may use other configuration variables... Matthew Ogilvie (3): git-cvsserver: add mechanism for managing working tree and current directory implement gitcvs.usecrlfattr git-cvsserver: add ability to guess -kb from contents Documentation/config.txt | 26 ++- Documentation/git-cvsserver.txt | 32 ++- git-cvsserver.perl | 500 ++++++++++++++++++++++++++++++++++----- t/t9401-git-cvsserver-crlf.sh | 337 ++++++++++++++++++++++++++ 4 files changed, 826 insertions(+), 69 deletions(-) create mode 100755 t/t9401-git-cvsserver-crlf.sh -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html