91 points

“Fix”

permalink
report
reply
65 points

With 400 lines changed over 50 files

permalink
report
parent
reply
34 points

“updates”

permalink
report
parent
reply
17 points

“feat: stuff”

Guilty of this one myself.

permalink
report
parent
reply
12 points

I had a commit recently that was like 2000 lines changed over 6 files. Really should have been a smaller issue.

permalink
report
parent
reply
13 points

“Bits were fiddled, possibly in the right way”

permalink
report
parent
reply
2 points

My butterfly was having a bad day so I can’t be sure, sorry

permalink
report
parent
reply
12 points

‘Change’ if I’m feeling particularly chaotic.

permalink
report
parent
reply
12 points

git commit -m $(date)

permalink
report
parent
reply
2 points

Make a cron job for git add . && git commit "$(date)" && git push -f

permalink
report
parent
reply
0 points
*

‘fixed odd or even function for values 600 to 950, plus other stuff I forgot to commit earlier’

permalink
report
parent
reply
56 points
*

Every time I commit I have to look through git diff, figure out what the hell I actually did, come up with something intelligent to say about jt, possibly split the commit into multiple commits if I changed multiple things, do some shuffling with git reset and git add

For some reason all my personal projects are all like 4K SLoC with 50 total commits, all of which include apologies for not doing more smaller commits

permalink
report
reply
40 points

There’s a bigger issue than your commit message if you don’t even know what you just coded and are committing.

permalink
report
parent
reply
25 points
*

You see, sometimes I code something, go to bed before finishing it, come back, decide not to commit because then I’d have to think of a commit message and I just want to code, start working on an unrelated feature, do that for a couple days, get distracted by life stuff and put the project down for a few weeks/months, rinse and repeat, and then I finally get around to writing a commit message because I’m about to start a huge change and I want a restore point and I’m like. Okay, it’s been like 3 months since my last commit, I’m pretty sure my code can now do something it couldn’t 3 months ago but come on, I can’t even remember what I had for lunch last Thursday

I’m well aware this is terrible practice but I don’t know how to stop doing it

permalink
report
parent
reply
20 points

Commit more often. Maybe work in a different feature branch, and don’t be afraid to commit your half-working crappy code. If it’s a personal project/fork, it’s totally acceptable to commit often with bad commit names and small unfinished changes: you can always amend/squash the commits later. That’s how I tend to work: create a new branch, work on the feature, rebase and merge (fast forward, no merge commit). Also, maybe don’t jump around working on random features :P

permalink
report
parent
reply
3 points

You can help yourself a lot here by making commits every time you make a meaningful change. A feature doesn’t need to be complete to commit major checkpoints along the path to completion. That’s what feature branches are for. Commit often. It’ll help you think of messages, and it’ll help you recover in the case of catastrophe.

permalink
report
parent
reply
1 point

you can setup a on-save script to force you to commit when the number of changes is greater than a certain number from the previous commit.

permalink
report
parent
reply
13 points

I just get too excited about actually implementing/fixing something (random things that I see along the way) more than commit ceremony (nobody will care about it in my project anyway other than one random guy who gave the repo a star)

permalink
report
parent
reply
5 points

Nah, I’m that guy, I gave your repo a star for the effort, but I’m not reading your history.

permalink
report
parent
reply
3 points

it means you commit too infrequently. your commit messages should be able to describe what u just did within 10 words.

permalink
report
parent
reply
4 points

psst, git add -p

permalink
report
parent
reply
3 points
*

Remind me what -p does.

Edit: never mind - I see it mentioned below.

permalink
report
parent
reply
2 points

Patch add - it shows you particular changes you made, and you choose whether or not to include them in the commit. (You can then use git stash -k to stash only the changes you did not add, so you can test before you commit.)

permalink
report
parent
reply
3 points

I spend much time splitting them up inside visual studio by file and individual lines changed to try and separate my many simultaneous changes into several somewhat usable commits. If I was stupid enough to make some big refactor at the same time I might just have to throw in the towel… It’s really painful after a few weeks to try and pick up the pieces of what I was doing but never commited too lol.

permalink
report
parent
reply
47 points

Just use What The Commit.

You can also create a git alias:

git config --global alias.yolo ‘!git add -A && git commit -m “$(curl --silent --fail https://whatthecommit.com/index.txt)”’

Now you can just type ‘git yolo’ to create a commit!

permalink
report
reply
14 points

“Make Sure You Are Square With Your God Before Trying To Merge This”

permalink
report
parent
reply
11 points

Full send.

permalink
report
parent
reply
4 points

Well such an informative reply! Thanks mate 👍

permalink
report
parent
reply
3 points
*

Thanks for that, I’ve been laughing like a little kid:

“hoo boy”

“lol”

“Become a programmer, they said. It’ll be fun, they said.”

I can feel those so well! :')

permalink
report
parent
reply
1 point

Well that’s about half my commit messages that are going to be nonsense on weekends projects, now. Thank you!

permalink
report
parent
reply
35 points

Psst,

git add -p

permalink
report
reply
12 points

What does this?

permalink
report
parent
reply
39 points

“patch mode” - Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

permalink
report
parent
reply
13 points

Highly recommend throwing --patch on any git commands you’re used to using. You will have the prettiest, most atomic fkn commit, I’m serious people will love you for it.

I mean many people won’t care, but the quality folk will notice and approve.

permalink
report
parent
reply
3 points

Yay, learning!

permalink
report
parent
reply
7 points
*

Better yet, git commit -p

permalink
report
parent
reply
6 points

uuuuuuuu. and you could do -m to describe the commit.

next they’ll add --push/-P.

perhaps add -r for fetch/rebase then commit.

one command to rule them all! 😈

permalink
report
parent
reply
18 points
*

git commit -m “changed somethings “

git push origin master

permalink
report
reply
15 points

You forgot this --force flag.

permalink
report
parent
reply
7 points

I’m too lazy, I use -f

permalink
report
parent
reply
1 point

Do you always have to do origin master? I’ve seen it where sometimes just git push works and other times not.

permalink
report
parent
reply
3 points

uh in any actual company you almost never push to origin master. so I think it’s a joke.

permalink
report
parent
reply
6 points

Not with that attitude! /s

permalink
report
parent
reply
1 point
*

Depends on the configuration right?

You can work on your branch and then push that to integration for example.

I mean you’re not working on your local master/main branch right?

permalink
report
parent
reply
1 point

In most actually companies you can try push to origin master, but it’ll likely get rejected by the repo’s security policies.

permalink
report
parent
reply
2 points
1 point

I tired that, still was having issues, weeeird.

permalink
report
parent
reply
2 points

where it Just Works, the branch is set up to track a remote branch

https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches

permalink
report
parent
reply
2 points

push origin your/branch

Pushes, you guessed it, your/branch!

Head is usually your checked out working branch if you’re not in a headless state, right?

permalink
report
parent
reply
3 points

Force push main, straight to jail🤣

Yup yup, usually you’re on a branch, sometimes a tag. I mean it’s all just pointers to references at the end of the day. I tend to treat Git like a story book, some folks still act like it’s SVN.

permalink
report
parent
reply
1 point

I think it depends what branch your local version of the repo is set to. If you’re already in master then it’ll push there, if you’re in a testing branch then you can push it straight to master instead by telling it to

permalink
report
parent
reply
1 point

I just meant it not auto creating a new matching named branch.

permalink
report
parent
reply
0 points

That’s part of the joke, I think. If it’s a repo more than just you use, you would almost never push directly to the main branch.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.4K

    Monthly active users

  • 1K

    Posts

  • 37K

    Comments