News for hackers. Stuff that matters.
Re:Minimum Viable Git for Trunk-Based Development by dboreham on Wednesday November 30, 2022 @12:18PM (#33803956)
> git add -A .

> Add everything I’m working on (new and edited files).

Bad idea. Extraneous cruft that isn't caught by .gitignore will leak into the repo. Always run git diff and git status first to see what you are about to add.

Re:Minimum Viable Git for Trunk-Based Development by elischleifer on Wednesday November 30, 2022 @12:23PM (#33804057)
I hear you. But nothing goes directly into main. The working branch is not sacrosanct you know what I mean? I'd rather clean up anything that leaks in before merging and a good .gitignore can protect against most noise.
Re:Minimum Viable Git for Trunk-Based Development by TrickyRick on Wednesday November 30, 2022 @12:37PM (#33804316)
Sure but it goes in the repo. Forgot to add .env to the .gitignore? You probably just committed a secret. Sure you can force push to get rid of it but if you're using Github it's still saved so it needs to be rotated now.
Re:Minimum Viable Git for Trunk-Based Development by alkonaut on Wednesday November 30, 2022 @02:12PM (#33805989)
What’s “the repo” here? What I commit goes into my copy of the repo. Only what I push goes into any repo anyone else sees. Before pushing I always go through what’s in the branch and clean up/rebase etc. Sure it’s easier to accidentally push a file you shouldn’t have if you have added it locally but committing alone doesn’t necessarily mean you need to rotate a secret.
Re:Minimum Viable Git for Trunk-Based Development by LocalPCGuy on Wednesday November 30, 2022 @04:41PM (#33808174)
That is a case where (as you note) you'd need to do some sort of destructive fix to eliminate the file from your local repo. Whether it's a rebase or something else, a person then needs to know "the advanced parts" that the blog post is advocating aren't really needed if "git is done correctly". Better to just not commit files/hunks accidentally in the first place - I know, it's not a perfect world, yada yada - just trying to provide the counter point to the counter point.
Re:Minimum Viable Git for Trunk-Based Development by alkonaut on Wednesday November 30, 2022 @04:57PM (#33808401)
Yeah I’d say interactive rebase and soft resets is part of my “limited toolbox” for git that I wouldn’t go without. (I don’t stage hunks, don’t merge in either direction etc, so I leave some other parts of the larger toolbox alone).
Re:Minimum Viable Git for Trunk-Based Development by simplotek on Wednesday November 30, 2022 @02:57PM (#33806696)
> But nothing goes directly into main.

That's not a reasonable argument. The problem is pushing confidential info into a repository. It matters nothing what the branch you push it is called.

Re:Minimum Viable Git for Trunk-Based Development by elischleifer on Wednesday November 30, 2022 @04:49PM (#33808290)
FWIW - we run secret detection in our trunk check precommit action - so we make sure that secrets are never committed into local or remote branches.
Re:Minimum Viable Git for Trunk-Based Development by simplotek on Thursday December 01, 2022 @05:39AM (#33814585)
> FWIW - we run secret detection in our trunk check precommit action - so we make sure that secrets are never committed into local or remote branches.

Irrelevant. You're describing a failsafe. It's like claiming that you don't need to care about speed limits because a road has guardrails. The whole process is broken if it fails to address the main reason confidential info can be pushed into repositories.

Re:Minimum Viable Git for Trunk-Based Development by denimnerd42 on Wednesday November 30, 2022 @12:37PM (#33804314)
nah, I always git add --all && git commit -m "issu-12 my short message"

if something leaks and I need to add to gitignore I'll amend.

there's definitely cases for staging more complicated edits but not in my daily work.

Re:Minimum Viable Git for Trunk-Based Development by Forge36 on Wednesday November 30, 2022 @12:37PM (#33804321)
combined with the authors disdain of commit messages or documentation I can't figure out where they've chosen to document why changes are made.
Re:Minimum Viable Git for Trunk-Based Development by nimbus3001 on Wednesday November 30, 2022 @01:02PM (#33804767)
commit messages != documentation