-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
"Current branch is..." showing wrong branch #422
Comments
NOTE: This is also happening identically for a theme at https://github.com/joelworsham/test-github-updater |
The branch switch gets it's branch info from the |
So the intent is that I'd be modifying that header on every commit to various branches? |
No, the intent is in your You never need to change or set them again. You would just need to be careful on branch merging not to merge the branch header as you don't want it changed. Take a look at the header branches in this project to get an idea of what I mean. Let me know if I can clear anything up further. |
I thought this was weird too, @afragen . I'm in the same boat as @joelworsham , and you may recall I opened a similar ticket and was told the same thing. In the end, I haven't bothered babysitting the Since I'm the only one that deals with the staging servers where we have branch switching enabled, it's not a big deal for me. But just chiming in to put in my 2 cents that I also don't think it's ideal. |
The issue from my end is that there's no way for my code to differentiate what branch you're working on. I can download or switch to a specific branch but I have no method of querying that plugin/theme afterwards to identify the branch.
@curtisbelt I don't know what you mean by babysitting the branch header. If there's some other method of querying an installed plugin/theme that will tell me what branch it is from, please send a PR. |
Apologies for my bluntness - if that's the only way it can be done then I understand. I don't personally know of a different way. |
Not to worry about the bluntness, I don't know of another way. As your plugin's code sits on your |
If I may ask a question, what problem do you have after adding the appropriate branch headers to the appropriate branches? After I've merged develop into master, I just make sure that the branch header didn't merge too. If it did I change it back before pushing. I've only had to do this the first time I merged as every merge after doesn't seem to pick up that the branch header has changed. |
Perhaps it's due to my naivety, but when committing and merging branches, wouldn't that github header line be viewed as a change and something to be committed? |
Only the first time the merge happens. After that it's not registered as a change. Before committing the merge from develop into master, make sure the branch is correct. If not, just fix before committing merge. After that I don't see branch header changes after merging. Give it a test and see. |
After using this for a while, I have noticed that, as I expected, when you open a new branch, update the branch header, commit, and then merge back (whether it be back into develop or master), the branch header is overridden, every time, from the branch I'm merging into it. You're saying you don't have this issue? I can't understand how you don't. If I make a commit in a new branch, and part of that commit is to modify the branch header line, why wouldn't it affect the branch I'm merging into? To my knowledge, there is no way to "skip" that line in a merge. If it's in the commit, it's coming over. I am forced to add an extra commit every time I merge branches, to fix the header. This really messes up tagging. I'm really curious as to how you've avoided this issue. |
Let me try to describe my workflow as maybe that will help. I usually have at minimum 2 branches, master and develop. Nothing goes into master except as a merge from develop. When I create a new branch to work on something from, it's usually a branch of develop. Depending upon whether or not others are using this new branch I may or may not set the 'GitHub Branch: develop' to the name of the actual branch. When I'm done with this branch and have merged it into develop, if I've changed the branch header I will almost always need to correct the commit in develop as the branch header has changed. After this has happened once, merging doesn't seem to pick up on the change. So, now I have All this being said I use Tower or GitKraken to manage my git repos. I'm not sure how it would affect this issue. It seems the issue is opening a new branch to merge back into master. Yes, the first time I open a new branch and rename the branch header I will have to reset it in another commit. PITA but I think that's just how git works. tl;dr I avoid the issue by not changing the branch header all the time and only merging |
That is my exact workflow. The "gitflow" workflow. Unfortunately the problem is still persistent for me. Merging from I guess there's not much more that can be done about it though. I'll keep experimenting and trying to come up with a way to make this more consistent. |
In Tower, if you use a squash commit when merging from develop to master, the changes will show without being committed. You should then be able to fix the branch header before committing. I think. |
I created a test repository here: https://github.com/joelworsham/test-github-updater-plugin/blob/develop/plugin.php. Dummy plugin with two branches, master and develop.
4.6-beta1-37941
.develop
.master
, ...".This is inaccurate. I confirmed the files that exist are indeed from
develop
and not frommaster
.Any more info I can provide let me know.
I really love this plugin, and I want to use it, but this is an inconvenient stopper for me.
The text was updated successfully, but these errors were encountered: