[RFC] FreeCAD commit history formatting ideas

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

[RFC] FreeCAD commit history formatting ideas

Post by Kunda1 »

As this FreeCAD 'engine' evolves and we have more developers with commit permissions updating the FreeCAD core ( 8-) :+1: ), it makes sense to me that we start applying a standard commit message format so it's easy to differentiate what workbench or portion of the FreeCAD core is being altered/modified.
The average commit looks something like this (again emphasis on average)

[Workbench] brief commit message no longer than X chars

Do we want to use this square bracket format around the workbench name ? Or are there other thoughts around this?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [RFC] FreeCAD commit history formatting ideas

Post by openBrain »

In the extent of my experience, square brackets are good because they have a good visibility in the message. However they are not so easy to catch on the keyboard, what can be "boring" when you have a lot to use. It can be envisaged to replace them with parenthesis "()" or chevrons "<>".

Also following this discussion, it could be a good idea that if the commit is worth appearing in the release notes, the message is prepended with a dedicated tag (eg. <BugFix> or <FeatureAdd> or ..., you probably have to define a short list of them). ;)
Obviously in this case, it shall always be considered regarding the latest release. I.e. if you introduce a new feature (tagged <FeatureAdd>) then discover a bug and fix it in the same dev cycle, you won't prepend the patching commit with <BugFix> to prevent duplicate entry in release notes.

My 2 cents. :)
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: [RFC] FreeCAD commit history formatting ideas

Post by mlampert »

I think this is good for PRs but too much overhead for commit messages. I can't come up with any value/use for it neither. On the PR it let's the respective committer know "this is for you, buddy", but on a single commit?
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: [RFC] FreeCAD commit history formatting ideas

Post by wandererfan »

mlampert wrote: Thu Jun 13, 2019 9:19 pm I think this is good for PRs but too much overhead for commit messages. I can't come up with any value/use for it neither. On the PR it let's the respective committer know "this is for you, buddy", but on a single commit?
+1.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [RFC] FreeCAD commit history formatting ideas

Post by triplus »

As a general guideline, commit messages shouldn't be too long. Some git tools complain, when you start creating too long commit message. Using some special formatting in commit messages could therefore likely go against such guidelines. We could decide to not follow such guidelines.

Anyway, i have a feeling Label (GitHub) was design for such purposes in the first place. And AFAIK it is already being used by people having write access, to organize their review process? Long story short, people having write access and doing the actual review should say if they need some additional formatting or are OK with how things work ATM. And if Label functionality still suffices for such purposes. In addition such things are usually guidelines and not rules. Therefore PR creator in the end has the freedom to choose the sensible thing to do.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [RFC] FreeCAD commit history formatting ideas

Post by Kunda1 »

FreeCAD is growing exponentially right now. I agree with @microelly2 that FreeCAD is an engine. I'm thinking that it makes sense in order to view the git history in a convenient way...but obviously not introduce too much rigidity.

Lets hear from the core devs too, when they get a moment to read this thread.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [RFC] FreeCAD commit history formatting ideas

Post by bernd »

I have started years ago to add a preface to my commit messages:

- FEM (may be 95 %)
- Material (2 %)
- Arch (2 %)
- Base, CMake, ... (1 %)

ahh this one is the best :mrgreen: https://github.com/FreeCAD/FreeCAD/comm ... c7cc14e2db
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: [RFC] FreeCAD commit history formatting ideas

Post by triplus »

Kunda1 wrote: Sat Jun 15, 2019 6:50 pm I agree with @microelly2 that FreeCAD is an engine.
I lean more towards FreeCAD being a CAD framework.
Lets hear from the core devs too, when they get a moment to read this thread.
I agree. If they care i guess we can care after too.
bernd wrote: Sat Jun 15, 2019 9:13 pm ahh this one is the best :mrgreen: https://github.com/FreeCAD/FreeCAD/comm ... c7cc14e2db
YEAH 1000 commits for great FreeCAD project :-) ahh the commit ... FEM: netgen mesh obj, typo in attribute description
Realistically this likely is a rather not ideally formatted PR commit message. ;) If most PR commit messages would be like that we would likely need to do something about it. As they are in general rather sensible formed maybe we are trying to fix a non existing issue? Anyway, if somebody would like to use a prefix in squared brackets, fell free to do that. If not, that is OK too. If somebody reaches a milestone and would like to have a special PR message, we are rather open to that too. Just try not to exaggerate! ;)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: [RFC] FreeCAD commit history formatting ideas

Post by abdullah »

Mostly, I prepend the WB name to the commit.

Sometimes I indicate whether it refers to the App or Gui.

I do this so that it is easy to identify what is being touched from the git log. If several commits are present in a PR, it also helps identify commits that touch places I generally do not commit to, such as freecad core.

I admit I am not fully consistent though.

I think there should be some leeway for the developer though. While standardisation may bring advantages, developers are generally rather sensitive to style topics. It is probably too much of a burden to force every single commit to follow a pattern. Developers will arc like cats if too much overhead is put into perceived lower value style matters :lol:

In any case, most developers are very focused in working area. If I see bernd, I directly assume its FEM, if I see wandererfan I assume is TechDraw (at least currently). My commits are mostly sketcher. What might make some sense is that we mark the commits that are outside our normal working area... maybe... just some idea.
wmayer
Founder
Posts: 20307
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: [RFC] FreeCAD commit history formatting ideas

Post by wmayer »

Lets hear from the core devs too, when they get a moment to read this thread.
For me it's not of much use when we have a prefix on the commit message because when I go through the commits logs in GH then usually I know in which directory I have to search and look at its history. Then I usually find very quickly what I search for.

IMO it's up to everybody to add a prefix or not.
Post Reply