Skip to content

Renames ​

Renames isn't a lens. There is no picture or table for it in the dashboard. GitRelic still works out which files were renamed on every run, and you see the result in two places when you select a file: a Renames row on its card, and its commits under old names in the time strip.

This page is mostly about what a rename does to the other numbers: most lenses count a file from its current path only, so a file that moved can look new, quiet and owned by whoever moved it.

Reading the numbers ​

What you seeWhat it means
Renames: 2 timesGoing back from today's path, GitRelic found two earlier names for this file. The row sits in the file card's Flagged by section, and there's nothing to open. A file with no rename found has no row.
Churn (commits) 4, but the time strip says "19 of 33 commits"Not a contradiction. The time strip and the file card's Activity section also count commits under the file's old names. Churn doesn't, so 4 is the commits since the last move, including the move itself.
Sample: 4 commits, under the 8 a verdict needsOften the mark of a move: the commits before it don't count toward the 8, so the file loses its ratings. Check for a Renames row before believing the file is new.
Bus Factor: 1 (Sam: 100%) on a file with a Renames rowSam may only have moved it. Whoever makes the move becomes an author of the file, and the people who wrote it before don't count.

Two example repositories ​

These repositories are invented, but each result is what GitRelic reports for commits like these.

A Python service where a file moved twice ​

services/search/engine.py moved to services/search/core/engine.py, and later to services/query/engine.py. Here is the file's card with and without the moves, from the same number of commits by the same people:

RowNever movedMoved twice
Hotspot Score10015
Churn (commits)334
Bus Factor4 (Lin: 30%)1 (Sam: 100%)
Coupled Withindex.py (27 of 33 commits)index.py (3 of 4 commits)
Curse Score55no row
Fix rate16% (3 of 19)no row
With a test6 of 33 changes0 of 4 changes
Sampleno row4 commits, under the 8 a verdict needs
Renamesno row2 times

The time strip's caption is the same in both: "Selection changed in 10 weeks · 19 of 33 commits in the recent half."

What it means: the file went from the most active and widely shared in the repo to a quiet one owned by Sam, and nothing about the work changed. Sam made both moves and the last few commits, and the other three people's commits stayed under the old paths.

What to look at: the time strip for how active the file really is, and git for who wrote it before the moves (see In the dashboard).

A Rust project where a file moved and was rewritten at once ​

One commit deleted src/parser.rs, which had 12 commits, and added src/parse/lexer.rs with most of its lines changed. The new file's card shows:

Churn (commits): 1

Bus Factor: 1 (Sam: 100%)

Sample: 1 commit, under the 8 a verdict needs

There's no Renames row.

What it means: git didn't see a rename, so to GitRelic this is a new file, and the time strip shows only that commit. No row doesn't prove a file never moved. Making the move in a commit of its own, and the rewrite in the next, keeps the link.

How it's measured ​

GitRelic asks git for every rename and links each file back through its earlier names.

  • All of history. Renames are read from the first commit, whatever --since says, so a file renamed years before the analyzed period still has its old names. The time strip still covers only the analyzed period.
  • Git decides what a rename is. A file counts as renamed when one commit removes a path and adds another with at least 50% similar content. Change more than about half of the file in the same commit and it reads as a delete and a new file. A copy isn't a rename.
  • The count is the steps back. Starting from a file's current path, GitRelic finds the rename that produced that name, then the one before it, and so on. When several renames led to the same path, the one with the latest author date counts, and a tie goes to the older commit.
  • Everyone's moves count. Bots and people alike, and renames on branches once they're merged into the analyzed branch. A deleted file's renames don't appear on any card.
  • If git is too slow. When reading all of history hits the time limit (--git-timeout, 10 minutes by default), GitRelic reads the analyzed period only and says so in the terminal. The dashboard doesn't mention it, and older renames are missing from it. With --since all there's nothing smaller to read, so the terminal reports a failure and no file gets a Renames row.

What a move does to each lens ​

Commits count under the path they changed, and a rename commit counts under the new one. The old path no longer exists, so these lenses leave its commits out:

  • Hotspots, Churn (including the rewrite score) and Tests: the file's counts start at the move.
  • Age: "Last changed" is reset by the move, even when the content didn't change.
  • Ownership and Contributors: a file's authors start at the move, so its bus factor and files owned can shift to whoever moved it.
  • Coupling (including blast radius): a pair counts only commits since the move.
  • Fix rate, Parallel Dev and Risk: a file can drop off these altogether, because it falls under their minimums.
  • AI & Co-authors: package rows lose commits that only touched the old path. The headline share doesn't change.

Handoffs and Experts count by package, so a move inside a package changes nothing. After a move to another package, the older commits stay with the old one.

In the dashboard ​

Renames has no place in the lens bar. Select a file:

  • The file card has the Renames row, when there's a count to show.
  • The time strip and the card's Activity section light up the weeks with commits under the file's current name or an old one, apart from the reused names described below.

The dashboard shows the count but not the old names. To see them, ask git:

bash
git log --follow --diff-filter=R --name-status --format=%s -- services/query/engine.py

--json output also has a renames section, with each renamed file's earlier names. Its total can be higher than the number of renamed files: a file renamed twice counts twice, and renames of files since deleted count too.

What it can't tell you ​

  • Renames git didn't report. A move with a heavy rewrite is invisible, and two unrelated files with similar content can be linked by mistake.
  • An exact count for a file that moved back and forth. The walk stops at a name it has already seen. A file renamed and renamed back shows 2 times, but a third move still shows 2.
  • A file's history when a name was used twice. Renames are linked by name, not date. If a file leaves a.py and another file is later renamed to a.py, the first file's count and time strip pick up the second file's old name. If a file uses an old name today, the time strip leaves that name out, so weeks under it stay dark.
  • Whether a rename mattered. A folder tidy-up and the start of a rewrite both count as one rename.

Released under the MIT License.