git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/3] git-cvsserver: Add support for some binary files

From
MOMatthew Ogilvie <mmogilvi_git@miniinfo.net>
Date
May 15, 2008, 04:35 UTC
Message-ID
<1210826148-8708-1-git-send-email-mmogilvi_git@miniinfo.net>

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
Next: Matthew Ogilvie
Message 1 of 11 in “git-cvsserver: Add support for some binary files”
  1. 0/3 git-cvsserver: Add support for some binary filesMatthew Ogilvie, May 15, 2008
  2. 1/3 git-cvsserver: add mechanism for managing working tree and current directoryMatthew Ogilvie, May 15, 2008
  3. 2/3 implement gitcvs.usecrlfattrMatthew Ogilvie, May 15, 2008
  4. 3/3 git-cvsserver: add ability to guess -kb from contentsMatthew Ogilvie, May 15, 2008
  5. Junio C HamanoMay 17, 2008
  6. Matthew OgilvieMay 18, 2008
  7. Martin LanghoffMay 18, 2008
  8. Matthew OgilvieMay 19, 2008
  9. Johannes SchindelinMay 19, 2008
  10. Matthew OgilvieMay 20, 2008
  11. Martin LanghoffMay 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.