-
Notifications
You must be signed in to change notification settings - Fork 149
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
Annotation text segment extending #14
Conversation
I think, you used the wrong functions for serialization. The new variables are doubles, therefore bu_cv_htond()/bu_cv_ntohd() should be used. |
@Himanshu40 great job keeping this PR up to date, but it appears as though you're doing git pull's from main which generates these merge commits. Running "git pull --rebase" avoids that, but can you see if you can delete the merge commits? This looks relevant: https://stackoverflow.com/questions/33502205/how-to-delete-merge-commits |
Wow, I never know that. Thanks for sharing on how to rebase. In future PRs, I will keep them in mind. |
It's actually pretty useful to always rebase when pulling so local commits are pushed forward in the chain instead of resulting in merge commits. You can set it up to work that way by default with: git config pull.rebase true That will make all "git pull" be a "git pull --rebase" unless the branch was specifically configured with rebase false, iirc. |
Note, you really only want to force-push whenever you absolutely have to (such as deleting merge commits). Otherwise, it looses all associativity on github and in any checkouts people already pulled. |
I came to know that merging creates a commit while rebasing doesn't. So I should not do the push until I create the next commit for PR. So I should not do force push always after I rebase. I should push only when I am about to do commit. |
You can (no force) push as many times as you want to a PR branch, usually without issue. It is only an issue when you’re trying to push merge commits. If you had a bigger PR with a hundred commits to review, even a couple merge commits wouldn’t be an issue. When it’s a nice small neat PR like yours that it matters more. That’s why if you always do git pull --rebase, it won’t make merge commits so you can continue editing, committing, and pushing to update the PR. The force push was just a one-time thing because you’d already pushed the merge commits and you have to force to undo them. That’s almost never done, this was a very rare exception. |
I have again forced pushed the commits and I learned the mistakes. I will keep it in mind next time. I am just testing it out after rebase if I can update my test branch with the main branch but didn't work as this PR listed out all the commits from the main branch. Looks like a local branch can be merged into remote, but as git push performs only fast-forward merges so it throws an error. So remote branch can't be fast-forwarded to local? |
There is some issue with the changes I have done.
|
Some of the .g files. |
If you load a file with bu_cv_ntohd() (the new version) which was written with htonl() (the old version), you get an error. But this shouldn't be a problem, because htonl() was in your copy of the brlcad repository only. It didn't made it into the official version. |
Looks like this may be the problem. I will soon test it out and will report. |
Looks like everything is fine now. I have tested it by creating and also by opening it. @drossberg |
One thing I noticed in line no 1209 of annot.c |
@brlcad I have a doubt. After I do |
Whenever I sync my main branch with the upstream branch and wanted also that my test branch also should be in sync with the main branch, I do rebase but git push is unable to push those commits. So I have to do a force push in order to make sync. |
I'm not 100% sure, could be several things. Are you updating your local main branch (i.e., Himanshu40:main) from BRL-CAD:main? If not, and only merging BRL-CAD:main into your PR feature branch, then that would explain why those commits would show up here. You'd be introducing commits to Himanshu40:test that do not exist on Himanshu40:main, so github shows them all as incoming commits. I think if you git pull on Himanshu40:main, then you should be able to rebase and push your test branch without issue, without forcing. |
What's the message you get when you try to push those commits? Not a great workaround, but we have a rebase and merge option here in the PR, so you don't need to rebase. You just need to make sure the PR has the commits that you want included. If the PR says "Merging can be performed automatically", then you have nothing to worry about. If it cannot, then you should totally do a merge commit to fix whatever conflict is preventing it from merging successfully. That's a case when merge commits are okay. |
Curious, is the bottom-left annotation positioned differently from all the rest? All the other annotations appear to be right-bottom aligned, yet left-top was specified. Hard to tell from that view without a rotation, but odd that one is inconsistent.. |
Yes, I am updating my local main branch to |
|
When my main branch is out of sync with remote
|
You don't need to do all of these. You should work the normal way:
Finally, when the PR is about to be merged, you select the option "Rebase and merge" instead of "Create a merge commit". |
Andrews branch merge
This is a patch to extend the text segment in the annotation primitive to have text size and text rotation angle parameters.
Reference to https://sourceforge.net/p/brlcad/patches/535/