Find out when a function was last changed

I would like to find out what the last change was to a range of lines in a source file (not the entire file!). Is there a simple way to do this? Ideally, I would like to do it on GitHub and avoid cloning a multi-gigabyte repository. If cloning is a must, I am interested in answers that rely on that too.

I know that I can go to the source file and click the “Blame” button, but it is very hard to go through a forest of interspersed changes and find the most recent one. I am not confident that I did not miss anything. Example:

https://github.com/sagemath/sage/blame/f0ae571d17e685258c1de89c2a29953f4d8fb302/src/sage/graphs/digraph.py#L101

Hi @szhorvat,

Thank you for being here! v4 of our API has a working blame API that’ll help you get to a commit reference. For example:

{
  repository(name: "atom", owner: "atom") {
    ref(qualifiedName:"1.42-releases") {
      target {
        ... on Commit {
          blame(path:"CHANGELOG.md") {
            ranges {
              commit {
                author {
                  name
                }
              }
              startingLine
              endingLine
            }
          }
        }
      }
    }
  }
}
1 Like