Hacker News new | past | comments | ask | show | jobs | submit login
Micro keypad to do your regular Git push/pull/add/commit actions (gitsyncpad.xyz)
32 points by aravindkumarv 52 days ago | hide | past | favorite | 45 comments



Fun idea, but adding and committing is the time when I want to be going slow and paying the most attention! What files did I change, were all the changes on purpose, have I described all of the changes.

Buttons for pulling and creating branches would be good though.

And break glass to `git reset --hard` would provide some nice ceremony.


When mentoring a junior, I noticed he had an alias `gpf`, which he apparently picked up from another developer.

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


On my last project I was the only person who had --force permissions on bitbucket. In six years I used it twice on purpose, and once on accident (and then once again to undo the mistake).

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.


> undo a really big fuckup

People altering the line ending of several files so that you cannot do any normal actions anymore.


Oh, I have practically the same alias.

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


Have you considered fixup commits? On shared branches they work very well. Either autosquash before pushing, or as part of your final PR prep


On shared branches I prefer to send pull requests, that way I can rework my draft and respond to review comments until it's ready, without pushing undercooked commits directly on the shared area

What lands on the shared branch has a meaningful history, that has helped me more than once to understand the context in which an old change was made, when running git blame many months later.

I feel like it should be as easy to review the history as it is to review a PR. Squashing makes this a bit harder for me. Especially when autosquash loses long commit messages.

But I like to use git-absorb to automatically create fixup commits, it generally works pretty well and saves me a little bit of tedium each time!


Timd to show jujutsu to the intern


And a `git push -f` on physically separated key switches that require two people to operate.


Do you know of any software systems that do 'double key lockout' like this? I've wanted one for a long time but I am having a failure of imagination on how to implement it.

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.


Systems that use shamirs secret sharing, like openbao, require multiple operators to unlock the secret engine.

Gitlab premium can also require multiple approvals before a merge request can be merged.


Yeah I’ve used HSMs that have those. But I’m talking about things like running deployments, changing production configurations, or rebooting servers.

Approvals don’t work, and I’ve already said as much. If approvals worked so well we wouldn’t have dual key systems at all.


Me at the end of a contentious code review: "TURN YOUR KEY SENIOR!"

https://youtu.be/rLMCjuge6oE


The only way to win is not to play.

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)


I want something to push when I git-push.

And I want something to pull when I git-pull.


So a "Git Bop It"?


My first thought: Get a Playdate and use the crank!


I'm using this in my .zshrc:

  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).


Could that perhaps work better in .gitconfig than a shell function?

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.


India only for now.

How could this work without needing software? Does it literally just type out the command when you press the button?


Probably indeed an usb keyboard device. Great idea! I would like a big red button for deploys :)

Edit: a big red button that is disabled on Fridays. To enforce relaxed weekends


[Sorry for ruining the fun in an industrial setup, the big red button is the emergency stop. If someone is in danger, you just push the big red button to stop the machine.]


Like a rubberducky but with a button?

( https://shop.hak5.org/products/usb-rubber-ducky )


Basically. Just non malicious. It's a macro pad with an unusually long macro.


Relax, it doesn’t need to actually do that because it installs malware and steals all your keys

/s?


Why would I get this over something like a Stream Deck?


Cost would be my guess. This costs less than US$20, whereas stream decks usually cost quite a bit more than that.


A Stream Deck is a bit overkill I think, but macro keypads are cheap enough that I'm also not sure why I'd opt for this product over one of those.


Thanks for the mention - I've always thought Stream Decks were kind of interesting, but overkill. It turns out a macro keyboard is what I really wanted.


I'm assuming it's a simple MCU that registers as a USB keyboard and types out the commands followed by Enter.

If it's supposed to do commit + push in one press, then I wonder how it handles commit messages?


`git commit -m "fixes and improvements"`


cat /dev/urandom |


Open an editor?


Is this an actual problem to be solved? I would not want our repo "attached" to devices capable of one click operations.


Any keyboard with macro functionality is capable of one click operations. Any IDE is capable of one click operations. Any shell with history is capable of two-click operations.

It's just a keyboard button. It can do the same harm any developer can already do.


Alexa: commit this code for me

better, dead man's switch tied to your heart, $rm -rf your computer


In the early 90s, Gateway had a keyboard called "Anykey" that let you program macros into the keyboard firmware. We programmed several DOS commands into ours. It had two full sets F1-F12 of function keys, both along the side like an old Model F, and along the top. So the F-keys on the side we used for DOS macros.


The Logitech G15 keyboard which has about 2 major versions, is capable of some nifty keystroke / macro functionality too. I have one of them somewhere.

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.


Not the first person to have this mid idea. Just get a VIA compatible numpad or one of the many boards for OSU.


I already have tons of aliases for git, One of my fav's when I developed on a Mac was to also take a photo every time I pushed. I forgot about it for about a year, going into that archive was hilarious.


i have this:

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


They should make a YOLO button that does a “git add . && git commit -m yolo && git branch -f master && git push origin master —-force”


HN, what are your favorite QMK / ZMK etc. compatible macropads ?


april 1st already?


Wake me up when it’s a pedal under your desk




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: