git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
To: git@vger.kernel.org
Cc: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Subject: [PATCH 00/20] git-cvsserver: add support for cvs "-r" refs
Date: Sat, 13 Oct 2012 23:42:13 -0600	[thread overview]
Message-ID: <1350193353-19210-1-git-send-email-mmogilvi_git@miniinfo.net> (raw)

This patch series improves git-cvsserver's handling and support
of refspecs requested by the client.

Disclaimer: I don't actually intend to use any of this myself.
I suspect no one really cares about cvsserver (I don't even really
care myself).  See also below.

-----------
Features:
-----------

1. You can now switch branches with "cvs update -r REFSPEC",
   "cvs update -A", "cvs checkout -r ...", etc.  It becomes sticky for
   plain "cvs update" until reset (like standard CVS).  You can
   add/remove/commit to other branches updated this way.
      The old "cvs checkout moduleThatIsReallyABranch" technique
   still works; it becomes the main head branch from CVS's perspective.
   CVS revision number allocation is not synchronized between different
   modules checkout out in this old way.
2. You can create arbitrary diffs and patches with commands such as
   "cvs diff -r REFSPEC [-r REFSPEC]", over files, directories, or whole
   trees.  (It used to effectively be limited to individual files,
   and CVS-specific revision numbers (no tags).)
3. The REFSPECs can refer to CVS revision numbers, git commit IDs,
   git tags, git branches, or other git refspecs.  There is an escape
   mechanism you can use if your CVS client won't let you feed in
   invalid CVS tags that contain ".", "/", or similar characters.
4. No DB schema changes for now.  You can downgrade back to previous
   versions, and the only things that may break are existing sandboxes
   that were explicitly using the new features (had been set to a sticky
   branch with cvs update -r).

-----------
Limitations:
-----------

1. CVS revision numbers (other than those on the main
   branch) are not "real".  Instead, they are git commit ID's
   encoded to look like valid CVS revision numbers.  Subsequent versions
   do not have related CVS revision numbers at all.
   (Most of the code in this patch series would probably still be
   useful if someone enhances CVS revision numbers in the future.)
2. "CVS log" does not attempt to show versions on other than the "main"
   branch, even if a non-main branch is currently checked out.  It also
   doesn't show any branch or tag names.
3. Performance: When updating, it attempts to find a main-branch
   CVS revision number, or failing that, restrict itself to
   the specific git commit ID where the file most recently
   changed.  Searching for these (on an individual file
   basis) can currently be rather expensive, and probably
   doesn't scale well.  There are several possible ways it might be
   optimized, but no optimization has been done.  See comments in the
   patch.
4. I've done almost no testing, other than running both old and new
   unit tests (t9400, t9401, and t9402).
5. Testing Eclipse: I needed to make some changes to the
   details of what cvs update sends for the CVS protocol, even
   in the non-branch case.  I think I've made it closer to being
   the same as a standard CVS server (based on some captured
   conversations), but it still isn't "perfect".
   With luck, reputedly-finicky clients like Eclipse will still
   work correctly, but I haven't actually verified this.
6. Pre-existing issue: There are cases where the server will ask the
   client to replace user-modified files without saving those modifications
   off to the side first (.# files).  I haven't fixed these, but the fourth
   patch adds a comment about one such case.
7. Coding style: git-cvsserver mostly doesn't use git's main coding style.
   In fact, different parts of the file seem to use different
   coding styles.  I've made a superficial attempt to have each change
   keep relatively close to nearby coding style.  But larger chunks
   of code tend to stick to a hybrid of what seems most predominant
   in the file as a whole, and my own personally preferred style.

-----------
Disclaimer:
-----------

I don't actually intend to use any of this myself.

I started it a few years ago under the theory that a more accurate
emulation of CVS would make it easier to convince the team at $DAYJOB
to switch to git, but we eventually switched without using
git-cvsserver at all.  I've been working on this on and off (mostly
off) out of a vague sense of stubborness.

