7
Gostwow
8y

Fucking hate it when I have to stop coding and commit in the middle of some function, always end with some weird commit message

Comments
  • 1
    Why would you commit in the middle of a function?
  • 0
    @DoctorWhatIf for example if I have to leave immediately otherwise I miss the train, I work in neighbour city
  • 0
    @Gostwow but if you're halfway through writing something, why commit unfinished work then?
    To me it sounds worse than just leaving it uncommitted until finished.
  • 0
    @DoctorWhatIf just to git pull when I get home and finish it but you're right in some situations it's better not to
  • 2
    @Gostwow oh, OK, if you're going to follow up on it it's understandable.
    But I would then (seeing as you're using gut) just write something like "work in progress - feature A" and then amend the commit later with a proper message, when the work was actually done.
  • 2
    @DoctorWhatIf that's actually a pretty good idea, didn't think of it
  • 1
    @Gostwow well, glad I could help 😉
  • 1
    @Gostwow also, git rebase -i is your friend if you have older commits like those you want to prettify.
  • 4
    For feature branches I own, I often just comment with "wip" for "work in progress" and then I either just "git commit -amend" to rewrite that message.

    Sometimes, I have loads of wip commits that I just squash into one once the feature is complete; and it's helpful that both github and bitbucket allow to merge a pull request using a squash strategy so that juniors and beginner can feel confident about just committing one commit back to master.
  • 0
    @k0pernikus out of curiosity, have you ever had situations (especially with the aforementioned junior developers) where squashing pull requests like that resulted in got weirdness (duplicated commits, etc.)?
Add Comment