* Re: Make CVS default revision controller
2003-05-22 11:46 ` marcuirl
@ 2003-05-22 13:53 ` Stefan Monnier
2003-05-22 15:24 ` Kai Großjohann
2003-05-22 14:29 ` Burton Samograd
` (2 subsequent siblings)
3 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2003-05-22 13:53 UTC (permalink / raw)
> All I want is to put .emacs, .gnus etc under CVS now that I am more
> confident using it. And do this without importing the entire ${HOME}
> directory structure. A work around I have thought is to ln -s these files
> to others in a config/ But that will not fix the problem when in
> another directory I want to CVS just one file in that directory?
Just tell us what commands would do what you want Emacs to do.
Emacs is not magical.
I.e. the difficulty is not just with Emacs but with CVS (it would be the
same with Subversion, arch, or pretty much any version control system other
than RCS and SCCS ;-).
One thing you could do is the following:
> mkdir $CVSROOT/home
> cd
> cvs -d $CVSROOT checkout -d temphome home
> mv temphome/CVS .
> rmdir temphome
[ Beware, tho: CVS does not like it when $CVSROOT and a workarea overlap,
so make sure that $CVSROOT is not somewhere under your home dir ].
so that your home directory is now "a CVS workarea for the `home' module".
Emacs will now do what you want under ~/ but it still won't do what you
want in subdirectories. We could probably hack vc-cvs.el to consider
that a subdirectory of a CVS-managed directory is also managed by CVS
and have vc-cvs.el transparently `cvs add' the parent subdir(s) before
adding the file.
The patch below (guaranteed 100% untested) might do that (you'll also need
to change vc-handled-backends to put CVS before RCS so as to indicate your
preferences).
Stefan
PS: The patch was made against the Emacs-CVS version of vc-cvs.el.
--- vc-cvs.el.~1.60.~ Fri May 9 10:32:01 2003
+++ vc-cvs.el Thu May 22 09:48:40 2003
@@ -286,6 +286,10 @@
`vc-register-switches' and `vc-cvs-register-switches' are passed to
the CVS command (in that order)."
+ (if (and (not (vc-cvs-responsible-p file))
+ (vc-cvs-could-register file))
+ ;; Register the directory if needed.
+ (vc-cvs-register (directory-file-name (file-name-directory file))))
(apply 'vc-cvs-command nil 0 file
"add"
(and comment (string-match "[^\t\n ]" comment)
@@ -299,9 +303,18 @@
file
(file-name-directory file)))))
-(defalias 'vc-cvs-could-register 'vc-cvs-responsible-p
+(defun vc-cvs-could-register (file)
"Return non-nil if FILE could be registered in CVS.
-This is only possible if CVS is responsible for FILE's directory.")
+This is only possible if CVS is managing FILE's directory or one of
+its parents."
+ (let ((dir file))
+ (while (and (stringp dir)
+ (not (equal dir (setq dir (file-name-directory dir))))
+ dir)
+ (setq dir (if (file-directory-p
+ (expand-file-name "CVS/Entries" dir))
+ t (directory-file-name dir))))
+ (eq dir t)))
(defun vc-cvs-checkin (file rev comment)
"CVS-specific version of `vc-backend-checkin'."
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 13:53 ` Stefan Monnier
@ 2003-05-22 15:24 ` Kai Großjohann
0 siblings, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2003-05-22 15:24 UTC (permalink / raw)
"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
> One thing you could do is the following:
>
> > mkdir $CVSROOT/home
> > cd
> > cvs -d $CVSROOT checkout -d temphome home
> > mv temphome/CVS .
> > rmdir temphome
>
> [ Beware, tho: CVS does not like it when $CVSROOT and a workarea overlap,
> so make sure that $CVSROOT is not somewhere under your home dir ].
>
> so that your home directory is now "a CVS workarea for the `home' module".
> Emacs will now do what you want under ~/ but it still won't do what you
> want in subdirectories.
Why not just import the whole homedir using cvs import, then check it
out under $HOME again. Then the whole home dir is under CVS control.
This, however, is probably not what the OP intended. But it's the
way CVS works. So it is clear where the problem is.
--
This line is not blank.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 11:46 ` marcuirl
2003-05-22 13:53 ` Stefan Monnier
@ 2003-05-22 14:29 ` Burton Samograd
2003-05-22 15:26 ` Kai Großjohann
2003-05-22 14:58 ` Harald Maier
2003-05-22 15:22 ` Kai Großjohann
3 siblings, 1 reply; 18+ messages in thread
From: Burton Samograd @ 2003-05-22 14:29 UTC (permalink / raw)
marcuirl <marcuirl@imap.no2this.cc> writes:
> kai.grossjohann@gmx.net (Kai Großjohann) writes:
> How do you go about setting up an `empty' repository?
>From the cvs info file:
---------------------------------------------------------------------
For a new project, the easiest thing to do is probably to create an
empty directory structure, like this:
$ mkdir tc
$ mkdir tc/man
$ mkdir tc/testing
After that, you use the `import' command to create the
corresponding
(empty) directory structure inside the repository:
$ cd tc
$ cvs import -m "Created directory structure" yoyodyne/DIR yoyo
start
Then, use `add' to add files (and new directories) as they appear.
Check that the permissions CVS sets on the directories inside
`$CVSROOT' are reasonable.
---------------------------------------------------------------------
> All I want is to put .emacs, .gnus etc under CVS now that I am more
> confident using it. And do this without importing the entire ${HOME}
> directory structure. A work around I have thought is to ln -s these files
> to others in a config/ But that will not fix the problem when in
> another directory I want to CVS just one file in that directory?
I would reccomend just using RCS if you want that. CVS is a bit picky
sometimes and RCS offers most of the same features (CVS was built off
of RCS initially). Instead of storing in CVSROOT it just puts the
version files in ./RCS directories, and provides full merging, version
diffing, branching, etc. Don't throw away old tools just so you can
use trendy software when won't even need 10% of the features it
provides.
If you are convinced you need CVS I would reccomend reading the info
docs and googling for "The CVS Book". CVS is a bit of black magic and
you need to read up on how to use it before you can really get
anything out of it.
> Am I being really thick or something, educate me and help the others,
> please.
Nope, not thick. Just need to do a bit of reading :)
--
burton samograd
kruhft@kruhft.dyndns.org
http://kruhftwerk.dyndns.org
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 14:29 ` Burton Samograd
@ 2003-05-22 15:26 ` Kai Großjohann
2003-05-22 17:21 ` Edward O'Connor
2003-05-22 22:35 ` Benjamin Rutt
0 siblings, 2 replies; 18+ messages in thread
From: Kai Großjohann @ 2003-05-22 15:26 UTC (permalink / raw)
Burton Samograd <kruhft@hotmail.com> writes:
> I would reccomend just using RCS if you want that. CVS is a bit picky
> sometimes and RCS offers most of the same features (CVS was built off
> of RCS initially). Instead of storing in CVSROOT it just puts the
> version files in ./RCS directories, and provides full merging, version
> diffing, branching, etc. Don't throw away old tools just so you can
> use trendy software when won't even need 10% of the features it
> provides.
FWIW, I use CVS for my config files. Then it is very easy to use
them on different machines. I love it.
But I use the symlink trick. I wrote a Makefile that creates all the
necessary symlinks, and I use "make install" from time to time
whenever I think that the symlinks should be corrected.
--
This line is not blank.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 15:26 ` Kai Großjohann
@ 2003-05-22 17:21 ` Edward O'Connor
2003-05-22 22:35 ` Benjamin Rutt
1 sibling, 0 replies; 18+ messages in thread
From: Edward O'Connor @ 2003-05-22 17:21 UTC (permalink / raw)
> FWIW, I use CVS for my config files. Then it is very easy to use them
> on different machines. I love it.
>
> But I use the symlink trick. I wrote a Makefile that creates all the
> necessary symlinks, and I use "make install" from time to time
> whenever I think that the symlinks should be corrected.
This is what I do as well. It's exceedingly good stuff.
--
Edward O'Connor
oconnor@soe.ucsd.edu
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 15:26 ` Kai Großjohann
2003-05-22 17:21 ` Edward O'Connor
@ 2003-05-22 22:35 ` Benjamin Rutt
2003-05-23 6:11 ` Kai Großjohann
1 sibling, 1 reply; 18+ messages in thread
From: Benjamin Rutt @ 2003-05-22 22:35 UTC (permalink / raw)
kai.grossjohann@gmx.net (Kai Großjohann) writes:
> FWIW, I use CVS for my config files. Then it is very easy to use
> them on different machines. I love it.
>
> But I use the symlink trick. I wrote a Makefile that creates all the
> necessary symlinks, and I use "make install" from time to time
> whenever I think that the symlinks should be corrected.
When you say "symlink trick", do you mean that you have a directory
under CVS control, somewhere, anywhere, and the contents of that
directory are a bunch of symlinks which link to the real config file
location? This way, you have a single place to go (the above
mentioned directory) to 'cvs update' your config files when you have
committed them on a different machine, even though your actual config
files may be spread across various directories including $HOME,
$HOME/.ssh/, etc?
--
Benjamin
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 22:35 ` Benjamin Rutt
@ 2003-05-23 6:11 ` Kai Großjohann
0 siblings, 0 replies; 18+ messages in thread
From: Kai Großjohann @ 2003-05-23 6:11 UTC (permalink / raw)
Benjamin Rutt <rutt+news@cis.ohio-state.edu> writes:
> kai.grossjohann@gmx.net (Kai Großjohann) writes:
>
>> FWIW, I use CVS for my config files. Then it is very easy to use
>> them on different machines. I love it.
>>
>> But I use the symlink trick. I wrote a Makefile that creates all the
>> necessary symlinks, and I use "make install" from time to time
>> whenever I think that the symlinks should be corrected.
>
> When you say "symlink trick", do you mean that you have a directory
> under CVS control, somewhere, anywhere, and the contents of that
> directory are a bunch of symlinks which link to the real config file
> location?
No, the other way round. I have a directory ~/work/kai/dotfiles
which is a CVS working directory. And ~/.emacs is a symlink that
points to ~/work/kai/dotfiles/.emacs.
--
This line is not blank.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 11:46 ` marcuirl
2003-05-22 13:53 ` Stefan Monnier
2003-05-22 14:29 ` Burton Samograd
@ 2003-05-22 14:58 ` Harald Maier
2003-05-22 15:22 ` Kai Großjohann
3 siblings, 0 replies; 18+ messages in thread
From: Harald Maier @ 2003-05-22 14:58 UTC (permalink / raw)
marcuirl <marcuirl@imap.no2this.cc> writes:
> kai.grossjohann@gmx.net (Kai Großjohann) writes:
>
>> Niels Freimann <nfreimann@firemail.de> writes:
>>
>>> the problem is that vc uses rcs if the directory is NOT under CVS
>>> control. If there is a chance to change this "behavior" to CVS
>>> please let me know.
>>
>> Why is this a problem? For CVS, you have to create a repository,
>> first. Then you have to create a working directory. Then you can
>> add files from inside that working directory.
>>
>> So you can't add a random file to CVS anyway.
>
> So then, let us rephrase the question:
>
> How do you go about setting up an `empty' repository?
Take a look at info: (cvs)From scratch
>
> All I want is to put .emacs, .gnus etc under CVS now that I am more
> confident using it. And do this without importing the entire ${HOME}
> directory structure. A work around I have thought is to ln -s these files
> to others in a config/ But that will not fix the problem when in
> another directory I want to CVS just one file in that directory?
Personally, I woud use for the dot files RCS.
Harald
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 11:46 ` marcuirl
` (2 preceding siblings ...)
2003-05-22 14:58 ` Harald Maier
@ 2003-05-22 15:22 ` Kai Großjohann
2003-05-23 8:26 ` marcuirl
3 siblings, 1 reply; 18+ messages in thread
From: Kai Großjohann @ 2003-05-22 15:22 UTC (permalink / raw)
marcuirl <marcuirl@imap.no2this.cc> writes:
> kai.grossjohann@gmx.net (Kai Großjohann) writes:
>
>> Niels Freimann <nfreimann@firemail.de> writes:
>>
>>> the problem is that vc uses rcs if the directory is NOT under CVS
>>> control. If there is a chance to change this "behavior" to CVS
>>> please let me know.
>>
>> Why is this a problem? For CVS, you have to create a repository,
>> first. Then you have to create a working directory. Then you can
>> add files from inside that working directory.
>>
>> So you can't add a random file to CVS anyway.
>
> So then, let us rephrase the question:
>
> How do you go about setting up an `empty' repository?
"cvs -d /your/repository/setting init"
You can use M-x shell RET or M-! to run this command under Emacs.
> All I want is to put .emacs, .gnus etc under CVS now that I am more
> confident using it. And do this without importing the entire ${HOME}
> directory structure. A work around I have thought is to ln -s these files
> to others in a config/
That is the right solution.
> But that will not fix the problem when in another directory I want
> to CVS just one file in that directory?
Please also use the symlink trick in that case.
> Am I being really thick or something, educate me and help the others,
> please.
CVS just works this way. You create a so-called workspace (AKA
working directory) where you edit your files. CVS does allow you to
ignore some files in the workspace (often used for *.o, for
instance). But in general, it assumes that it owns the workspace.
If you want to put a single file under version control, use RCS or
SCCS.
--
This line is not blank.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-22 15:22 ` Kai Großjohann
@ 2003-05-23 8:26 ` marcuirl
2003-05-23 11:48 ` Benjamin Riefenstahl
2003-05-23 14:52 ` Stefan Monnier
0 siblings, 2 replies; 18+ messages in thread
From: marcuirl @ 2003-05-23 8:26 UTC (permalink / raw)
Okay everybody, thanks for all the input on this. I am using the
symlink trick and understand it completely. Trust me!
But I think I/we have lost sight of the original problem now. If I
sound like I am flogging a dead horse then please pass on, I don't
want to waste anymore of your time.
Sorry if the question on the emacs connection was not clear. When I
normally do a C-x v-v in emacs to add a new file in a dir already
under CVS control it is fine. But in another non CVS dir I got asked
if I wanted to create an RCS dir. Personally, (already!) from what I
have seen of RCS I prefer CVS, mainly for the PCL-emacs interface.
This then comes back to the subject of the post I started: Make CVS
default revision controller.
I would like emacs to default to creating CVS repository instead of
RCS. So if it does/not include all files in that directory does not
matter for the moment, its the generation of a CVS repository, _not_
RCS, from within emacs in an uncontrolled directory that is! Is this
at all possible from with in emacs?
marcu
--
Unless otherwise noted, the statements herein reflect my
personal opinions and not those of any organisation with
which I may be affiliated.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-23 8:26 ` marcuirl
@ 2003-05-23 11:48 ` Benjamin Riefenstahl
2003-05-23 14:52 ` Stefan Monnier
1 sibling, 0 replies; 18+ messages in thread
From: Benjamin Riefenstahl @ 2003-05-23 11:48 UTC (permalink / raw)
Hi Marcu,
marcuirl <marcuirl@imap.no2this.cc> writes:
> But I think I/we have lost sight of the original problem now.
Right.
> But in another non CVS dir I got asked if I wanted to create an RCS
> dir. Personally, (already!) from what I have seen of RCS I prefer
> CVS, mainly for the PCL-emacs interface.
To clarify: CVS doesn't work on isolated individual files. CVS
handles projects == modules == directories. As has been mentioned,
RCS handles individual files, and so Emacs suggests that. I don't
think that Emacs currently provides a shortcut to create a new module
in CVS at all.
What would be my plan, if I wanted to do this? It's easy enough to do
"cvs import" from a command line, so I first would write a small
wrapper to do that, starting from a directory. When I have that, it
may than be time to think about extending that so, that when I call it
on a file, I get a suggestion to put the whole directory in CVS. And
lastly I could work on connecting all this with the regular Emacs VC
module.
Just my 2 cents, benny
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-23 8:26 ` marcuirl
2003-05-23 11:48 ` Benjamin Riefenstahl
@ 2003-05-23 14:52 ` Stefan Monnier
2003-05-26 6:56 ` marcuirl
1 sibling, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2003-05-23 14:52 UTC (permalink / raw)
> I would like emacs to default to creating CVS repository instead of
> RCS. So if it does/not include all files in that directory does not
> matter for the moment, its the generation of a CVS repository, _not_
> RCS, from within emacs in an uncontrolled directory that is! Is this
> at all possible from with in emacs?
What exactly do you find missing from my earlier suggestion+patch ?
Stefan
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Make CVS default revision controller
2003-05-23 14:52 ` Stefan Monnier
@ 2003-05-26 6:56 ` marcuirl
0 siblings, 0 replies; 18+ messages in thread
From: marcuirl @ 2003-05-26 6:56 UTC (permalink / raw)
"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
>> I would like emacs to default to creating CVS repository instead of
>> RCS. So if it does/not include all files in that directory does not
>> matter for the moment, its the generation of a CVS repository, _not_
>> RCS, from within emacs in an uncontrolled directory that is! Is this
>> at all possible from with in emacs?
>
> What exactly do you find missing from my earlier suggestion+patch ?
>
Sorry Stefan, missed that on. It does exactly what I need
cheers, marcu
--
Unless otherwise noted, the statements herein reflect my
personal opinions and not those of any organisation with
which I may be affiliated.
^ permalink raw reply [flat|nested] 18+ messages in thread