Hi,
I believe this is because when you first initialize a repo and haven’t made any commits, the HEAD for the repo hasn’t been created yet and it’s automatically set to that first commit.
Looking at this again, I think this could be easily remedied by checking the branch again after the commit, right now it uses the branch cached in memory. Will test further and look into including that in next release.
This has been fixed with the latest release. Thanks for the heads up!
Thread Starter
max_Q
(@max_q)
Another little wrinkle, a database backup I did before the initial commit was also assigned to “Unknown”. It’s the first commit in the list on the Commits page, with the commit message “Backed up the database with Revisr.” It’s now the only commit that still says “Unknown”. I’m using version 1.9.5. Just FYI.
That sounds about right. The fix applied in 1.9.5 will only work if you make the initial commit with 1.9.5 – it wasn’t a retroactive fix.
For initial commits pre-1.9.5 – the actual commit is set to the correct branch in Git – and is still able to be reverted to as long as the commit has a commit hash (which it should).
The reason behind this is that a branch isn’t technically created in Git until you make that first commit, before that it is just the “HEAD” of the repo.
Before 1.9.5, Revisr used the info already available before the commit to determine which branch you made the commit on (which worked fine for everything except getting the branch of the very first commit).
After 1.9.5, Revisr will do an additional check of the branch immediately after the commit and use that to update the commit in WordPress.
Let me know if you have any further questions/issues, thanks!