git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rcs
@ 2013-10-29 16:35 Finnerty, James M Mr CTR USA USASOC-SOAR
  2013-10-29 17:12 ` rcs Keshav Kini
  2013-10-29 18:16 ` rcs Jeff King
  0 siblings, 2 replies; 6+ messages in thread
From: Finnerty, James M Mr CTR USA USASOC-SOAR @ 2013-10-29 16:35 UTC (permalink / raw)
  To: git; +Cc: Hawkins, Lisa M Mrs CTR USA USASOC-SOAR

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 ?

 Thanks Jim

Jim Finnerty


ECS, Inc.
Comm: (270) 798-1386, Fax: (270)798-7724
Cell: (570) 498-8499

CAUTION: This message may contain competitive, sensitive or other
non-public information not intended for disclosure outside official
government channels.  Do not disseminate this message outside of
official channels.  If you received this message in error, please notify
the sender by reply e-mail and delete all copies of this message." 

"STATEMENT OF LIMITATION OF AUTHORITY: You are hereby notified that I do
not have the authority to direct you in any way to alter your
contractual obligations. Further, if your U.S. Army customer, as the
result of the information obtained from discussions or emails, does
desire to alter your contract requirements, changes will be issued in
writing and signed by the contracting officer. You should take no action
on any change unless and until you receive such a contract modification
or written direction by the Contracting Officer."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rcs
  2013-10-29 16:35 rcs Finnerty, James M Mr CTR USA USASOC-SOAR
@ 2013-10-29 17:12 ` Keshav Kini
  2013-10-29 18:16 ` rcs Jeff King
  1 sibling, 0 replies; 6+ messages in thread
From: Keshav Kini @ 2013-10-29 17:12 UTC (permalink / raw)
  To: git

"Finnerty, James M Mr CTR USA USASOC-SOAR"
<jim.finnerty.ctr@soar.army.mil> writes:
> 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 ?

If you're talking about the GNU rcs program, no, it does not.

-Keshav

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rcs
  2013-10-29 16:35 rcs Finnerty, James M Mr CTR USA USASOC-SOAR
  2013-10-29 17:12 ` rcs Keshav Kini
@ 2013-10-29 18:16 ` Jeff King
  2013-10-29 19:17   ` rcs Finnerty, James M Mr CTR USA USASOC-SOAR
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff King @ 2013-10-29 18:16 UTC (permalink / raw)
  To: Finnerty, James M Mr CTR USA USASOC-SOAR
  Cc: git, Hawkins, Lisa M Mrs CTR USA USASOC-SOAR

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: rcs
  2013-10-29 18:16 ` rcs Jeff King
@ 2013-10-29 19:17   ` Finnerty, James M Mr CTR USA USASOC-SOAR
  2013-11-05 14:56     ` rcs Jakub Narębski
  0 siblings, 1 reply; 6+ messages in thread
From: Finnerty, James M Mr CTR USA USASOC-SOAR @ 2013-10-29 19:17 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Hawkins, Lisa M Mrs CTR USA USASOC-SOAR

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@peff.net] 
Sent: Tuesday, October 29, 2013 1:16 PM
To: Finnerty, James M Mr CTR USA USASOC-SOAR
Cc: git@vger.kernel.org; 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rcs
  2013-10-29 19:17   ` rcs Finnerty, James M Mr CTR USA USASOC-SOAR
@ 2013-11-05 14:56     ` Jakub Narębski
  2013-11-06 17:28       ` rcs Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Narębski @ 2013-11-05 14:56 UTC (permalink / raw)
  To: git; +Cc: Jeff King, git, Hawkins, Lisa M Mrs CTR USA USASOC-SOAR

Finnerty, James M Mr CTR USA USASOC-SOAR wrote
> Jeff King [mailto:peff@peff.net]wrote:
>> 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. :)

 >
 >    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.

The problem with using RCS as sync (as base) is that it is least
powerfull of VCS, and as far as I know do not offer place to store
extra information, so conversion from Git to RSS will lose some
information (committership, signed commits and signed merges, signed
tags, etc.).

There is a tool to create fast-import stream from RCS repository,
but I am not sure if there is reverse (fast-import is a common
intermediate fairly VCS_agnostic representation used for fast
conversion between different version control systems).

-- 
Jakub Narębski

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: rcs
  2013-11-05 14:56     ` rcs Jakub Narębski
@ 2013-11-06 17:28       ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2013-11-06 17:28 UTC (permalink / raw)
  To: Jakub Narębski
  Cc: git, Jeff King, Hawkins, Lisa M Mrs CTR USA USASOC-SOAR

Jakub Narębski <jnareb@gmail.com> writes:

> Finnerty, James M Mr CTR USA USASOC-SOAR wrote
>> Jeff King [mailto:peff@peff.net]wrote:
>>> 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. :)
>
>>
>>    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.
>
> The problem with using RCS as sync (as base) is that it is least
> powerfull of VCS, and as far as I know do not offer place to store
> extra information, so conversion from Git to RSS will lose some
> information (committership, signed commits and signed merges, signed
> tags, etc.).

You forgot to mention another important one: atomicity of commits
across the entire tree.  The best you could do would be to assume
that changes in such a collection of RCS ,v files from a Git export
to different files with the same timestamp and by the same author
are likely to have come from the same Git commit, and that the
timestamp monotonically increases, in order to stitch the history
back together.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-06 17:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29 16:35 rcs Finnerty, James M Mr CTR USA USASOC-SOAR
2013-10-29 17:12 ` rcs Keshav Kini
2013-10-29 18:16 ` rcs Jeff King
2013-10-29 19:17   ` rcs Finnerty, James M Mr CTR USA USASOC-SOAR
2013-11-05 14:56     ` rcs Jakub Narębski
2013-11-06 17:28       ` rcs Junio C Hamano

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).