Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm if this works with repos with branches in the history #46

Open
simonw opened this issue Dec 8, 2021 · 2 comments
Open

Confirm if this works with repos with branches in the history #46

simonw opened this issue Dec 8, 2021 · 2 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Dec 8, 2021

I couldn't get this to work, and I have a hunch it may be because that repository uses branches and doesn't have a linear history:

git-history file iam.db \
  policy_sentry/shared/data/iam-definition.json \
  --id service --id privilege \
  --convert '
data = json.loads(content)
for service, stuff in data.items():
    for _, privilege in stuff["privileges"].items():
        privilege["service"] = service
        yield privilege
' --branch master

Against https://github.com/salesforce/policy_sentry

Originally posted by @simonw in simonw/iam-definitions-datasette#1 (comment)

@simonw simonw added the research label Dec 8, 2021
@simonw
Copy link
Owner Author

simonw commented Dec 8, 2021

Visualization of the branches over time: https://github.com/salesforce/policy_sentry/network

@simonw
Copy link
Owner Author

simonw commented Dec 8, 2021

I'm suspicious that this code isn't iterating across every commit:

repo = git.Repo(repo_path, odbt=git.GitDB)
commits = reversed(list(repo.iter_commits(ref, paths=[relative_path])))

I added some debug logging and I couldn't see it visit any commits which included versions of the policy_sentry/shared/data/iam-definition.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant