-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature Request: generate-profile builds diff #5
Comments
Hello, Thank you for this interesting feedback. This idea seems good, and you've right, generate profile outputs too much config... Fyi: You have a command, that is not generating a profile, but can display differences between 2 folders / files : I will take for how to make your request! |
I totally agree with this feature! What I did to try to accomplish the same is to run the generate profile command on a fresh marlin, then run it again on the modified marlin and do a diff. That seemed to work reasonably well but I am not positive if this will work properly and here is why. When I generate a profile from standard unmodified Marlin and then do an apply using that profile I would expect to see zero changes, however there are 49 changes in the adv config file and 5 in the standard config file. Here are the changes in the adv file:
A lot of them are not straightforward setting this value because they are conditional based on other things being set so I think the logic is confused about those types. When I actually do the apply it changes the values within the conditionals which it really shouldn't be doing. I think it is evaluating what the value is ultimately set to but when applying it just finds the first instance and updates that value. Here is an example code block that is being updated:
When chamber mode is 0 the fan is supposed to be set to 255 and it changed that next line to 128. So I think the diff will get you some of the way there but you will have to remove some of the values like the example shown which are really false positives of changes. Obviously this logic won't be super easy to automate but hopefully it gets us a lot of the way. |
Just an example of the output of doing this I took the stock Marlin and the default Ender 3 profile, generated two profiles and performed the diff and here is what I get:
Basically I just grab whatever is added to the enabled section and whatever is added to the disabled. If something is added from enabled it should also be shown as removed in the diff but really you should only need those listed as adds to avoid running into the situation listed above where something hasn't been really changed from default. When I run the apply with just those diffs to the ender3 configuration of marlin I get zero updates shown to apply, which seems like it is working properly with those diffs. Even if it didn't have the other functionality using this tool to be able to get the diffs between firmware configs is awesome! Thanks @Chuckame! |
Hello there, great ideas, but please send what you've done with which files (executed command + upload your files as a code block). @jbellmore not agree all of your idea 😄 this is not the goal of this tool to understand if a constant is in an actived if block. The goal is to keep it stupid and simple (KISS), so you can do it in an other way: make a profile for general config, and an other for the chamber config. And when you want to activate the chamber, just apply the common config + the chamber config. And if you don't want it, just don't apply it 👌 For the generation of a "diff" profile, good idea, I think I will add a @jbellmore please create another issue corresponding to your problem/expectation, this will be more simple for me to follow 😁 |
Or I just change the current |
Hey sorry if I was unclear above. After re-reading this thread I definitely didn't mean to imply it should solve that problem just that doing the diff will require the original unmodified marlin source to be able to compare since without that you won't be able to tell which values are indeed changed or not without some massive effort to interpret the source code, which obviously I don't think is something this project should undertake! My point was to try to illustrate that you can't simply take the generated profile and re-apply that or else you will likely get unintended source modifications. After re-reading the original post it appears I am saying the say thing as @evilC 😄 So I would agree the diff just needs to be the diff of the 2 generated config files, the one generated by unmodified marlin and the one generated by the modified source. So I would think it would depend on the intent of what you want the The other option would be to modify the I think both would be completely reasonable and have no strong opinions either way! Thanks again! |
@evilC @jbellmore can you test the new pull request ? Tell me if ok for you 😄 |
Just tested this one also, seems to work great! I ran this against Vanilla 2.0 Marlin and the stock Bigtreetech SKR Mini E3 V2 firmware and got the following output:
It is certainly way less than I would expect if it wasn't working at all. I don't know enough about the stock firmware values for the SKR (just getting started with it) but everything I am seeing looks reasonable to me! I am sure some of them are just differences in cases or spacing but I would certainly expect those to show up in the diff so seems to be working to me. Thanks so much, this is incredibly useful! |
Actually just an update, I apparently was doing the diff backwards, I had the vanilla Marlin as the I also tested by trying to apply to diff back to the SKR source and I get zero changes (as I would expect). When I apply the diff to vanilla Marlin I get a lot of changes. So based that, it seems like it should be working correctly. Thanks again! |
Cool! I will merge the feature asap, and maybe use a real C language Parser to get grain fined values (like mathematical ops, or arrays). Thanks for your great feedback! |
As a user
I want to be able to take an existingly modified version of Marlin, plus the original unmodified Marlin source that it was derived from, and generate a profile yaml file which only contains the changes that were made to the unmodified source to get to the modified version.
So that I can take my existing modified marlin and create as minimal a profile.yaml as possible
TLDR, I think that while the
generate-profile
command is nice, it creates a lot of noise - you end up with every single constant and the current value (Be it the original value or your new one), when all you really are interested in is what you changedGiven an unaltered Marlin folder
Marlin
And a modified Marlin folder
Modified
When I execute a command similar to
marlin-console-configurator generate-profile ./Marlin ./Modified -d ./diff.yaml
Then
diff.yaml
is created with ONLY the differences betweenMarlin
andModified
ie:
Original Marlin source (
Marlin\Configuration.h
):Modified Marlin source (
Modified\Configuration.h
)Output (
diff.yaml
):The text was updated successfully, but these errors were encountered: