Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6855035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:42:26+00:00 2026-05-27T01:42:26+00:00

I got another libgit2 issue and will be very grateful for your help. I’m

  • 0

I got another libgit2 issue and will be very grateful for your help.

I’m trying to retrieve file history, i.e. list of commits where this file was changed. And it seems to be quite unconventional… As far as I can see, there are no function for that.

The only approach I can come up with is to use revision walking API to iterate through revisions, check the tree object attached to commit and search for given file there, if found, add commit to my list, otherwise proceed to next commit.

But it looks none-optimal for me…

May be is there any other approach, for example, look directly into .git folder and get needed information there?

Many thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:42:27+00:00Added an answer on May 27, 2026 at 1:42 am

    But it looks none-optimal for me…

    Your approach is the correct one. Beware that you’ll have to fight against:

    • Plain renaming (same object Hash, different tree entry name)
    • Renaming and content updation occuring in the same commit (Different hash, different tree entry name. Would require file content analysis and comparison feature which is not available in libgit2)
    • Multiple parents history (two branches which have been merged and into which the same file has been modified in a different way)

    May be is there any other approach, for example, look directly into .git folder and get needed information there?

    Even though understanding the .git folder layout is always a well-spent time, I’m afraid this won’t help you with this specific file history issue.

    Note: this question is very close from this libgit2sharp issue: How to get the last commit that affected a given file?

    Update

    Pull request #963 adds this very feature.

    It’s available since LibGit2Sharp.0.22.0-pre20150415174523 pre-release NuGet package.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got another issue. Im trying to send an entire Map of objects and their
In another question I posted yesterday, I got very good advice on how a
I've got a function written by another developer which I am trying to modify
I need some help in combining a stored procedure with another function. I've got
I've got another problem when trying to overload the () operator for array access:
I've got another issue. My method: public StudentProfile GetFullStudentProfile(int userID) { SqlConnection conn =
I have got another mysterious issue. So, I am setting a background image for
Got another problem: There is a list with some words. If the length of
I got another problem: I'm just trying to make a nice and sweet log
I've got another question with List of lists. Once again, I have the generic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.