git2r icon indicating copy to clipboard operation
git2r copied to clipboard

list all commits between two commits?

Open tdhock opened this issue 3 years ago • 2 comments

Hi! I was wondering if there is some way, given two commits A and B (sha or tag), to list all commits between them, similar to the A..B and A...B syntax on command line? https://stackoverflow.com/questions/54989224/list-of-all-commits-between-2-commits#54992168 Related, is there some way to do something analogous to git bisect in git2r? I looked at docs and list of functions provided but I did not see any mention of either. Thanks.

tdhock avatar Jul 13 '22 03:07 tdhock

Hi, Unfortunately, it is not possible to bisect or list all commits between two commits using git2r. Maybe it would be possible to implement the list functionality in git2r using the git_revwalk_push_range functionality in libgit2 (https://libgit2.org/libgit2/#HEAD/group/revwalk/git_revwalk_push_range)? Currently, git2r uses the git_revwalk_push function https://github.com/ropensci/git2r/blob/80ba18571dbbaf6c2b662043719045ecc4024719/src/git2r_revwalk.c#L155 to initiate the walk.

stewid avatar Jul 13 '22 11:07 stewid

OK, thanks for the clarification. If you can make one, it would be useful to have a wiki page or FAQ in the docs which explicitly lists features like this which are present in the command line tool but not present (yet) in git2r? (for users like me which assume naively that git2r offers basically the same functionality as the command line git program)

tdhock avatar Jul 13 '22 16:07 tdhock