Hacker News new | ask | show | jobs
by danwee 1205 days ago
A colleague of mine didn't know that it was possible to revert a commit without commiting (so, leaving the reverted changes in the staging area). In such ocassions you either a) search in google, b) read the manual, c) ask a colleague

But with a command line tool like Gitgpt I guess one could just do:

> gitpgt "revert commit without commiting"

and the command line tool would answer "git revert --no-commit COMMIT_ID_HERE". I think that's quite handy and way faster then options a), b) and c)

2 comments

> A colleague of mine didn't know that it was possible to revert a commit without commiting […]

> But with a command line tool like Gitgpt I guess one could just do:

>> gitpgt "revert commit without commiting"

This is a classic post-hoc curse of knowledge fallacy. I don’t blame you, this is something that people with really analytically strong minds struggle with, such as the fine folks who made voice assistants for Google, Apple and Amazon.

Asking someone who is trying to be overly helpful to do something you don’t know if they can do is at best meaningless (if it can’t do any harm) and at worst a really bad idea (if it can eg screw up your git repo). In your friend’s mind, it’s very possible that git can’t do this, and then who knows what the GPT will try to do instead to please you? This is the main crux of the problem.

Even if they think it’s possible but they don’t know the command, they don’t know if “revert without committing” is a meaningful sentence, perhaps git has another abstraction model and uses different terms. This is the spirit behind the expression “asking the right question takes as much skill as giving the right answers”.

GPT can certainly help explaining, summarizing etc, but it has a very limited ability to say no, and more generally pointing out when your mental model is wrong. I’ve had long complex “design reviews” with ChatGPT – it’s really good at going along with your assumptions, but it lacks the “spine” to tell you when your logic isn’t coherent, or that you have mutually exclusive goals, or that you’ve strayed “too far”, whatever that means.

Someone should write a long blog post about this paradox of helpfulness, I assure you it’s a real thing!

Or it might answer with "git reset --hard" depending on the phrasing of the natural language version and the phase of the moon.