News for hackers. Stuff that matters.
Re:Comparing Git Workflows by jasode on Thursday May 26, 2016 @01:55PM (#11780072)
>--every commit should compile,

No, that advice is wrong and not relevant to a git private branch. That strict & disciplined attitude about commits was relevant for older centralized source control tools with lock/checkout/checkin/unlock such as CVS and SVN. In that previous scenario, your colleagues depended on the shared repo to properly compile and therefore, you shouldn't "break the build" and derail the team.

>educate the others on proper practices for committing,

On a private branch, people should commit whenever they want on any whim of a reason. This will result in many commits that don't compile/build. That's ok. That's what the later step of "squash" into "logical" commits is for.

To repeat a previous comment about it:

The confusion is that the same "git commit" command is used for 2 very different semantic purposes:

(1) git commit -m "fixed bug #23984" --> as Logical-Unit-Work and worthy of bisect

(2) git commit -m "wip" --> as meaningless backup/savepoint like Ctrl+S save

The type (2) was for the programmer's internal purposes of safety backups, cleaning up whitespace, typos in comments, reflexive muscle memory of saving often, etc. Type (2) commits can have deliberate broken syntax and they're not meant to be built or be bisected.

Type (2) commits should never be discouraged because saving work often (including broken midstream work) is a good habit but from an outsiders perspective of the reviewers upstream, they are way too noisy. The spurious commits could be less than 30 seconds apart with no compile/build step in between.

>Squashing commits is avoiding the problem

I hope it's now clear that "squashing" is the correct tool for Type 2 commits.

Re:Comparing Git Workflows by mikegerwitz on Thursday May 26, 2016 @01:59PM (#11780108)
> On a private branch, people should commit whenever they want on any whim of a reason.

The concern was when that private branch isn't cleaned up before it is make public; it then becomes an issue.

Though see my reply to developer2 (sibling of your post) for rationale against garbage commits to begin with.

Re:Comparing Git Workflows by harperlee on Thursday May 26, 2016 @02:14PM (#11780235)
But if I commit on a whim, e.g. before jumping on the plane, how can I then patch to separate some changes in two commits?
Re:Comparing Git Workflows by jon-wood on Thursday May 26, 2016 @02:30PM (#11780364)
I'll often use WIP commits at the end of the day, or when context switching to something else, then when I'm ready to carry on I reset back to the previous commit and it's like nothing happened.
Re:Comparing Git Workflows by apparentlymart on Saturday May 28, 2016 @11:33AM (#11791998)
git rebase -i master