# US 2020/0150956 A1 · Commit history linearization

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

- Number: US 2020/0150956 A1
- Document ID: US20200150956A1
- Status: Published application
- Kind: A1
- Application number: 16/663,002
- Filed: 2019-10-24
- Published: 2020-05-14
- Earliest claimed: 2017-12-28
- Assignees: Github Software UK Ltd.
- Applicants: Github Software UK Ltd.
- Inventors: Robin Neatherway
- Web page: https://patentgrep.com/patent/US20200150956A1

## CPC

- G06F 8/77: Software metrics
- 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

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for linearizing the commit history of a code base. One of the methods includes receiving a request to attribute source code contributions to a particular snapshot in a project having a revision graph with multiple branches. Source code contributions occurring in each non-merge commit on a single path through the revision graph are attributed to a responsible developer entity of the non-merge commit. Each merge commit is processed on the single path including identifying contributions introduced by the merge commit, identifying one or more respective responsible developer entities for the contributions occurring in the one or more feature branch snapshots from one or more feature branches, and attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches to the identified one or more respective responsible developer entities.

## Claims

### Claim 1

A system comprising:
one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:
receiving a request to attribute source code contributions to a particular snapshot in a project having a revision graph with multiple branches;
receiving a designation of a single path through the revision graph defining a master branch, the single path including the particular snapshot and a plurality of other snapshots;
attributing source code contributions occurring in each non-merge commit on the single path to a responsible developer entity of the non-merge commit; and
processing each merge commit on the single path including:
identifying source code contributions introduced by the merge commit, wherein the merge commit merges one or more master branch snapshots with one or more feature branch snapshots from one or more feature branches;
identifying one or more respective responsible developer entities for the source code contributions occurring in the one or more feature branch snapshots from one or more feature branches, and
attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches to the identified one or more respective responsible developer entities.

### Claim 2 (depends on 1)

The system of claim 1, wherein the source code contributions comprise violation introductions, violation removals, or both.

### Claim 3 (depends on 2)

The system of claim 2, wherein identifying one or more respective responsible developer entities for the source code contributions occurring in the one or more feature branch snapshots from one or more feature branches comprises computing transitive violation matching information for violations introduced or removed in the one or more feature branch snapshots.

### Claim 4 (depends on 1)

The system of claim 1, wherein attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches to the identified one or more respective responsible developer entities comprises designating the source code contribution made in the one or more feature branches to have been contributed as of the time of the merge commit.

### Claim 5 (depends on 1)

The system of claim 1, wherein receiving a designation of a single path through the revision graph defining a master branch comprises receiving user input specifying a plurality of snapshots including the particular snapshot.

### Claim 6 (depends on 1)

The system of claim 1, wherein receiving a designation of a single path through the revision graph defining a master branch comprises receiving a designation of a master branch according to a version control system.

### Claim 7 (depends on 1)

The system of claim 1, wherein attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches comprises ignoring all source code contributions on feature branches that are never merged with the master branch.

### Claim 8

A system comprising:
one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:
receiving a request to attribute violations introduced by a merge commit, wherein the merge commit merges two or more branches of a revision graph;
identifying violations that are introduced by the merge commit, wherein the violations that are introduced by the merge commit do not match violations in one or more parents of the merge commit;
computing transitively matched violations for each of the violations that are introduced by the merge commit to identify a respective author for each violation introduced by the merge commit; and
attributing the violations introduced by the merge commit to corresponding authors of the transitively matched violations.

### Claim 9 (depends on 8)

The system of claim 8, wherein identifying violations that changed status from each merge commit includes:
comparing the merge commit to all ancestor revisions directly preceding the merge commit on the branch into which the merge commit was committed;
for violations that are in any of the ancestor revisions and not in the merge commit, identifying removed violations; and
for violations that are in the merge commit and not in the ancestor revision, identifying introduced violations.

### Claim 10 (depends on 8)

The system of claim 8, wherein the operations further comprise:
identifying lines of code from the merge commit that do not exist in the ancestor revision on the master revision branch;
determining historical commits of the feature branch for the merge commit;
identifying, from the plurality of historical commits, the historical commit of the feature branch where the lines of code were introduced; and
attributing the historical commit to a particular developer who performed the commit to the feature branch.

### Claim 11 (depends on 8)

The system of claim 8, wherein the operations further comprise:
providing statistics for code characteristic changes from branches that no longer exist.

### Claim 12 (depends on 8)

The system of claim 8, wherein the operations further comprise:
providing statistics for code characteristic changes from branches that are merged back into the main branch.

### Claim 13 (depends on 8)

The system of claim 8, wherein the operations further comprise:
providing statistics for code characteristic changes from a single path through the revision graph.

### Claim 14

A computer-implemented method comprising:
receiving a request to attribute source code contributions to a particular snapshot in a project having a revision graph with multiple branches;
receiving a designation of a single path through the revision graph defining a master branch, the single path including the particular snapshot and a plurality of other snapshots;
attributing source code contributions occurring in each non-merge commit on the single path to a responsible developer entity of the non-merge commit; and
processing each merge commit on the single path including:
identifying source code contributions introduced by the merge commit, wherein the merge commit merges one or more master branch snapshots with one or more feature branch snapshots from one or more feature branches;
identifying one or more respective responsible developer entities for the source code contributions occurring in the one or more feature branch snapshots from one or more feature branches, and
attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches to the identified one or more respective responsible developer entities.

### Claim 15 (depends on 14)

The method of claim 14, wherein the source code contributions comprise violation introductions, violation removals, or both.

### Claim 16 (depends on 15)

The method of claim 15, wherein identifying one or more respective responsible developer entities for the source code contributions occurring in the one or more feature branch snapshots from one or more feature branches comprises computing transitive violation matching information for violations introduced or removed in the one or more feature branch snapshots.

### Claim 17 (depends on 14)

The method of claim 14, wherein the source code contributions comprise lines-of-code metrics.

### Claim 18 (depends on 14)

The method of claim 14, wherein attributing source code contributions occurring in the one or more feature branch snapshots from the one or more feature branches to the identified one or more respective responsible developer entities comprises designating the source code contribution made in the one or more feature branches to have been contributed as of the time of the merge commit.

### Claim 19 (depends on 14)

The method of claim 14, wherein receiving a designation of a single path through the revision graph defining a master branch comprises receiving user input specifying a plurality of snapshots including the particular snapshot.

### Claim 20 (depends on 14)

The method of claim 14, wherein receiving a designation of a single path through the revision graph defining a master branch comprises receiving a designation of a master branch according to a version control system.
