Skip to contentSkip to conversation

import determinism

DISCUSSION Enrico Weigelt 5 participants 13 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi folks,

I'm curious on how deterministic the imports (git-cvsimport and git-svn) are. Suppose I close the same cvs repo twice (assuming no write access in between), are the resulting object SHA-1's the same ?

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#1 lore raw
Quoted 4 lines · Enrico Weigelt

I'm curious on how deterministic the imports (git-cvsimport and git-svn) are. Suppose I close the same cvs repo twice (assuming no write access in between), are the resulting object SHA-1's the same ?

No, because the committer dates will be different.

#2 lore raw
Quoted 7 lines · Ævar Arnfjörð Bjarmason
Quoted 4 lines · Enrico Weigelt

I'm curious on how deterministic the imports (git-cvsimport and git-svn) are. Suppose I close the same cvs repo twice (assuming no write access in between), are the resulting object SHA-1's the same ?

No, because the committer dates will be different.

The committer info in every commit will be the same as the author info, so the repository conversion is completely deterministic.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw
Quoted 2 lines · Andreas Schwab

The committer info in every commit will be the same as the author info, so the repository conversion is completely deterministic.

Thanks, that helps a lot.

My point is that I'm running a buch of automatic mirrors and like to get them clustered. In theory, it should be enough - for cvs - running git-cvsimport regularily on all nodes, right ?

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#4 lore raw
In reply to Andreas Schwab
Quoted 2 lines · Andreas Schwab

The committer info in every commit will be the same as the author info, so the repository conversion is completely deterministic.

For cvsimport, it is not deterministic. Given cvs' ambiguous/buggy/inconsistent internal semantics around some operations, cvsps makes educated guesses about what happened.

Later commits can affect those educated guesses.

IIRC, this affects the exact tree at the birth of a branch, and files added on a branch (instead of on HEAD).

If you use cvsimport in 'incremental' runs you won't have this problem. Whatever it decided to do, sticks.

I haven't worked in detail with Keith Packard's parsecvs but I assume it has similar issues.

hth,

m

Signature · 5 lines
 [email protected]
 [email protected] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
#5 lore raw
Quoted 9 lines · Martin Langhoff
Quoted 2 lines · Andreas Schwab

The committer info in every commit will be the same as the author info, so the repository conversion is completely deterministic.

For cvsimport, it is not deterministic. Given cvs' ambiguous/buggy/inconsistent internal semantics around some operations, cvsps makes educated guesses about what happened.

Later commits can affect those educated guesses.

The OP was assuming an unchanging repository.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#6 lore raw
Quoted 7 lines · Andreas Schwab
Quoted 5 lines

For cvsimport, it is not deterministic. Given cvs' ambiguous/buggy/inconsistent internal semantics around some operations, cvsps makes educated guesses about what happened.

Later commits can affect those educated guesses.

The OP was assuming an unchanging repository.

My assumption is:

