-
-
Notifications
You must be signed in to change notification settings - Fork 954
-
I want to track a file with its rename ones. For example, a file is called "test_lecture", and then rename to "python_data_analytics". I want to track all the commits for the files if possible.
I use Repo.iter_commits
currently, which requires on git rev-list
command, a complicated command(https://stackoverflow.com/questions/64397278/understanding-git-rev-list).
I have noticed that git log
with --follow
and --find-renames
(https://www.zhihu.com/question/531483642/answer/2472733253) may work. Or are there any API based on it can be used?
Beta Was this translation helpful? Give feedback.
All reactions
I don't think that out of the box this is easy in GitPython
, but it should be possible to use git
directly and parse its output instead.
GitPython
can make calling into git
more pythonic, too, but it won't change the fact that you have to deal with a steam of bytes to parse.
Replies: 1 comment
-
I don't think that out of the box this is easy in GitPython
, but it should be possible to use git
directly and parse its output instead.
GitPython
can make calling into git
more pythonic, too, but it won't change the fact that you have to deal with a steam of bytes to parse.
Beta Was this translation helpful? Give feedback.