jbranchaud / ocelot

Because you're awesome!
4 stars 1 forks source link

Implicit ocelot notation #11

Open jurgns opened 11 years ago

jurgns commented 11 years ago

I would like to propose what I'm calling "implicit ocelot notation". In this format, a commit message would refer to all files changed on the commit. This serves two purposes (maybe more). First, when committing changes to a single file, the entire commit message provided would apply to the file committed without additional markup. I a can image something like a very small commit that fixes a problem with a single file where the commit message would be the same for the general message as well as the file specific notation. Image a commit message like the following:

Fixed grammar issues in project readme.
[README.md]
fixed grammar issues.

This is rather cumbersome for such a small change would could just as easily be addressed as follows with the implied file altered would be the only one on the commit.

Fixed grammar issues in project readme.

Much simpler for such an obvious change.

Second, the implicit notation would also serve to aid in backwards compatibility to projects that adopt the ocelot approach. An older commit will refer to the changes to several files with a single commit. The ocelot approach would then assume that the message refers to a relationship that exists between each of the files. For data mining of project commits this is less than ideal but if this the assumption of the parser (whenever one is written), incorporating old commit messages would become much simpler.

@jbranchaud and I had talked about this today, are there any additional thoughts?

jbranchaud commented 11 years ago

I think this is great because as much as possible I want ocelot to be succinct and brief.

That being said, my one concern is that people will get lazy and do one-liner messages when more is needed. While we cannot force particular practices on people, I think the implicit notation should generally be discouraged when there are multiple files (unless the commit really is that simple).

jurgns commented 11 years ago

I agree completely that this notation should be avoiding when committing multiple files. Maybe instead of implying that the message applies to all files in the commit, the commit is disregarding when doing analysis?

We could potentially add a portion to the commit-hook that will throw a validation error when no ocelot notation is present when attempting to commit multiple files but allow the case when there is only one file.