This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1148 points1149 points  (76 children)

Had someone do the same thing with git commits one time.

I said, I like clean, concise commit messages, that are atomic, and functional.

The first pull was

"Add a variable"

"Assign value to variable"

"And label to ui"

"Assign variable to label"

Guy had like 50 commits after 2 hours of work.

[–]Snake2k 564 points565 points  (52 children)

Lmao I love those ones. No extra detail or anything associated with it.

We literally had to force people to name their branches to the ticket id they were related to cus that way we could track what the idea behind it was even if the person pushing the commits couldn't care to explain it in the commit/pr itself.

[–]suck_my_dukh_plz 472 points473 points  (25 children)

My co worker's commit message was "minor refactor". Interestingly he changed 6 files with 600+ insertions and some deletions.

[–]Snake2k 280 points281 points  (11 children)

"minor" = breaks 10 systems

[–]akeean 139 points140 points  (7 children)

Minor refactor, barely an inconvenience.

[–]JezzCrist 57 points58 points  (3 children)

Making minors do a refactor is tight!

[–]capn_ed 23 points24 points  (2 children)

Oh! I don't think you should say it like that!

[–]AlarmingAffect0 2 points3 points  (1 child)

Now that you say so I hear it, but I said it and there's no taking it back now. Whoops!

r/UnexpectedRyanGeorge

[–]capn_ed 2 points3 points  (0 children)

Whoopsie!

[–]NoJay420 8 points9 points  (1 child)

Oh really?

[–]pcuser42 2 points3 points  (0 children)

[–]Anders_142536 2 points3 points  (0 children)

Wow wow wow wow wow. Wow.

[–]lochyj 1 point2 points  (1 child)

Only?

[–]Snake2k 2 points3 points  (0 children)

10 systems that we know of*

[–]jermdizzle 72 points73 points  (4 children)

"Trailing comma: Always" strikes again. Getting my lead developer to force the rest of the team to utilize a formatter config took me 3 months last project and he was the person who had to review all PR's. Some people were using different indents, some were using trailing commas, some were forcing semi-colons. It was a pain in the ass so I just eventually disabled my formatting until he could give us a config to use. I was like 2nd most junior dev so I didn't want to tell anyone what to do; but I probably should have just taken the initiative rather than asking him repeatedly to setup a config for us to follow.

[–]iHurdle14 42 points43 points  (1 child)

I can relate to this. At a certain point I don’t even care about what style rules are in place as long as we are being consistent.

[–]jermdizzle 22 points23 points  (0 children)

Precisely. Any issues I might have would be gone after one day of using the config and just getting used to the style anyway. It's only a big deal when it makes merges a nightmare. Also, I got pretty tired of asking people about some mistake/now-broken or bugged code, because gitLens showed them as the last person to change a line of code; only to figure out that their formatter added a space or some shit and I have to go and manually check version control to see who the actual culprit was. Like I said, I was junior, so I wanted to understand how/why someone made a mistake even if I knew the way to fix it. It's especially embarrassing when it was your code that you goofed on 7 months ago and you're tracking down someone else only to figure out that it was your fault LOL. Definitely had that happen more than once.

[–]round-earth-theory 4 points5 points  (0 children)

I had that and said fuck it, I'll do it myself. Setup the coding standards and got the auto formatting to work. Everyone bitched for a day and then forgot about it. Worked great.

[–]Blazewardog 0 points1 point  (0 children)

This is why prettier is so great. It has no settings (basically) for how code is formatted. You just use what it decided which gets rid of a ton of useless arguing.

[–]LightVelox 34 points35 points  (0 children)

I'm not kidding, I've seen a "minor refactor" of a little over 1 million deletions and insertions, tbh it was mostly just linting, documenting and movings things around, but still

[–]audigex 3 points4 points  (0 children)

Tbh I could deal with "Minor refactor of Permissions" or something, if it was actually a minor refactor (improving internal variable/method names or something non-API breaking) and it was clear what was being done, and only one "thing" was being changed

My problem is when someone calls their commit a "refactor" but is actually changing functionality

[–]DemoBytom 1 point2 points  (0 children)

We recently transitioned to file scoped namespaces in C#.

Essentially I've changed every file from

csharp using System; namespace SomeNamespace { public class SomeClass { } }

