git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: picca <picca@synchrotron-soleil.fr>
Cc: git@vger.kernel.org
Subject: Re: interaction between cvsimport and cvsexportcommit
Date: Fri, 8 Jun 2007 17:11:57 +0200	[thread overview]
Message-ID: <200706081711.57463.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <20070608154222.56870830@localhost.localdomain>

fredag 08 juni 2007 skrev picca:
> Hello
> 
> In the institut where I am working www.synchrotron-soleil.fr, the
> "computing department" use CVS for all their projects. As I am not from
> this department (I am a scientist), I can use my own tools and git is
> one of them.
> Nevertheless I need to interact with them (I am writting a C++
> library to control diffractometers) so I use cvsimport and
> cvsexportcommit.
> 
> The point is that I find this over complicate compare to my git
> day-to-day experience.
> 
> I do not understand why cvsimport and cvsexportcommit do not
> interact nicelly to ease git <-> cvs.

git-cvsexportcommit was written (I assume, since I did not actually write the
original version) to solve a problem and not to be a perfect solution. 

Later I found it didn't do what I needed so I made improvements (to solve /my/ 
problems, mainly in reliability and completeness (binaries, add remove, all 
or nothing). The rest was just inconvenience and I did not consider my 
solution to that universally viable so I didn't include it in in 
cvsexportcommit. 

> For example as a neeby I expect this to work out of the box
> after the first cvsimport
>
> git cvsimport
> do some work
> git commit -a
> git cvsexportcommit

This assume you really want to export all. I don't, but I agree that it should
in principle be this simple. Patches anyone?

> and that's all
> 
> Instead of this we have this:
> 
> $ export GIT_DIR=~/project/.git
> $ cd ~/project_cvs_checkout
> $ git-cvsexportcommit -v <commit-sha1>
> $ cvs commit -F .mgs <files>
> 
> or even worse
> 
> $ export GIT_DIR=~/project/.git
> $ cd ~/project_cvs_checkout
> $ git-cherry cvshead myhead | sed -n 's/^+ //p' | xargs -l1
> git-cvsexportcommit -c -p -v

> 
> what is missing in cvsexportcommit and cvsimport to lower the git <->
> cvs barrier.

Here is my script that I use to export. It takes as arguments a number of 
commits or stgit patches. Note that hardcoded path to the CVS checkout...

Here's an exercise to the reader: Modify git-cvsexportcommit so it takes the 
path to the CVS checkout from 1) a parameter (e.g. -w /checkout) or 2) a git 
config variable. That will get get us a small step closer. It will be fairly 
easy.

Cheers
	-- robin

--------------------------8<-------------------------
#!/bin/bash -ex

if [ "$1" = "-p" ]
then
        P="-p $2"
        shift 2
fi
export GIT_DIR=$(git-rev-parse --git-dir)
GIT_DIR=$(cd $GIT_DIR;pwd)
cd ../Iris.CVSsynconly
for patch in "$@"
do
        if commit=$(git-rev-parse $patch 2>/dev/null); then
            git-cvsexportcommit-u $(echo $P) -c $commit
        else
            head=$(git-symbolic-ref HEAD)
            br=${head#refs/heads/}
            if commit=$(git-rev-parse refs/patches/$br/$patch); then
                git-cvsexportcommit -u $(echo $P) -c $commit
            fi
        fi
done

      reply	other threads:[~2007-06-08 15:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 13:42 interaction between cvsimport and cvsexportcommit picca
2007-06-08 15:11 ` Robin Rosenberg [this message]

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

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

  git send-email \
    --in-reply-to=200706081711.57463.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=picca@synchrotron-soleil.fr \
    /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.
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 NNTP newsgroup(s).