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

Determine list of folders "changed" between one branch and another. #1749

Closed
Korporal opened this issue Jan 25, 2018 · 5 comments
Closed

Determine list of folders "changed" between one branch and another. #1749

Korporal opened this issue Jan 25, 2018 · 5 comments
Labels
Status: Stale Used by stalebot to clean house Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@Korporal
Copy link

Korporal commented Jan 25, 2018

If I have two branches (in some Octokit app) and we know these branches are out of step, is there a way to generate a list of distinct folder names which are involved in all of the difference?

I could easily generate this from the list of files I guess, since their full path will be present.

So better question: is there way to get the list of files involved between these two commits?

Thx

@shiftkey
Copy link
Member

You probably want the Compare Commits API:

var compare = await client.Repository.Commit.Compare(owner, repo, "master", "branch")

That will list out the whole file list, and it has some limits which are mentioned in the docs, but that should do the trick.

@Korporal
Copy link
Author

Korporal commented Jan 26, 2018

@shiftkey - Hi,
Im seeing compare results that have non-zero for BehindBy - yet the collection "Commits" is always empty, as is "Files", is this expected?

If I see AheadBy as non-zero these collections are populated....

@ryangribble
Copy link
Contributor

so is the answer here that in the comparison sense, it doesn report on the commit/file level of the BEHIND changes? Just like if you have a PR that is behind master, github.com doesnt show you the changes your PR "doesn't" have in it's branches, only "what would change in the base branch if you merge this PR". Could you diff in the other direction (B->A rather than A->B) if you want to get the reverse changes?

@Korporal
Copy link
Author

@ryangribble - Yes, "diffing" in reverse is an interesting suggestion, I'll certainly play with that and try to update this issue with what I find.

@github-actions
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Stale label Jun 24, 2022
@github-actions github-actions bot closed this as completed Jul 1, 2022
@nickfloyd nickfloyd added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs Status: Stale Used by stalebot to clean house and removed Question: using the SDK labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
None yet
Development

No branches or pull requests

4 participants