32 points · by aravindkumarv · 1y ago · 45 comments
Buttons for pulling and creating branches would be good though.
And break glass to `git reset --hard` would provide some nice ceremony.
I had a serious conversation with him, explaining that I'm not in the habit of telling him how to configure his shell, edit or general work environment. But an alias for `git push -f`, that I cannot condone. When you're doing that, the two seconds it takes to type it out should be rather low on the list of priorities.
So we had a good talk, and he genuinely understood the point I was trying to make. When I was about to leave, he looked at me sheepishly and asked:
"So I guess you want me to remove this one too?"
gacpf - git add . && git commit --amend && git push --force
If you want to do a push -f to a branch that only you are working on to finish a rebase -i to make the commits you did in haste make sense, then go for it. But nobody should be forcing to master unless it's to undo a really big fuckup.
One was merging a PR with giant files accidentally attached, the other was re-exporting from perforce because they totally fucked 'git blame' and I wasn't having any of that.
People altering the line ending of several files so that you cannot do any normal actions anymore.
You might be surprised at this if you use Git in append only mode, making "fix 1", "fix 2", ... commits on a branch when you find a problem in a previous commit
Another workflow is to keep each commit self-contained, rebase the series when you make changes, and send the v2, v3, ... of your pull request with push --force
Of course, if you do this on a shared branch that other people also want to commit on, you may want to pick a desk close to the exit, and far away from any windows
Or I should say, I see the trap in the two or three most obvious variants which makes them even less effective because you create a Confused Deputy situation with the person you expect to sign off.
Example: If I file a PR to change a production flag, and I tell you what (I think) I just did, you're likely to approve my change because I've primed you to see what I wanted you to see, and you miss the same bug I missed. You're going to trust my judgement when the whole point of not allowing me to just push without a second pair of eyes is that you cannot trust my judgement 100.00% of the time. If I'm 99.9% trustworthy you're likely to stop looking at my ideas expecting to see a problem.
I believe if we don't send each other code we are more likely to get that 4th 9. But I could still be wrong thanks to the Primacy Effect mentioned above.
Gitlab premium can also require multiple approvals before a merge request can be merged.
See also: Samir you're breaking the car!
(For today's 10000, that's a bloopers real of a professional racer that was done as a prank by a rival and which ended up causing him some problems)
And I want something to pull when I git-pull.
function cd { builtin cd "$@" && [ -d .git ] && git pull || true; exa -all --group-directories-first; }
alias acp='git add -u &&-c "git log --color --pretty=format:\"%s\" --abbrev-commit -- |>/tmp/git_log_sk && git commit --gpg-sign --edit -F /tmp/git_log_sk && rm /tmp/git_log_sk" && git push -u
origin HEAD'
The cd automatically pulls if it's a git repo.
The acp is shorthand for "add+commit+push" with sk as a fuzzy finder for a commit message editing (vim integrations).I know for me, I could not use "acp" as the alias because it would conflict with the oh-my-zsh aws plugin to load profile credentials.
How could this work without needing software? Does it literally just type out the command when you press the button?
Edit: a big red button that is disabled on Fridays. To enforce relaxed weekends
/s?
If it's supposed to do commit + push in one press, then I wonder how it handles commit messages?
It's just a keyboard button. It can do the same harm any developer can already do.
better, dead man's switch tied to your heart, $rm -rf your computer
Extensive amount of G-keys :)
here is the pop-up version https://www.trustedreviews.com/reviews/logitech-g15-gaming-k...
and here is the fixed display version https://www.amitbhawani.com/blog/logitech-g15-gaming-keyboar...
Am not connected to either of these sites.
https://github.com/svilendobrev/svd_bin/blob/master/vcs/vcs....
covering ~10 most-used operations , for 5 diff. vcs - git, bzr, mercurial, svn, ... - guessing which one according to .git/.bzr/.. etc
$ v u ... does update
$ v s ... does status
$ v i -m fixx ... does commit AND push
$ v a ... does adding
$ v d ... does diff
.. etc
some have subvariants.. depends on vcs