-
Notifications
You must be signed in to change notification settings - Fork 53
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
Publish Documentation step report success but not publishing changes #147
Comments
I hit the same issue when trying to roll my own solution inspired by the Cake.Recipe code, I think the issue is with the underlying code in Cake.Git and/or LibGit2Sharp. Looking at the source code for LibGit2Sharp's RepositoryStatus, it seems that the "Staged" list only contains existing files that were modified, not files that were added, deleted or renamed. These are stored in separate lists. The Cake.Git method GitAliases.Repository.GitHasStagedChanges only checks the RepositoryStatus.Staged list, not the NewInIndex, DeletedFromIndex, RenamedInIndex. So if your changes only contain new files/deleted files/renamed files it will not actually commit or push anything. I guess it's a matter of discussion where the error lies, LibGit2Sharp's naming of the Staged-list is maybe a bit unfortunate, but I also guess that Cake.Git is consuming the RepositoryStatus "API" wrongly. Should we create an issue with the Cake_Git project? |
Ah. That makes sense. I think that seems correct then. What is missing is adding the new files to the staged list. That should be possible as an additional part of the deploy graph task. Nice work!
…________________________________
From: andreasnilsen <[email protected]>
Sent: Friday, September 7, 2018 4:32:34 PM
To: cake-contrib/Cake.Recipe
Cc: Warren; Author
Subject: Re: [cake-contrib/Cake.Recipe] Publish Documentation step report success but not publishing changes (#147)
I hit the same issue when trying to roll my own solution inspired by the Cake.Recipe code, I think the issue is with the underlying code in Cake.Git and/or LibGit2Sharp.
Looking at the source code for LibGit2Sharp's RepositoryStatus, it seems that the "Staged" list only contains existing files that were modified, not files that were added, deleted or renamed. These are stored in separate lists.
https://github.com/libgit2/libgit2sharp/blob/f8e2d42ed9051fa5a5348c1a13d006f0cc069bc7/LibGit2Sharp/RepositoryStatus.cs#L42
The Cake.Git method GitAliases.Repository.GitHasStagedChanges only checks the RepositoryStatus.Staged list, not the NewInIndex, DeletedFromIndex, RenamedInIndex.
`https://github.com/cake-contrib/Cake_Git/blob/ad0b56e6a8b53fcda9f1178f5a9953eff9f9d322/src/Cake.Git/GitAliases.Repository.cs#L120
So if your changes only contain new files/deleted files/renamed files it will not actually commit or push anything.
I guess it's a matter of discussion where the error lies, LibGit2Sharp's naming of the Staged-list is maybe a bit unfortunate, but I also guess that Cake.Git is consuming the RepositoryStatus "API" wrongly.
Should we create an issue with the Cake_Git project?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#147 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AF5xC2AivRiIYBGTQtBVQpFrDzQ13tmsks5uYpGSgaJpZM4PEnL8>.
|
@wozzo Well they are actually staged in Git, but LibGit2Sharp doesn't contain them in its' "staged list" in the RepositoryStatus. So I think this should be fixed in LibGit2Sharp/Cake.Git, not in Cake.Recipe. I created an issue with Cake.Git : cake-contrib/Cake_Git#77 |
Running locally I found that changes to documentation were staged however the
GitHasStagedChanges(publishFolder)
call on line 151 of wyam.cake returned false.The step reported success, but did not push any documentation.
The text was updated successfully, but these errors were encountered: