{"thread":{"id":"8504","subject":"interaction between cvsimport and cvsexportcommit","startedAt":"2007-06-08T13:42:22Z","lastAt":"2007-06-08T15:11:57Z","messageCount":2,"participants":["picca","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"44349","messageId":"20070608154222.56870830@localhost.localdomain","threadId":"8504","inReplyTo":null,"subject":"interaction between cvsimport and cvsexportcommit","fromName":"picca","fromEmail":"picca@synchrotron-soleil.fr","sentAt":"2007-06-08T13:42:22Z","receivedAt":"2007-06-08T13:42:22Z","isPatch":false,"sender":{"key":"picca@synchrotron-soleil.fr","avatar":null},"body":"Hello\n\nIn the institut where I am working www.synchrotron-soleil.fr, the\n\"computing department\" use CVS for all their projects. As I am not from\nthis department (I am a scientist), I can use my own tools and git is\none of them.\nNevertheless I need to interact with them (I am writting a C++\nlibrary to control diffractometers) so I use cvsimport and\ncvsexportcommit.\n\nThe point is that I find this over complicate compare to my git\nday-to-day experience.\n\nI do not understand why cvsimport and cvsexportcommit do not\ninteract nicelly to ease git <-> cvs.\nFor example as a neeby I expect this to work out of the box\nafter the first cvsimport\n\ngit cvsimport\ndo some work\ngit commit -a\ngit cvsexportcommit\n\nand that's all\n\nInstead of this we have this:\n\n$ export GIT_DIR=~/project/.git\n$ cd ~/project_cvs_checkout\n$ git-cvsexportcommit -v <commit-sha1>\n$ cvs commit -F .mgs <files>\n\nor even worse\n\n$ export GIT_DIR=~/project/.git\n$ cd ~/project_cvs_checkout\n$ git-cherry cvshead myhead | sed -n 's/^+ //p' | xargs -l1\ngit-cvsexportcommit -c -p -v\n\n\nwhat is missing in cvsexportcommit and cvsimport to lower the git <->\ncvs barrier.\n\nThank you.\n\nFrederic\n\nPS: Sorry for my poor english.\n"},{"id":"44353","messageId":"200706081711.57463.robin.rosenberg.lists@dewire.com","threadId":"8504","inReplyTo":"20070608154222.56870830@localhost.localdomain","subject":"Re: interaction between cvsimport and cvsexportcommit","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-06-08T15:11:57Z","receivedAt":"2007-06-08T15:11:57Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"fredag 08 juni 2007 skrev picca:\n> Hello\n> \n> In the institut where I am working www.synchrotron-soleil.fr, the\n> \"computing department\" use CVS for all their projects. As I am not from\n> this department (I am a scientist), I can use my own tools and git is\n> one of them.\n> Nevertheless I need to interact with them (I am writting a C++\n> library to control diffractometers) so I use cvsimport and\n> cvsexportcommit.\n> \n> The point is that I find this over complicate compare to my git\n> day-to-day experience.\n> \n> I do not understand why cvsimport and cvsexportcommit do not\n> interact nicelly to ease git <-> cvs.\n\ngit-cvsexportcommit was written (I assume, since I did not actually write the\noriginal version) to solve a problem and not to be a perfect solution. \n\nLater I found it didn't do what I needed so I made improvements (to solve /my/ \nproblems, mainly in reliability and completeness (binaries, add remove, all \nor nothing). The rest was just inconvenience and I did not consider my \nsolution to that universally viable so I didn't include it in in \ncvsexportcommit. \n\n> For example as a neeby I expect this to work out of the box\n> after the first cvsimport\n>\n> git cvsimport\n> do some work\n> git commit -a\n> git cvsexportcommit\n\nThis assume you really want to export all. I don't, but I agree that it should\nin principle be this simple. Patches anyone?\n\n> and that's all\n> \n> Instead of this we have this:\n> \n> $ export GIT_DIR=~/project/.git\n> $ cd ~/project_cvs_checkout\n> $ git-cvsexportcommit -v <commit-sha1>\n> $ cvs commit -F .mgs <files>\n> \n> or even worse\n> \n> $ export GIT_DIR=~/project/.git\n> $ cd ~/project_cvs_checkout\n> $ git-cherry cvshead myhead | sed -n 's/^+ //p' | xargs -l1\n> git-cvsexportcommit -c -p -v\n\n> \n> what is missing in cvsexportcommit and cvsimport to lower the git <->\n> cvs barrier.\n\nHere is my script that I use to export. It takes as arguments a number of \ncommits or stgit patches. Note that hardcoded path to the CVS checkout...\n\nHere's an exercise to the reader: Modify git-cvsexportcommit so it takes the \npath to the CVS checkout from 1) a parameter (e.g. -w /checkout) or 2) a git \nconfig variable. That will get get us a small step closer. It will be fairly \neasy.\n\nCheers\n\t-- robin\n\n--------------------------8<-------------------------\n#!/bin/bash -ex\n\nif [ \"$1\" = \"-p\" ]\nthen\n        P=\"-p $2\"\n        shift 2\nfi\nexport GIT_DIR=$(git-rev-parse --git-dir)\nGIT_DIR=$(cd $GIT_DIR;pwd)\ncd ../Iris.CVSsynconly\nfor patch in \"$@\"\ndo\n        if commit=$(git-rev-parse $patch 2>/dev/null); then\n            git-cvsexportcommit-u $(echo $P) -c $commit\n        else\n            head=$(git-symbolic-ref HEAD)\n            br=${head#refs/heads/}\n            if commit=$(git-rev-parse refs/patches/$br/$patch); then\n                git-cvsexportcommit -u $(echo $P) -c $commit\n            fi\n        fi\ndone\n"}]}