* the original cvs repo will have later additions
(so I'm incrementally importing)
* no commints (besides cvsimport) in the git mirror, but others for off from there
* the mirror could get lost in an desaster (no separate backup) and should be recreated afresh in that case.

The point behind this is: I'm running a growing number of cvs2git mirrors and dont want to do full backups of them.

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#7 lore raw
Quoted 4 lines · Enrico Weigelt

I'm curious on how deterministic the imports (git-cvsimport and git-svn) are. Suppose I close the same cvs repo twice (assuming no write access in between), are the resulting object SHA-1's the same ?

Quoted 2 lines · Enrico Weigelt

The point behind this is: I'm running a growing number of cvs2git mirrors and dont want to do full backups of them.

If you are using cvs2git, why are you asking about git-cvsimport and git-svn?

No tool that imports from CVS or Subversion can make a blanket guarantee about consistency across conversions because both CVS and SVN allow retroactive changes to the project history. For example:

* Both CVS and SVN allow commit messages and other metadata of old commits to be changed

* CVS allows files to be added retroactively to tags and branches with no timestamp indicating that the file was not part of the original tag.

* CVS allows old revisions to be "obsoleted" (i.e., expunged from history).

* In CVS it is common practice for people to muck about directly in the repository, for example renaming *,v files.

So (in the general case) there is no way to guarantee that two independent conversions will have consistent results for the overlapping parts of their history. And even incremental conversions will necessarily have to decide between converting the current state of the repository accurately and converting in a way that is consistent with earlier conversions.

In practice, especially if you are willing to constrain what the CVS users are allowed to do, the overlapping parts of two conversions should usually be identical or at least very similar (with older history more likely to be identical). Perhaps an rsync-style backup would be smart enough to copy only the changed part of the history without excluding the possibility that there are retroactive changes between subsequent conversions.

If you run two cvs2git conversions on *exactly* the same CVS repository, then the results *should* be identical. I have tried always to process data in a defined order rather than, say, in filesystem or hashmap-determined order. But AFAIK this property has not been tested and could easily be buggy if I overlooked some source of indeterminism somewhere in the cvs2git code.

Michael

Signature · 3 lines
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/
#9 lore raw
In reply to Enrico Weigelt

Every full clone is a good backup. If nobody is doing a full clone... the do back them up. That's my recommendation.

M

Quoted 39 lines · Enrico Weigelt
Quoted 7 lines · Andreas Schwab
Quoted 5 lines

For cvsimport, it is not deterministic. Given cvs' ambiguous/buggy/inconsistent internal semantics around some operations, cvsps makes educated guesses about what happened.

Later commits can affect those educated guesses.

The OP was assuming an unchanging repository.

My assumption is:

* the original cvs repo will have later additions
 (so I'm incrementally importing)
* no commints (besides cvsimport) in the git mirror, but others for off from there
* the mirror could get lost in an desaster (no separate backup) and should be recreated afresh in that case.

The point behind this is: I'm running a growing number of cvs2git mirrors and dont want to do full backups of them.

cu
--
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
 [email protected]
 [email protected] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
#10 lore raw
Quoted 2 lines · Martin Langhoff

Every full clone is a good backup. If nobody is doing a full clone... the do back them up. That's my recommendation.

Does the clone have all information necessary for the incremental cvsimport runs ?

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#11 lore raw
Quoted 6 lines · Enrico Weigelt
Quoted 2 lines · Martin Langhoff

Every full clone is a good backup. If nobody is doing a full clone... the do back them up. That's my recommendation.

Does the clone have all information necessary for the incremental cvsimport runs ?

Yes -- all cvsimport tracks is the branches. No extra import-tracking data is maintained. (Other importers may or may not keep additional data, YMMV, etc)

m

Signature · 5 lines
 [email protected]
 [email protected] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
#12 lore raw
Quoted 6 lines · Martin Langhoff
Quoted 2 lines

Does the clone have all information necessary for the incremental cvsimport runs ?

Yes -- all cvsimport tracks is the branches. No extra import-tracking data is maintained. (Other importers may or may not keep additional data, YMMV, etc)

That's good news. Now I'll have to sit down and code some little cluster management tool (mirrors are getting more and more), or does anyone already did that ? ...

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------
#8 lore raw
In reply to Michael Haggerty
Quoted 6 lines · Michael Haggerty
Quoted 4 lines · Enrico Weigelt

I'm curious on how deterministic the imports (git-cvsimport and git-svn) are. Suppose I close the same cvs repo twice (assuming no write access in between), are the resulting object SHA-1's the same ?

Quoted 6 lines
Quoted 2 lines · Enrico Weigelt

The point behind this is: I'm running a growing number of cvs2git mirrors and dont want to do full backups of them.

If you are using cvs2git, why are you asking about git-cvsimport and git-svn?

No, I'm not using the "cvs2git" tool (wasn't aware of that at all) ;-) I'm using git-cvsimport.

cu

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------