News for hackers. Stuff that matters.
Re:Using Git commit message templates to write better commit... by koyote on Wednesday January 12, 2022 @08:35PM (#29915693)
> Why was this done this way? It'd be so much easier just to do this instead

If there is a reason for it being done 'this way' that is not obvious then there should be a comment in the code explaining the thought process.

A commit won't really help you as much there as future refactoring might obscure the original commit that added the code.

That being said, if there's some complexity in what is being solved I will usually add a very quick description of it in the commit message "Used XYZ algorithm to implement ABC due to it being faster/cleaner. See: ticket/wiki/documentation".

Re:Using Git commit message templates to write better commit... by m000 on Thursday January 13, 2022 @02:56AM (#29917971)
> there should be a comment in the code explaining the thought process

Totally agree. Unofortunately, a descriptive git commit the best you can require without starting a religious war in the team.

You won't believe how many developers zealously subscribe to the "no comments needed - good code is self-explanatory" crap. Or throw in the "comments will quickly become outdated" excuse.

Re:Using Git commit message templates to write better commit... by soulofmischief on Saturday January 22, 2022 @12:41PM (#30038879)
In my experience, the code produced by these kinds of coworkers is neither good nor self-explanatory.