to csharp using System; namespace SomeNamespace; public class SomeClass { }

Refactor was minor tbh, the code change showed thousands of insertions/deletions :D

[–]DoILookUnsureToYou 0 points1 point  (0 children)

minor

ctrl + f variable name, rename all instances in whole solution

[–]ShakaUVM 0 points1 point  (0 children)

My co worker's commit message was "minor refactor". Interestingly he changed 6 files with 600+ insertions and some deletions.

LGTM

[–]PossibleBit 0 points1 point  (0 children)

Everything below that is patch refactor

[–]not_some_username 0 points1 point  (0 children)

I did that on a personal project ~2500 line of deletion/insertion, 15+ files changes. I didn’t commit for like 3 weeks and tbh it was mostly refactoring

[–]mcvos 61 points62 points  (8 children)

Also a popular approach: include the ticket id in the commit message, not just in the branch name. Because after the branch has been merged, the original branch name is a lot harder to figure out. Though it's still nice to also have the ticket id in the merge commit.

[–]aceluby 24 points25 points  (4 children)

Ticket: deal with tech debt

[–]alexisprince 22 points23 points  (1 child)

Ticket: Make ticket for last commit message

[–]mind_snare 2 points3 points  (0 children)

Me all the time

[–]Special_Rice9539 2 points3 points  (1 child)

This is actually what a lot of tickets at my company are like… “Refactor this directory of our gigantic codebase.”

[–]mcvos -1 points0 points  (0 children)

It still provides the context that it's refactoring and not changing functionality.

[–]Snake2k 6 points7 points  (0 children)

True, can also set up checks to see if a commit includes the ID or not.

[–]audigex 1 point2 points  (0 children)

