# US 2016/0253373 A1 · System and method for distributed revision control

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0253373 A1
- Document ID: US20160253373A1
- Status: Published application
- Kind: A1
- Application number: 14/633,077
- Filed: 2015-02-26
- Published: 2016-09-01
- Earliest claimed: 2015-02-26
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Lukas Fryc
- Web page: https://patentgrep.com/patent/US20160253373A1

## CPC

- G06F 8/65: Updates (security arrangements therefor G06F21/57)
- G06F 16/1873: {Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files}
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method for distributed revision control includes receiving, by a revision control module being executed by one or more processors of a server, a request to store a first version in a repository, the repository comprising a plurality of stored versions, determining whether the first version is in the repository, incrementing a client reference counter associated with the first version when the first version is in the repository, adding the first version to the repository and sending the first version to one or more additional servers when the first version is not in the repository, and decrementing a server reference counter associated with a second version in the repository when the first version replaces the second version as a head version of the repository.

## Claims

### Claim 1

A method of revision control, the method comprising:
receiving, by a revision control module being executed by one or more processors of a server, a request to store a first version in a repository, the repository comprising a plurality of stored versions;
determining whether the first version is in the repository;
when the first version is in the repository, incrementing a client reference counter associated with the first version;
when the first version is not in the repository, adding the first version to the repository and sending the first version to one or more additional servers; and
when the first version replaces the second version as a head version of the repository, decrementing a server reference counter associated with a second version in the repository.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
receiving, from another server, a third version;
adding the third version to the repository;
determining whether the third version replaces a fourth version as a head version of the repository; and
when the third version replaces the fourth version as the head version of the repository, incrementing a server reference counter associated with the third version and decrementing a server reference counter associated with the fourth version.

### Claim 3 (depends on 2)

The method of claim 2, further comprising, when the server is designated as a master server, merging branched versions in the repository, forming a fifth version, and sending the fifth version to the one or more additional servers.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
receiving a request to retrieve a third version from the repository;
determining whether the third version is in the repository; and
when the third version is in the repository, retrieving the third version from the repository and decrementing a client reference counter associated with the third version.

### Claim 5 (depends on 1)

The method of claim 1, further comprising trimming a first one of the stored versions in the repository when a corresponding client reference counter associated with the first one of the stored versions is below a first predetermined threshold and a corresponding server reference counter associated with the first one of the stored versions is below a first predetermined threshold.

### Claim 6 (depends on 5)

The method of claim 5, wherein trimming the first one of the stored versions comprises computing one or more composite patches based on a patch associated with the first one of the stored versions.

### Claim 7 (depends on 5)

The method of claim 5, wherein sequence metadata associated with the first one of the stored versions indicates that the first one of the stored versions is older than an oldest active stored version, the oldest active stored version being the oldest stored version in the repository that has corresponding client and server reference counters above the first and second predetermined thresholds, respectively.

### Claim 8 (depends on 5)

The method of claim 5, wherein trimming the first one of the stored versions comprises moving the first one of the stored versions from a primary memory to a secondary memory.

### Claim 9 (depends on 1)

The method of claim 1, further comprising receiving a request to trim a first one of the stored versions in the repository from another server and trimming the first one of the stored versions.

### Claim 10 (depends on 1)

The method of claim 1, wherein the repository comprises version identifiers, version data, sequence metadata, and owner identifiers for each of the plurality of stored versions.

### Claim 11 (depends on 10)

The method of claim 10, further comprising maintaining client and server reference counters for each of the plurality of stored versions that are owned by the server.

### Claim 12 (depends on 10)

The method of claim 10, wherein the version identifiers uniquely identify each of the plurality of stored versions, the version identifiers including hash values of each of the plurality of stored versions.

### Claim 13 (depends on 12)

The method of claim 12, wherein trimming the first one of the stored versions comprises moving the first one of the stored versions from a primary memory to a secondary memory.

### Claim 14

A revision control system comprising:
a revision control module executed by one or more process of a server; and
a repository configured to provide access to a plurality of stored versions of a shared document;
wherein the revision control module is configured to:
receive a request to store a first version in the repository;
determine whether the first version is in the repository;
when the first version is in the repository, increment a client reference counter associated with the first version;
when the first version is not in the repository, add the first version to the repository and send the first version to one or more additional servers; and
when the first version replaces the second version as a head version of the repository, decrement a server reference counter associated with a second version in the repository.

### Claim 15 (depends on 14)

The revision control system of claim 14, wherein the revision control module is further configured to:
receive, from another server, a third version;
add the third version to the repository;
determine whether the third version replaces a fourth version as a head version of the repository; and
when the third version replaces the fourth version as the head version of the repository, increment a server reference counter associated with the third version and decrement a server reference counter associated with the fourth version.

### Claim 16 (depends on 15)

The revision control system of claim 15, wherein the revision control module is further configured to merge branched versions in the repository to form a fifth version and send the fifth version to the one or more additional servers when the server is designated as a master server.

### Claim 17 (depends on 14)

The revision control system of claim 14, wherein the revision control module is further configured to:
receive a request to retrieve a third version from the repository;
determine whether the third version is in the repository; and
when the third version is in the repository, retrieve the third version from the repository and decrement a client reference counter associated with the third version.

### Claim 18 (depends on 14)

The revision control system of claim 14, further comprising a garbage collection module configured to trim a first one of the stored versions in the repository when a corresponding client reference counter associated with the first one of the stored versions is below a first predetermined threshold and a corresponding server reference counter associated with the first one of the stored versions is below a first predetermined threshold.

### Claim 19

A non-transitory machine-readable medium comprising a plurality of machine-readable instructions which when executed by one or more processors associated with a server are adapted to cause the one or more processors to perform a method comprising:
receiving a request to store a first version in a repository, the repository comprising a plurality of stored versions;
determining whether the first version is in the repository;
when the first version is in the repository, incrementing a client reference counter associated with the first version;
when the first version is not in the repository, adding the first version to the repository and sending the first version to one or more additional servers;
when the first version replaces the second version as a head version of the repository, decrementing a server reference counter associated with a second version in the repository;
receiving, from another server, a third version;
adding the third version to the repository;
determining whether the third version replaces a fourth version as a head version of the repository;
when the third version replaces the fourth version as the head version of the repository, incrementing a server reference counter associated with the third version and decrementing a server reference counter associated with the fourth version;
receiving a request to retrieve a fifth version from the repository;
determining whether the fifth version is in the repository; and
when the fifth version is in the repository, retrieving the fifth version from the repository and decrementing a client reference counter associated with the fifth version.

### Claim 20 (depends on 19)

The non-transitory machine-readable medium of claim 19, wherein the method further comprises trimming a first one of the stored versions in the repository when a corresponding client reference counter associated with the first one of the stored versions is below a first predetermined threshold and a corresponding server reference counter associated with the first one of the stored versions is below a first predetermined threshold.
