← Home ← Back to /g/

Thread 106361987

111 posts 34 images /g/
Anonymous No.106361987 >>106362005 >>106362170 >>106362281 >>106362535 >>106364373 >>106364611 >>106366405 >>106366758 >>106366800 >>106366883 >>106366956 >>106369945 >>106369966 >>106370669 >>106370724 >>106370732 >>106370733 >>106370807 >>106370970 >>106371233 >>106371886 >>106371889 >>106372005 >>106372048 >>106372536 >>106373112 >>106373612 >>106373885 >>106374347
Git Hygiene
>fixed some bugs
>updated files
>updated more files
>fixed issue
>deleted some files
>adding code

Why do people, including some experienced engineers, write retarded commit messages? What the fuck does "updated files" even mean?

Even when they actually write a proper commit message and you take a look at the delta, there are irrelevant changes, reformatting, and other useless bullshit all lumped together.
Anonymous No.106362005
>>106361987 (OP)
why do you assume that I remember what I had been doing when I commit?
Anonymous No.106362018 >>106370930
If you're not paying me, I can be as lazy as I want.
Anonymous No.106362170
>>106361987 (OP)
>Why do people, including some experienced engineers, write retarded commit messages?
because they are retarded, they are basically niggers with no awareness of the future
Anonymous No.106362171
I commit all my retarded shit on a separate branch and then merge to main with a squash commit
Anonymous No.106362217 >>106370149
I commit reformatting changes becaus my coworkers are disgusting when the write code
Anonymous No.106362281 >>106362524 >>106362526 >>106366421 >>106367393 >>106367460 >>106367576 >>106369945 >>106373336 >>106373885
>>106361987 (OP)
They click on whatever shit interface their IDE presents to them and they'll commit and push. Forget re-ordering commits or amending or fixing up commits. If there has not been a single rebase in an entire project, it's a sign that everyone involved is a retard.

Retard detection script:

#!/bin/bash

retard=true

for commit_hash in $(git rev-list HEAD); do
author_date=$(git show -s --format="%at" "$commit_hash")
commit_date=$(git show -s --format="%ct" "$commit_hash")

if [ "$author_date" -ne "$commit_date" ]; then
retard=false
break
fi
done

if $retard; then
echo "Everyone in this project is retarded."
fi
Anonymous No.106362524
>>106362281
Stupid IDE button clickers are worse than college kids who are at least willing to learn
My coworker has no clue about version control yet he refuses to spend 5 minutes googling because that would makes him look stupid
>click rebase branch
>checkout master
>rebase merge
>fucks up 3 months of commit history
>remote rejects push
>force push
Anonymous No.106362526
>>106362281
Shit is crazy, there's a guy on my team who has been working there for 3.5 years, and I fear he's never going to make it past middle level. I mean, the dude works really hard, but it's like he doesn't bother to learn how to use the tools given to him properly.
A student part-time worker shows more promise than he does, but I guess that's just what young people are good at.
Anonymous No.106362535
>>106361987 (OP)
I write very detailed commit messages, and I group logical changes together and regularly rebase to order them better.

