develooper Front page | perl.perl5.porters | Postings from February 2022

Asking for guidelines on what should be in separate commits

Thread Next
From:
Karl Williamson
Date:
February 14, 2022 02:00
Subject:
Asking for guidelines on what should be in separate commits
Message ID:
fc820293-1047-fcf0-6337-25214792d53a@khwilliamson.com
I don't think we have any published guidance.

Before I got a commit bit I was chastised into making each commit a baby 
step so that the committer would be able to follow along a logical 
progression towards the goal.  This progression bore little resemblance 
to how the code actually got developed, and I became, and remain, a 
heavy user of 'git rebase -i'.

Nowadays, I still think of it this way, but a question I ask myself is, 
"If, heaven forbid, this commit ends up having to be reverted, would 
this bit naturally go along with the reversion, or would it fine or even 
better if it didn't also get reverted"?  The ideal commit is the 
smallest one in which the whole thing would want to be reverted if 
reversion should become necessary.  One could go too far, IMO, and make 
a separate commit for each typo fixed.  But I think that variable name 
changes, etc that aren't really germane to the goal of the main commit 
should be done in a separate commit.

It would be good to have something written down that guide people.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About