nodegit

Git blame a file from an earlier commit with NodeGit


Is it possible to use the git blame command to get the annotations from each line in an earlier revision of a file with NodeGit?

There is an method called Blame.file(repo, path, [options]), but it isn't clear to me exactly what all the properties of the options object mean. It doesn't seems to be possible, but maybe there is some workaround? If this is not possible with NodeGit, I would appreciate recommendations of module or solutions.

I want to specify the sha1 parameter in the command below:

git blame {sha1} -- {path/to/file}


Solution

  • You need to use the options to specify which commit you want to start from (instead of simply HEAD).