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
Keep order of project files #197
Keep order of project files #197
Conversation
ouch, I might have done something wrong, I don't want to merge SIX commits for sure |
That's a missing feature I always wanted — it's annoying to have to manually reorder files in the IDE by dragging tabs manually. The IDE should honour the files order found in the project file. Well done.
You only need to squash the pull-requests commits in your PR branch into one, and then force push the branch again; this will fix the PR: If things go wrong (locally) you can always hard reset you local PR branch ( |
e483627
to
9447687
Compare
It is still odd, in that squashed commit are still all my previous commits, which have been already merged into purebasics devel branch. Answer: Yes it will ;) |
Make sure you only squash the commits pertaining this PR, and leave previous one (i.e. those already merged) as they are.
Yes, seems likely. Before creating a new PR branch you always need to:
No, fetch and synch, as described above, then rebase your PR branch on That should solve it, even if you squashed previous commits (hopefully, unless there are new conflicts), since contents that were already present in previous PR would be simply ignored after the rebase. Usually rebasing is a fairly safe operation, but it might require solving conflicts at times (choosing either In general, keeping one feature per commit helps making rebase operation cleaner, since it's easier to track what changes are expected in each commit. |
The problem was, I made both PRs at once, but pushed just one and wanted to wait until it gets merged. |
That's because you merged with fast-forward which always creates a commit, unlike non-fast-forward (
If you could squash together the last two commits (9447687 and cc7e8f9) it would help keep a clean history. |
e26873d
to
36fb680
Compare
Or you add $ git remote add fantaisie-software https://github.com/fantaisie-software/purebasic
$ git fetch --all Then you can create a new feature branch from the $ git checkout --no-track -b new_feature fantaisie-software/devel
Switched to a new branch 'new_feature' And when the $ git checkout new_feature
$ git rebase fantaisie-software/devel
It's the other way around: fast-forward does not create a merge commit:
Source: |
36fb680
to
0737728
Compare
Hmm... from my point of view this should be fine now, why did it fail? My main problem was a completely scrumbled Devel branch, this here helped to get it back to normal: |
$ sh validate.sh
===========================================
Checking PureBasic Sources for IDE Settings
===========================================
/// Test Passed ///
==================================================
Checking PureBasic Sources for Trailing Whitespace
==================================================
/// Test Passed ///
================================================
Validating Code Styles via EditorConfig Settings
================================================
Using:
* Node.js v16.13.1
* EClint v2.8.1.
~~~ ERROR! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following files didn't pass the validation test:
PureBasicIDE/MacExtensions.pb
Run ECLint locally for detailed information about the problems.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/// Aborting All Tests /// You can also see the above output if you click at the very bottom of the PR page on the Travis error message on Details and then on The build in the opening page. $ eclint check
PureBasicIDE/MacExtensions.pb
01:01 ❌ expected charset: utf-8-bom
(EditorConfig charset https://goo.gl/hK94EO) |
interesting, I didn't touch that file at all |
Yes, it's @fantaisie-software's last commit 4d20f77 that triggers the problem. Yes, the fix should not be a part of this PR. |
I have created another version of the validation script which only validates the files which are actually affected by a commit or PR, but the problem is that it becomes too slow with medium to big projects (and with this repository, it's simply unusable). I'm waiting for a new tool to be usable in production, replacing EClint, which should be up to task, but as of yet it still has a bug. Once the tool is ready, I'll update the validation script and it should be more precise and faster. But then, the problem here is that no commits or PRs that fail the validation test should be merged into |
0737728
to
1e39f21
Compare
Yes, this has happened several times now. It would be better if @fantaisie-software would also create PRs so that his changes are also checked with Travis. That way others could give feedback as well. Or, if he wants to keep committing directly to |
The rules in The rule to ignore $ git ls-files | grep .pbp$
PureBasicIDE/PureBasicIDE.pbp You can still rebase by telling git to ignore the changes of the tracked file: $ git checkout pr-branch
$ git update-index --assume-unchanged PureBasicIDE/PureBasicIDE.pbp
$ git rebase fantaisie-software/devel
$ git update-index --no-assume-unchanged PureBasicIDE/PureBasicIDE.pbp Or discard the changes of the file $ git checkout pr-branch
$ git restore PureBasicIDE/PureBasicIDE.pbp
$ git rebase fantaisie-software/devel |
Thanks, I deleted my post, because I thought this might be the wrong place to argue about git in general. |
PureBasicIDE/ProjectManagement.pb
Outdated
;Tab can be moved by customer, therefore going through all open Tabs to find it. Maybe there is a better solution, but it works | ||
For i = 0 To CountTabBarGadgetItems(#GADGET_FilesPanel) - 1 | ||
If GetTabBarGadgetItemText(#GADGET_FilesPanel, i) = Language("Project", "TabTitle") + " [" + OldProjectName$ + "]" | ||
SetTabBarGadgetItemText(#GADGET_FilesPanel, i, Language("Project", "TabTitle") + " [" + ProjectName$ + "]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to apply the change with the [project name] also in line 568 of ProjectManagement.pb
(that code is called when preferences like language have changed)
That line also shows how to figure out the Tab index of the project tab without a loop and comparing element names. I think this would be a more elegant solution for this update here as well.
Co-authored-by: HeX0R <h3x0r@gmx.de>
Project files keep their tab positions in the IDE.
Additionally I've added the project name to the Project tab (shown as: Project [Name], instead of just Project)
More or less that whole feature request from here:
https://www.purebasic.fr/english/viewtopic.php?t=66119