It benefits future versions of myself, when I come back to a project after a few years and can't remember WHY I did something.
Anonymous No.106362750
50% of the time I only use Git to track changes, not to describe what those changes were
That's a task for future me to do when I interactive rebase before submitting patches (or for personal projects, never)
Anonymous No.106362849
I only commit significant changes, which are logically grouped across multiple files. The code itself should be self-explanatory, you shouldn't have to write a novel in the commit message
Anonymous No.106363073
I reformat my project with tabs when I make enhancement commits and with spaces when I make fix commits. That way they can easily be distinguished at a glance.
Anonymous No.106363420 >>106364257 >>106370124 >>106370500 >>106370646
adding partial changes with git is a massive pain in the ass, because it never manages to detect chunks properly
not gonna spend 15 minutes reformatting shit in the text editor with git add -e just so i can have a slightly neater history that i will never look at anyway
Anonymous No.106363466 >>106363530
worrying about how good your version control history is is for freetard faggots that don't write any real code and just wank off about licenses and attribution and documentation and build systems instead of actually writing software that works.
the only use of version control is to give you a big "undo" button in case you screw something up. in this case, the best version control is to have a batch script in your project that just zips everything up into a 7z file. then you click on that batch script every day or when you're about to start making big changes. if it doesn't work out, no big deal, just delete everything and restore from one of the checkpoints.
Anonymous No.106363530 >>106363617
>>106363466
>windows retard needs to use batch scripts for version control because git doesn't work well there
that's funny
Anonymous No.106363609
I which there's a version control system that's less retarded than git.
Anonymous No.106363617 >>106363655 >>106370745
>>106363530
git works on windows the exact same way it does on linux, retard
(which is badly, because it's a poorly designed piece of shit)
Anonymous No.106363655
>>106363617
no it doesn't lol, you're just a brainlet that doesn't understand the internals
Anonymous No.106364257
>>106363420
>it never manages to detect chunks properly

Try histogram or patience instead of Myers.
Anonymous No.106364373 >>106368867
>>106361987 (OP)
>fixed
>updated
>added
>deleted

People who use past tense in commit messages are the kind of morons who think every brainfart they had belongs in the history.
Anonymous No.106364386
It's because of Github.
Github does not show commit message prominently, so people write garbage commit messages and focus on the pull request description instead (which is kept inside Github).
Anonymous No.106364501
Because they're retarded. It takes barely a few words to summarize what a commit does, and if that is too difficult for somebody to do consistently, then that's a good sign that they don't belong any where near a software project.
Anonymous No.106364611
>>106361987 (OP)
They’re just trying to spam commits to make themselves look more productive. They’re out here trying to get a raise and you’re bring a hater.
Anonymous No.106366405 >>106366600
>>106361987 (OP)
nigga if i've committed a comment fix or whatever you expect me to write 3 lines of a commit message?

Now if I'm doing something more serious I'll write a descriptive message of course. Although the best strat is to just tie the commit message to the jira ticket or whatever workflow system your company is using
Anonymous No.106366421
>>106362281
kek, lil bro thinks he's a linux kernel maintainer.
Anonymous No.106366600
>>106366405
>nigga if i've committed a comment fix or whatever you expect me to write 3 lines of a commit message?
nobody said that, stop taking every statement you see on the internet to the extreme
Anonymous No.106366758
>>106361987 (OP)
i will say whatever i want in my commit to my shitty 13 year old codebase.
Anonymous No.106366800
>>106361987 (OP)
>What the fuck does "updated files" even mean?
I'm going out on a limb here, but it probably means that files were updated, namely the ones that git shows you under "changed files"
Anonymous No.106366883
>>106361987 (OP)
$ git commit
Aborting commit due to empty commit message.

$ git commit -m .
[master (root-commit) 6d5fe01] .
1 file changed, 450 insertions(+), 0 deletions(-)
Anonymous No.106366956
>>106361987 (OP)
not training your LLM for free
Anonymous No.106366971
>merged branch master into fixes
>merged branch fixes into master
Anonymous No.106367126
commit messages don't matter
my commit messages are just a random UUID
Anonymous No.106367393
>>106362281
This is not a reliable method for checking for rebases. I can use git rebase with either --committer-date-is-author-date or --reset-author-date to make author- and committer dates of the new commit match. The former option uses the author date as the committer date, and the latter option uses the current time as the author date, which is also the committer date. So if you use this script in git repos used by high-IQ individuals like I am, then you will just out yourself as a mid-wit.
Anonymous No.106367460 >>106367509 >>106367574 >>106369570
>>106362281
Autists like you should just stick to tinkertrannying your own shit, who gives a FUCK if your precious git graph is ugly? Who gives a fuck if I just click a button to do a routine thing instead of worrying about how it will look on your little git graph? And most importantly why the fuck should I lie about the real version history to make it look pretty for you?
Anonymous No.106367509 >>106369796
>>106367460
>Who gives a fuck
I do, get fucked idiot
Anonymous No.106367574
>>106367460
I don't want to see your commit x followed by three "fix commit x", just squash this shit together and push only this one commit.
Anonymous No.106367576
>>106362281
I make a shit load of commits when I test something the when I get a proper solution, I git reset before the first commit and paste the whole fixed code with a nice commit message there. Find a flaw
Anonymous No.106367611 >>106370167
all the cool kids on the block now use copilot to generate commit messages
if your commit message is smaller than the actual commit you're a trash developer
Anonymous No.106368577
Whst's a good ressource to learn this?
Anonymous No.106368867 >>106368914
>>106364373
it's literally called commit history, retard
Anonymous No.106368914 >>106369337
>>106368867
git commit history is actually fluid just like gender
a commit can be applied again so it should always tell you what it does (e.g. "fix spork id" instead of "fixed spork id")
Anonymous No.106369297
I don't even bother putting a git message, all my git commits say the same. My code is perfect I never look back
Anonymous No.106369337
>>106368914
You are a gay faggot but that is actually a good point. I will stop doing past tense.
Anonymous No.106369570
>>106367460
When I'm debugging your shitty code, I want to be able to git bisect and git blame it
Anonymous No.106369796
>>106367509
Don't you tell him to get fucked you fucking fuck fuck.
Anonymous No.106369945
>>106361987 (OP)
It is very common among physicists
t. worked with a bunch of PhDs and they ALL do shit like this and never bother to learn
I even one had one retard merge updates from master to his branch and he somehow screwed it up and reverted master to half a year ago. My message to
>please be careful next time
was considered rude and aggressive. I don't work there anymore.
>>106362281
>They click on whatever shit interface their IDE presents to them and they'll commit and push.
This. The GUI claims to improve accessibility when in reality it's convoluted and hides essential info.
Anonymous No.106369966
>>106361987 (OP)
>What the fuck does "updated files" even mean?
It means don't fucking worry about it.
Anonymous No.106370124
>>106363420
>lil bro has ADHD and cannot concentrate on one thing at a time
Anonymous No.106370149
>>106362217
>*push a reformatting commit*
>hey anon, I have conflicts all over the place, stop doing that!
>HR: anon, your behavior is not teamwork-aligned, we have to replace you with Rajeesh Sneedrahan now, bye
All too common
Anonymous No.106370167
>>106367611
>mfw adding at least 2 random lorem ipsum paragraphs to each commit message
Anonymous No.106370500
>>106363420
>he does not jerk it to the commit graph
Anonymous No.106370646 >>106370693
>>106363420
try mercurial
git sucks
Anonymous No.106370669 >>106370735
>>106361987 (OP)
>Why do people, including some experienced engineers, write retarded commit messages?
Just say jeets anon. The future white man woulld hate himself when confronted with such a commit message when hunting down a bug. A jeet? No, this will make add more hours to my paycheck!
Anonymous No.106370693 >>106370838
>>106370646
sorry anon, git won
Anonymous No.106370724 >>106373016 >>106373866
>>106361987 (OP)
somewhat off topic, but when in a project should you make your initial commit?
i assume it's not when you're just getting things working and all of your variable names are still racial slurs
Anonymous No.106370732
>>106361987 (OP)
I write messages like this when I'm too busy or lazy to bother figuring out something more descriptive.
Anonymous No.106370733
>>106361987 (OP)

git add *
git commit -m "svdbsbf"
git push origin
Anonymous No.106370735
>>106370669
unironically this
i saw some git commits from our "indian center of excellence" and holy shit was it bad
Anonymous No.106370745
>>106363617
autocrlf
Anonymous No.106370786
I have never used rebase and you can't stop me.
Anonymous No.106370807 >>106370860 >>106370868
>>106361987 (OP)
I just want to have the files tracked so I can diff shit if needed. I don't care to write a fucking poem for every bugfix.
Anonymous No.106370838
>>106370693
nope
Anonymous No.106370860
>>106370807
>I don't care to write a fucking poem for every bugfix.
another retard who takes any criticism to the extreme
Anonymous No.106370868 >>106370891
>>106370807
Good luck going through your changes from weeks ago
Anonymous No.106370889
Every year I just push out a 10K "rewrote it slightly better this time".
Anonymous No.106370891 >>106371079
>>106370868
NTA but I just go to the PR from that week and check the changes.
Anonymous No.106370930 >>106371849
>>106362018
i used to work at a place with a bunch of indian devs, and all their commit messages (and docs/comments) were more like:
>fxded soem bugs
>updtaed filse
>fixed isuse
>- issue wa s fxed
i do wonder what, if anything, is going through their heads when they do this
Anonymous No.106370970 >>106371194 >>106371860 >>106372088
>>106361987 (OP)
I wrote useful git commit messages until my boss told me to stop.
Anonymous No.106371079 >>106371090
>>106370891
>but I just go to the PR from that week and check the changes
what a horrible UX, it seems like people who can't be fucked to write concise commit messages are also fine dealing with the web interface
apparently, it's too difficult to summarize your changes in commit messages and then copy and paste the summary into a MR description
Anonymous No.106371090 >>106371123
>>106371079
You can see PRs in VS Code now, dood.
Anonymous No.106371123 >>106371131
>>106371090
good for you, but I don't use VSChode, and I use git cli most of the time anyway
I'm curious now how does that work, is there a panel with all the MRs and you just look for the one that contains your changes? does it also track which commit belongs to which MR?
Anonymous No.106371131
>>106371123
Yes, there's also gitlens and git blame extensions for looking at history. I can bring up each commit change and the differences too. I'm not saying it's the best way to do things, but I've gotten used enough to the tool that I can navigate it without much time loss.
Anonymous No.106371194
>>106370970
Anonymous No.106371233 >>106371810
>>106361987 (OP)
>fixed some bugs
>updated files
>updated more files
>fixed issue
>deleted some files
>adding code
It means "no major changes, you can look the specifics on the diff"
Anonymous No.106371810 >>106371827 >>106371878
>>106371233
"Major" is subjective, bro. I had colleagues calling renaming shit in their API a "minor" change not worthy of a commit msg because fuck it fixing downstream is other's responsibility.
Anonymous No.106371827
>>106371810
API changes mean the version number changes, period
Anonymous No.106371849
>>106370930
parasites randomly flip bytes in their heads
Anonymous No.106371860
>>106370970
Did he feel emasculated by your skillz?
Anonymous No.106371878 >>106371954
>>106371810
>subjective
Yeah, the guy writing the commit decides whether it's major enough to warrant a full description or if it's minor enough to get a one liner. If your project requires some specific policy criteria for how to describe commits then your project requires some specific policy criteria for how to describe commits.
Anonymous No.106371886 >>106372033
>>106361987 (OP)
>a colleague leaves trailing whitespaces and excess newlines
>my editor (vim btw) fixes that shit on save
>have to carefully add the changes to not explode the diff
MFW
Anonymous No.106371889 >>106372389
>>106361987 (OP)
Git commit comments are retarded and should be treated as such. Nobody actually needs to read them. If you need to know when a feature was introduced you do a binary search. If you want to know what a commit changed you look at the diff. If you want context during a review you read the issue or merge request or ask the author directly. Git commit messages have one use: reminding the author what they did in the short term.
Anonymous No.106371917
Yes, I squash all commits before merging and my messages simply point to a closed Issue.
Anonymous No.106371954 >>106372002
>>106371878
imo if a commit warrants a multi-line description of WHAT you've done, you better make multiple commits or make a branch and merge it
the extra lines are for WHY you've made this commit, at least, the kernel people often do it
>policy criteria for commits
is there a way to enforce this except a PR review? a commit hook maybe? in small teams, the PR-only workflow only adds overhead, so committing to master is often still allowed
Anonymous No.106372002
>>106371954
I understand you believing such and such need explanation, but the guy making the commit clearly didn't believe it needed an explanation. Which shifts your problem towards enforcing a repo wide policy of uniformizing these disparate opinions. To which I have no answer but I believe yeah, PR review sounds like the way to go.
Anonymous No.106372005 >>106372054 >>106372180
>>106361987 (OP)
These people ensure they don't get fired easily, retard-kun. Your fully committed documented clean code with fancy git logs only makes you more replaceable.
Anonymous No.106372033 >>106372103
>>106371886
Always do
>take his shitty whitespace commit
>fix nothign else
>commit -m "Fixed bad end of line whitespace added by niggerfaggot"
>then your do your changes and commits
>don't squash that one
Keep pushing it to main history and if he doesn't notice his behaviour is bad, then you keep pushing commits calling him out. The "exploded diff" will be contained in one commit, and the next diffs shouldn't give explosions, as it should only reappear on the individual lines he edits.
Anonymous No.106372048
>>106361987 (OP)
Cry more, bitch.

/thread
Anonymous No.106372054 >>106372127 >>106372156
>>106372005
>clearly document everything, except the time bomb
>boss thinks you're replaceable and fires you
>shit blows up
>new guy can't fix it despite the code being so perfectly clean
>boss hires you back on consultant rates to fix shit that was clearly introduced by the new guy who doesn't make such great well documented code like you always did
Anonymous No.106372088
>>106370970
I feel you on this one. My boss told me I'm not allowed to even speak to anyone about what my code does because, apparently, "communication protocol" and "filesystem" are too complex of topics for him to comprehend.
Anonymous No.106372103 >>106372127
>>106372033
>gets reported to HR for being a nitpicking toxic piece of shit who slows down the team by creating git conflicts
Anonymous No.106372127 >>106372156
>>106372103
>boss fires you
>now you're making consultant rates
Way ahead of you bro. >>106372054
Anonymous No.106372156 >>106372210
>>106372054
>>106372127
>you fix the issue
>it gets traced back to you
>get sued.pdf
Anonymous No.106372180
>>106372005
ascended post
Anonymous No.106372210
>>106372156
>it gets traced back to you
Skill issue.
Anonymous No.106372335
What is proper git behaviour? I only commit when I got a new feature in my toy programs or I fix a bug.
Anonymous No.106372389 >>106372783
>>106371889
I write commit messages to know what I actually did makes sense. Like I type "now the code does x because y" and then I go "on a second thought why y?" and end up fixing y too.
It's only a secondary benefit that when I git blame some broken 200 line function I see what the last guy was thinking/if he was thinking when he fucked up.

But if you're editing docs or very simple glue code then "edit x" is fine. Commit messages aren't useful everywhere, I have many repos where the only messages are "Update".
Anonymous No.106372536 >>106372909 >>106373015
>>106361987 (OP)
>interview a guy for an IT position
>he put "git" in his "skills" section
>level: advanced
>oh-hoh, finally, a competent dude?.png
>ask him to straighten a "branch off a branch off master"
>literally 2 rebases
>he does not know what rebase is
>I permit him to look at the man page
>he says he needs chatgpt
And then you lazy lying fucks cry about multi-stage interviews with harsh people. You brought this on yourselves.
Anonymous No.106372783
>>106372389
Yeah, not a bad use. I usually do some bastard version of Conventional Commits without BREAKING CHANGE. But then I squash it because my thought process is unnecessary once the work is all done. Crazy people would rebase to organize things better, but that's kind of the core issue: nobody needs to care about git commit history so use it however you want.
Anonymous No.106372909
>>106372536
>>oh-hoh, finally, a competent dude?.png
this is me when I interview a guy who put "SOLID" on his resume, you ask him which principle is the most important one, and he's guaranteed to fuck it up
Anonymous No.106373015
>>106372536
are you me?
Anonymous No.106373016 >>106373057 >>106373996
>>106370724
>when in a project should you make your initial commit?
When you've got something worth the small amount of effort.
I usually start (assuming I'm not using a template) by sorting out what I want the README, .gitignore, and so on to look like. Then I'll add in the basic structure of build according to what language(s) I'm using in the repo. It doesn't require a lot of thinking to build this shit up.
Then I'll probably pause a while until I've got a list of features prioritized, after the first sprint planning session if the customer wants to work that way this time.
Anonymous No.106373057
>>106373016
don't listen to this idiot, you want to do commits to be able to revert changes in your files while you develop
Anonymous No.106373112
>>106361987 (OP)
>Why do people, including some experienced engineers, write retarded commit messages? What the fuck does "updated files" even mean?
I don't care about the commit message if no one else is working on the repo.
Anonymous No.106373336 >>106375839
>>106362281
> They click on whatever shit interface their IDE presents to them and they'll commit and push.
...And that's a good thing! Not my problem, I get paid to code, not be obtuse and hyperdescriptive about faggot git commits
Anonymous No.106373612
>>106361987 (OP)
>he needs comments
>he can't instantly understand the diffs
unironically a skill issue
Anonymous No.106373866 >>106373996 >>106375839
>>106370724
Just rewrite the history later. Commits are for checkpointing your work, not sharing shit with judgy cunts
Anonymous No.106373885
>>106361987 (OP)
>t. I have never worked a day in my life

>>106362281
cute dunning-kruger-lite
Anonymous No.106373996
>>106373016
thanks for sharing your process
>>106373866
good point
Anonymous No.106374347
>>106361987 (OP)
there's a lingering feeling of whatever you're doing being too obvious or trivial to make people bother reading in detail about.
not saying it's correct, though, just pointing out the motivation behind stuff like valve's TF2 patch notes.
Anonymous No.106375839
>>106373336
>>106373866
Squash merge, put ticket number and functionality
I don't want to LARP as a kernel developer
But it's just in case I need to revert some idiot's code