0

The repo structure looks like this:

- folder_a
- folder_b
- folder_c
- ...

I am particularly interested in the files that changed in a specific commit, but only the ones in folder_a. My solution is

for filename, details in commit.stats.files.items():
  if not filename.startswith('folder_a'):
     continue
  # ...

but it seems the performance is not quite good if there are a great number of files in the other folders. Is there any better way to skip the files I don't care about?

1 Answer 1

1

If I understand correctly : you want stats on modifications from a commit, only on one specific subfolder.

Using plain git :

git show [commit] --stat folder_a

will display exactly what you want.

Have a look at what : git.show('<commit identifier>', '--stat', 'folder_a'); returns in your python script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.