Skip to content

parseGitRenameLog

Parses the output of git log -z --diff-filter=R -M --name-status --format=%h.

Import:

import { parseGitRenameLog } from '@mnaoumov/obsidian-lib/git-rename-history';

Signature:

function parseGitRenameLog(log: string, vaultPrefix: string): Map<string, GitRename>

Parameters:

Parameter Type Description
log string The output, newest commit first.
vaultPrefix string The vault’s folder within the repository, as git rev-parse --show-prefix prints it: '' or a path ending in /. Renames outside it are dropped, and it is stripped from the rest.

Returns: Map<string, GitRename> — Each old vault path to the path it ended up at, following a chain of renames to its end.