RE: rcs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff,

  Thanks.  We have several systems using Razor right now. So we are trying to get all the systems into one CM system. Razor is just a gui that uses rcs commands. Once we get everything synced we will explore our options for a complete development CM system.

 Jim

-----Original Message-----
From: Jeff King [mailto:peff@xxxxxxxx] 
Sent: Tuesday, October 29, 2013 1:16 PM
To: Finnerty, James M Mr CTR USA USASOC-SOAR
Cc: git@xxxxxxxxxxxxxxx; Hawkins, Lisa M Mrs CTR USA USASOC-SOAR
Subject: Re: rcs

On Tue, Oct 29, 2013 at 11:35:21AM -0500, Finnerty, James M Mr CTR USA USASOC-SOAR wrote:

> Hi. I'm going to attempt to import a git database into Razor which is 
> linux rcs based. Does the linux version of git use rcs ?

No, the formats are completely different, and you will have to translate.  We don't usually get requests to go from git to rcs; it usually goes the other way. :)

I don't know offhand of a tool that does it out of the box.  It should be possible to generate the RCS files directly from the "git log" data (though RCS does not use unified diff for storage, but rather "ed"
commands, so you'd have to translate there). A slower simpler way would be to just "replay" the git history, committing to rcs at each step.
That might look something like the hacky, largely untested script below:

-- >8 --
#!/bin/sh

# note that this does not handle filenames which need quoting.
changed_files() {
  git diff-tree -r --name-only "$1" | tail -n +2 }

# Look at each commit in chronological order; note # that this will linearize your history, as this # script does not know about branches at all.
git rev-list --reverse HEAD |
while read rev; do

  # take a lock on each file we are about to update
  rcs -l $(changed_files $rev)

  # update the working tree to this revision
  git checkout -fq $rev

  # get commit date in iso8601
  date=$(git log -1 --format=%ai)

  # get author "login". This just pulls the username from
  # the email address; you may also want to map email
  # addresses to logins via a file.
  login=$(git log -1 --format=%ae | cut -d@ -f1)

  # original commit message
  msg=$(git log -1 --format=%B)

  # now we're ready to checkin
  ci -w"$login" -d"$date" -m"$msg" $(changed_files $rev) </dev/null done
-- 8< --

There are lots of ways it can go wrong (and I tried to note them above), but it may be enough for a simple history.

-Peff
��.n��������+%������w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]