Depending on overall interest in this feature (most likely not
much) vs how many adjustments maintainers want, I might gradually get
this into a ready-to-include state (possibly weeks or months).  But
my primary goal here is just to have it available publicly
somewhere (like the mailing list) where someone who really
wants features like these can use these patches as a starting
point.  That said, perhaps some of the trivial cleanup
patches could go in now?

-------------------------------

Matthew Ogilvie (20):
  cvsserver t9400: add basic 'cvs log' test
  cvsserver: removed unused sha1Or-k mode from kopts_from_path
  cvsserver: add comments about database schema/usage
  cvsserver update: comment about how we shouldn't remove a
    user-modified file
  cvsserver: remove unused functions _headrev and gethistory
  cvsserver: clean up client request handler map comments
  cvsserver: split up long lines in req_{status,diff,log}
  cvsserver: use whole CVS rev number in-process; don't strip "1."
    prefix
  cvsserver: cvs add: do not expand directory arguments
  cvsserver status: provide real sticky info
  cvsserver: factor out git-log parsing logic
  cvsserver: cleanup extra slashes in filename arguments
  cvsserver: define a tag name character escape mechanism
  cvsserver: add misc commit lookup, file meta data, and file listing
    functions
  cvsserver: implement req_Sticky and related utilities
  cvsserver: generalize getmeta() to recognize commit refs
  cvsserver: Add version awareness to argsfromdir
  cvsserver: support -r and sticky tags for most operations
  cvsserver: add t9402 to test branch and tag refs
  cvsserver Documentation: new cvs ... -r support

 Documentation/git-cvsserver.txt |   37 +
 git-cvsserver.perl              | 2433 +++++++++++++++++++++++++++++++--------
 t/t9400-git-cvsserver-server.sh |   72 +-
 t/t9401-git-cvsserver-crlf.sh   |   35 +
 t/t9402-git-cvsserver-refs.sh   |  558 +++++++++
 5 files changed, 2624 insertions(+), 511 deletions(-)
 create mode 100755 t/t9402-git-cvsserver-refs.sh

-- 
1.7.10.2.484.gcd07cc5

             reply	other threads:[~2012-10-14  5:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-14  5:42 Matthew Ogilvie [this message]
2012-10-14  5:42 ` [PATCH 01/20] cvsserver t9400: add basic 'cvs log' test Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 02/20] cvsserver: removed unused sha1Or-k mode from kopts_from_path Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 03/20] cvsserver: add comments about database schema/usage Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 04/20] cvsserver update: comment about how we shouldn't remove a user-modified file Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 05/20] cvsserver: remove unused functions _headrev and gethistory Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 06/20] cvsserver: clean up client request handler map comments Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 07/20] cvsserver: split up long lines in req_{status,diff,log} Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 08/20] cvsserver: use whole CVS rev number in-process; don't strip "1." prefix Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 09/20] cvsserver: cvs add: do not expand directory arguments Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 10/20] cvsserver status: provide real sticky info Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 11/20] cvsserver: factor out git-log parsing logic Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 12/20] cvsserver: cleanup extra slashes in filename arguments Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 13/20] cvsserver: define a tag name character escape mechanism Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 14/20] cvsserver: add misc commit lookup, file meta data, and file listing functions Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 15/20] cvsserver: implement req_Sticky and related utilities Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 16/20] cvsserver: generalize getmeta() to recognize commit refs Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 17/20] cvsserver: Add version awareness to argsfromdir Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 18/20] cvsserver: support -r and sticky tags for most operations Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 19/20] cvsserver: add t9402 to test branch and tag refs Matthew Ogilvie
2012-10-14  5:42 ` [PATCH 20/20] cvsserver Documentation: new cvs ... -r support Matthew Ogilvie
2012-10-16 19:25 ` [PATCH 00/20] git-cvsserver: add support for cvs "-r" refs Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350193353-19210-1-git-send-email-mmogilvi_git@miniinfo.net \
    --to=mmogilvi_git@miniinfo.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).