Tiny commit walker
Tiny git commit walker has no native modules.
Usage
import { Repository } from 'tiny-commit-walker';
(async () => {
const repo = new Repository('path/to/repo');
const branches = await repo.readBranches();
const tags = await repo.readTags();
const branch = await repo.readCommitByBranch('master');
console.log(branch.name);
let commit = branch.commit;
while (commit.hasParents) {
console.log(commit.hash);
commit = await commit.walk();
}
});
const repo = new Repository('path/to/repo');
const branches = repo.readBranchesSync();
const tags = repo.readTagsSync();
const branch = repo.readCommitByBranchSync('master');
console.log(branch.name);
let commit = branch.commit;
while (commit.hasParents) {
console.log(commit.hash);
commit = commit.walkSync();
}
``