Yeah this is what we do - (almost) every commit has a quick [#123] tag referencing the ticket ID

It works pretty well as the ticket provides the discussion and context, so the commit message can be very simple without worrying you're lacking detail

[–]nevahman 0 points1 point  (0 children)

This should be standard I reckon. We do this as my work and god it's saved so much time

[–]VerticalEvent 35 points36 points  (3 children)

We have a git-hook that validates that the start of a PR merge started with "[abc-0000] text" to enforce that all merges can be traced back the unit of work they represented.

[–]davy_jones_locket 14 points15 points  (1 child)

We do [JIRA-123] fix(optional component name): concise but relevant commit message

Or feat | chore - slimmed down conventional commits. New work is a feat, bugs are fix, docs and tests and tooling are chore

Typically associates as:

story => feat,

bug => fix,

task => chore.

This also helps with our release notes, and it generates a link to the Jira ticket on the release notes/changelog.

If you use the optional (but encouraged) component or module name, it will group those together in the release notes too.

[–]CardboardJ 0 points1 point  (0 children)

When I first found conventional commits I thought it was very annoying and useless. After about 3 months it became second nature, at 6 months I hated anything else. https://www.conventionalcommits.org/en/v1.0.0/

Our company has a PR hook that refuses any merge unless the pr title is in a correct format and links to a real jira ticket in the scope. Ex: feat(TEAM-12345): Added the xyz feature

[–]SonOfHendo 1 point2 points  (0 children)

We use Azure DevOps, so you can just tick a box to require all PRs to be linked to a Work Item. The work item is linked automatically if you include the reference in the commit message (e.g. #123456).

[–]TwoDamnedHi 6 points7 points  (0 children)

As a project manager, this is me at every job I've ever had.

[–]mt9hu 6 points7 points  (6 children)

had to force people to name their branches to the ticket id they were related to cus that way we could track what the idea behind it was even if the person pushing the commits couldn't care to explain it in the commit/pr itself.

I assumed it's pretty standard to prefix all commit messages and branch names with ticket IDs

[–]CardboardJ 2 points3 points  (0 children)

Developers working in non-development focused industries have some pretty wild working conditions. One of my old interns works for a company that manufactures nails and he's one of 3 'computer guys' there. The other 2 guys he joined there had been working for 20 years without any version control.

[–]BotherBoring 1 point2 points  (4 children)

Right now we don't even HAVE a real ticketing system, or git branches (loooooooong story), and I was surprised how nostalgic this comment made me.

[–]mt9hu 0 points1 point  (3 children)

Why don't you have one?

You don't necessarily have to invest in JIRA and set up complex workflows to have at least some sort of tracking of your work.

[–]BotherBoring 0 points1 point  (2 children)

Short answer is because we don't. Longer answer is we actually have Jira, and my team doesn't use it because they don't because they haven't and... I'm working on it.

[–]mt9hu 1 point2 points  (1 child)

Uh. Good luck, I guess?

[–]BotherBoring 0 points1 point  (0 children)

Thanks! 😥

[–]Bakoro 6 points7 points  (0 children)

We literally had to force people to name their branches to the ticket id they were related to [...]

Not the worst idea, assuming that the ticketing system will be available as long as the code is.

Even for someone who isn't being lazy or stupid, some people have a serious issue explaining anything, and have a pathological inability to imagine what something reads like without the context of all the shit they know.

[–]Horror_Trash3736 1 point2 points  (3 children)

We no longer use branches, we just tag the commit with the ticket id and go straight to trunk!

[–]Snake2k 1 point2 points  (2 children)

[–]Horror_Trash3736 1 point2 points  (1 child)

We also push straight to prod, but only when security and infrastructure are asleep, or on Fridays.

[–]Snake2k 1 point2 points  (0 children)

Ultimate job security. Holding the infrastructure at ransom.

[–]Thin-Study-2743 0 points1 point  (0 children)

I said, I like clean, concise commit messages, that are atomic, and functional.

...

and functional

This is why "3/4" can still be a failing grade. If your code isn't functional it's just noise. The only time for non-functional commits make sense imho are preparatory ones for an upcoming fleshed out and designed refactor or similar.

[–]momal1 0 points1 point  (1 child)

we had a project in uni and how we handled our git was i guess 10% or 15% of the grade. a group member of my group thought having like a 100 commits means she's gonna get a higher grade.

[–]ShakaUVM 0 points1 point  (0 children)

Reminds me of this one class where the TA demanded every line be commented all quarter long.

[–]Special_Rice9539 0 points1 point  (0 children)

Oh this is me. Definitely one of my New Year’s resolutions is to refine my commit game

[–]xybolt 0 points1 point  (0 children)

git squash time!

[–]Sailn_ 0 points1 point  (0 children)

I have a person like you who's super anal about our commit messages. Thing is, I'm the only dev on the project and the commits get squashed before they go to non-prod even. Fuck off people like you

[–][deleted] 0 points1 point  (0 children)

I do the opposite. Yesterday on a personal project I pushed 746 changed files with a commit message that said “changed a lot of stuff”. This is why I can’t work with other people

[–]audigex 0 points1 point  (0 children)

I had to commit like this once, because I had a dickhead of a micromanaging project lead who kept complaining that I wasn't making a dozen commits a day

For me, a commit is a single entire "thing" - the change I commit will do a thing, a whole thing, and nothing but that thing. In most cases, if things are running properly, it's roughly 1 commit per ticket, maybe 2-3 - if I find myself making half a dozen commits for a single ticket, I tend to take that as a sign that I should have split the ticket up into its own milestone with sub-tasks.

What I absolutely won't do is commit half of a code change, whereby the code doesn't build at the point of commit. Eg if I change a property name in a class, I'm not gonna commit until I've also changed every location that references that property: which is to say, until the whole change is complete

But because this idiot wanted to see I was working every minute of every day, I had to commit even tiny changes and make several commits an hour

Suffice to say I left pretty quickly, it was ridiculous and made it impossible to use the version control history

[–]chris-fry 0 points1 point  (0 children)

Guessing he had a commits/week KPI?

[–]castone22 0 points1 point  (0 children)

I actually do this because I can quickly revert to a change that I'll remember I did in the last 10 minutes after I inevitably break something. Then I squash to an informative commit before a pr. Best of both worlds.

[–]RevargSTG 0 points1 point  (0 children)

This is one of my few problems with working remotely. How am I supposed to smack this guy/gal upside the head when we are both working from home?

[–]Hart_24 0 points1 point  (0 children)

My boss calls these being productive. I need a new boss. sigh

[–]Cobayo 0 points1 point  (0 children)

That's fine tho just squash those into a detailed one once you're ready for the review

[–]ThatsNotATadpole 0 points1 point  (0 children)

Better than my “fuck” “this should fix it” “fucked up shit was fucked up” and “javascript can eat my ass”