Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit time of each file #1367

Answered by Byron
dsharma522 asked this question in Q&A
Discussion options

How can we get the commit time of each file in the tree by traversing it recursively?
when we traverse tree by pathlib , it does not show any time by git log -1 --pretty="format:%ci" <file_name>

You must be logged in to vote

The commit time is only available in commits themselves. Hence, in order to assign a timestamp to changes between commits, one has to diff them. There are probably plenty of algorithms that are feasible, implementing them fast isn't that easy though.
If performance becomes a problem, the python bindings to libgit2 might help.

Replies: 1 comment

Comment options

The commit time is only available in commits themselves. Hence, in order to assign a timestamp to changes between commits, one has to diff them. There are probably plenty of algorithms that are feasible, implementing them fast isn't that easy though.
If performance becomes a problem, the python bindings to libgit2 might help.

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /