[HN Gopher] Show HN: Gitgpt - Natural Language Git
       ___________________________________________________________________
        
       Show HN: Gitgpt - Natural Language Git
        
       Hey folks,  Here's a quick and dirty tool to use natural language
       to get git to do what you want.  Example: $gitgpt create a new
       branch called feature/test add all the files and commit with msg
       creating feature test then push to origin  I haven't put it through
       the wringer yet, however it's worked well with some pretty straight
       forward day to day git usage.
        
       Author : OddMerlin
       Score  : 65 points
       Date   : 2023-02-27 17:50 UTC (5 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | jastanton wrote:
       | I've been looking for something similar for AI git commit
       | messages... basically feed ChatGPT a git diff and ask it what
       | changed and to write a git message. I've done this directly in
       | the ChatGPT UI with some small changes and it produces some great
       | messages...
       | 
       | I would be very concerned to run this on company code or large
       | diffs. But small simple commits, which should be the goal with
       | commit messages anyways, would take away some of the tedium of
       | the git flow.
        
         | tuukkah wrote:
         | CommitGPT was in a Show HN but didn't gather much attention
         | back then: https://github.com/RomanHotsiy/commitgpt
        
       | ilaksh wrote:
       | This is cool but I tried sending the same text with my general
       | purpose GPT (text-davinci-003) command line tool and it did the
       | same thing. This one is mine: https://github.com/runvc/askleo
       | 
       | There are other ones of course.
        
         | KMnO4 wrote:
         | I'm just curious, why does everyone use DaVinci for these sorta
         | applications? Even the 2nd best model (Curie) is 10x cheaper
         | and I'm sure would perform nearly as well.
        
           | EForEndeavour wrote:
           | I imagine it's a mix of:
           | 
           | 1. text-davinci-003 is subjectively (well, and objectively)
           | better than other models
           | 
           | 2. for small-ish usage volume, Davinci and Curie are both
           | pretty cheap in absolute terms that a 10x factor doesn't
           | matter
           | 
           | 3. GPT3 hype
        
         | mellosouls wrote:
         | 404, check your url
        
           | KMnO4 wrote:
           | Looks like a typo; this should work:
           | 
           | https://github.com/runvnc/askleo
        
         | [deleted]
        
       | tuukkah wrote:
       | The prompt is to the point:                 prompt = "Provide
       | only the appropriate git commands for:" + prompt
       | 
       | https://github.com/Hesse/gitgpt/blob/9c78e40d5ebdefdf0a4a829...
        
       | dudus wrote:
       | I think this is a cool idea but why stop at git? Why not expand
       | to any CLI program. Maybe someone already did that.
        
       | SparkyMcUnicorn wrote:
       | Nice! I don't intend to discount the work you've done here, but
       | want to point out that GitHub Copilot has a CLI tool for exactly
       | this as well as other arbitrary shell commands. It's pretty
       | polished and has performed well for me so far.
       | 
       | It is on a waitlist, but I got accepted after a couple weeks.
       | 
       | https://githubnext.com/projects/copilot-cli/
        
       | notShabu wrote:
       | It's pretty useful as a lookup, but these tools are similar to a
       | knife that auto-magically orients itself to help with cutting.
       | 
       | Some tools should be as dumb as possible so that act as
       | extensions of the user with zero tolerance.
       | 
       | Play and buffer between intent and action creates a long tail of
       | potentially disastrous unknown edge cases and also interferes
       | with the feedback loop that prevents mastery.
       | 
       | Memorizing git commands to get it just-so is usually a chore so
       | this is pretty helpful. Still wouldn't trust it w/o double
       | checking the output cmd though.
        
         | netr0ute wrote:
         | > Play and buffer between intent and action creates a long tail
         | of potentially disastrous unknown edge cases and also
         | interferes with the feedback loop that prevents mastery.
         | 
         | I don't know if this means anything here, because that feedback
         | loop is basically the MO of all these tools.
        
       | phneutral26 wrote:
       | I think this would be a wonderful tool for git learners if you
       | would explain the git commands a bit. For example: git add *.py ;
       | This command adds all the python files to the staging list.
       | 
       | You get the gist.
        
         | danthelion wrote:
         | git-genie does this with the --explain flag!
         | https://github.com/danthelion/git-genie
         | 
         | Also GPT-based
        
       | gdcbe wrote:
       | Not sure what value it adds though. Isn't it easier to type the
       | cmds then to write all that?
       | 
       | If there's a good product in it I'm afraid your examples aren't
       | selling it :S
       | 
       | Was first thinking it could have value for when you forget a cmd
       | or when learning, but I think if you can come up with those
       | technical instructions you can also remember the cmds ...
        
         | danwee wrote:
         | 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)
        
           | donio wrote:
           | Or it might answer with "git reset --hard" depending on the
           | phrasing of the natural language version and the phase of the
           | moon.
        
           | klabb3 wrote:
           | > 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!
        
         | ldehaan wrote:
         | [dead]
        
         | ilyt wrote:
         | People are bad at Git, people don't want to read the Git book
         | to understand Git, so for long time many people's workflow was
         | "type quesion on how to do something in git into google and
         | copy-paste first answer" (which generally worked).
         | 
         | So for developer using it 8h a day, yeah, funny toy, but might
         | actually be useful for every other git usage when users don't
         | want to understand graph theory just to commit some changes.
        
           | UltimateEdge wrote:
           | > People are bad at Git, people don't want to read the Git
           | book to understand Git, so for long time many people's
           | workflow was "type quesion on how to do something in git into
           | google and copy-paste first answer" (which generally worked).
           | 
           | Should we really trust Google's search AI, which is also
           | always under attack by SEO spam, to give reliable results?
           | 
           | I have about as much trust in Google's result page as in
           | ChatGPT responses. I don't trust Google to give me exactly
           | what I'm really looking for, so I force myself to look for a
           | number of sources which corroborate a claim.
           | 
           | I am increasingly considering self-hosting a YaCy instance
           | configured with a curated whitelist of allowed domains (in
           | this case, I might add the GitHub docs and/or the Atlassian
           | git docs pages to be certain that I'm reading valid and up-
           | to-date instructions when searching for git-related topics).
        
         | mellosouls wrote:
         | _Not sure what value it adds though. Isn't it easier to type
         | the cmds then to write all that?_
         | 
         | It's pretty obvious it's intended use cases include memory
         | prompts for experienced users and translations from English
         | requirements for inexperienced users.
         | 
         | It's even in the OP:
         | 
         |  _use natural language to get git to do what you want._
        
           | cowsup wrote:
           | But when the prompt is:
           | 
           | > add .gitignore commit with msg adding ignore and push
           | 
           | That's not very compelling. The main selling point of AI is
           | using simple inputs to achieve advanced outputs that match
           | what the user wanted.
           | 
           | If I can say "Commit my .gitignore file," and then it runs
           | 
           |  _git add .gitignore_
           | 
           |  _git commit -m "Adding .gitignore"_
           | 
           |  _git push [y /N] y_
           | 
           | Then that's one thing.
           | 
           | But this looks like you still have to specify the exact
           | message you want, and be pretty deliberate about what it is
           | you're after. At that point, why not just learn, and write,
           | the commands yourself?
        
             | mellosouls wrote:
             | I agree the examples could be improved, I assumed they were
             | rushed due to the "quick and dirty" note; I recommend the
             | OP address that by writing clearer, simpler examples, eg
             | they could look at popular questions (that don't express
             | requirements using git commands) on StackOverflow for
             | inspiration.
        
             | OddMerlin wrote:
             | OP here. I love this feedback. I agree this is definitely
             | something I should work towards.
             | 
             | Keeping the commands as succinct as possible as well as
             | "natural language" as possible. Even the word commit might
             | be too git-y?
             | 
             | Thanks for the feedback.
        
             | veleek wrote:
             | What happens when you try to run the command you mentioned?
        
         | lolinder wrote:
         | The thing I'm most excited for for technology like this is
         | making voice control more feasible for more things. If you
         | plugged a speech to text engine in front of this it could be
         | quite useful.
        
           | gdcbe wrote:
           | True. Very true, nice use case indeed! Thanks for pointing
           | that out!
        
         | kurthr wrote:
         | Seems like a way to make your CMS even more terrifying.
         | 
         | Like, oops not add I meant push, wait remove that! or was it
         | rebase? I'll just reflog to get back to umm... wait what?
         | 
         | I guess the saving grace is that it'll do the most common
         | things people usually want to do, but for some things english
         | language just not specific enough (like law).
        
         | onion2k wrote:
         | _Isn't it easier to type the cmds then to write all that?_
         | 
         | Obviously it is _if you know them_.
        
           | PaulDavisThe1st wrote:
           | "gitgpt make me a sandwich" isn't going anywhere fast.
           | 
           | Understanding what you can tell gitgpt to do is extremely
           | adjacent to knowing actual git commands.
        
             | ipaddr wrote:
             | I would expect: repo sandwich created
        
             | 6510 wrote:
             | But if it could act like the helpdesk it would help a lot.
        
       | [deleted]
        
       | tempodox wrote:
       | I feel like we have reached the "solution in search of a problem"
       | stage.
        
       | hn_throwaway_99 wrote:
       | This is very cool. I feel like this should be an eventual good
       | replacement for essentially all man/help pages.
        
       | antibasilisk wrote:
       | let's not give language models unrestricted access to our shells
       | please. This is like allowing remote code execution from an
       | insane person.
        
       | eurasiantiger wrote:
       | Can it fix merge conflicts?
        
       | AlexAltea wrote:
       | That looks cool, though I'd be very concerned about the
       | possibility about ChatGPT "hallucinating" a `rm -rf /` or
       | equivalent.
        
         | williamcotton wrote:
         | When LLMs "hallucinate" they don't do so in random ways like
         | somehow deciding to "rm -rf /". They do so in predictable ways.
        
           | bqmjjx0kac wrote:
           | Extraordinary claims require extraordinary evidence. Given
           | that GPT3 has 175 billion nodes, how would you even begin to
           | support the claim that it never (or sufficiently rarely) does
           | things that are surprising to humans?
        
             | williamcotton wrote:
             | If you're looking for academic research, this is a great
             | place to start:
             | 
             | https://arxiv.org/abs/2202.03629
             | 
             | But you can get a general feel by using ChatGPT. Open up a
             | new conversation and ask it something like, "What is the
             | capital of France?". Note the response. Open up a new
             | conversation and note the response. Soon enough you should
             | be able to see that the responses are far from random.
             | 
             | You can use the OpenAI APIs directly and have it run 10,000
             | or so iterations to see what kind of "hallucinations" it
             | makes! They are not random!
        
               | bqmjjx0kac wrote:
               | Thanks for the link! I don't think that really addresses
               | my concern, though.
               | 
               | My point is that these LLMs are basically incredibly
               | large programs that defy analysis with our current tools.
               | Sure, I can poke it a few times and see that it usually
               | does what I want, but that's not the same as saying it
               | never goes off the rails.
               | 
               | If it does something crazy like post my bank login
               | online, even only once in a billion times, that's still
               | orders of magnitude higher than I'm willing to accept.
        
               | williamcotton wrote:
               | You're basically asking me to prove to you that I can't
               | fly.
               | 
               | I will say it like this: it is highly improbable that I
               | can fly. I cannot come up with a way to prove it to you.
               | There is some sort of epistemic miscalculation going on
               | if you operate under the assumption that I might be able
               | to fly.
        
               | Oxidation wrote:
               | Ask it details about a little-documented event and it'll
               | happily tell you plausible, but utterly false, lies,
               | however.
               | 
               | Apparently the "early 2011 Bougainville earthquake" was
               | magnitude 6.3, at a depth of 21.7km, on the 20th January
               | and caused "widespread damage to buildings and
               | infrastructure in the region, and triggered landslides
               | that blocked roads and hampered rescue efforts".
               | 
               | It was _actually_ on the 7th Feb, a 6.4 and at a depth of
               | 415km. There were  "no immediate reports of damage or
               | injuries".
               | 
               | None of this is remotely surprising, considering it's a
               | turbocharged statistical model and it probably ingested a
               | few words about it at most, out of billions and billions,
               | but somewhere along the line from "famous" to "footnote"
               | subjects, it will segue into complete fiction.
        
               | williamcotton wrote:
               | Sure, but that is a predictable kind of result, not "rm
               | -rf /".
        
               | Oxidation wrote:
               | Some flavour of "git gc" after your reset is far more
               | likely to crop up and ruin your day, that's true.
               | 
               | As long as you stay on the statistical beaten path (i.e.
               | you're asking about Paris), you will probably be fine,
               | indeed. Probably. Stochastic bugs are always the most fun
               | anyway.
        
               | williamcotton wrote:
               | You definitely go about making "stochastic bugs" more
               | reliable in a manner different from debugging software.
               | 
               | It's more akin to industrial engineering. There is no
               | such thing as a perfectly machined widget. So we come up
               | with an acceptable range of tolerances and compute a
               | process capability. Six sigma. 3.4 defects per million
               | and then buy an insurance policy.
        
           | AlexAltea wrote:
           | Sure, perhaps my example was too extreme. What about:
           | $ gitgpt commit files with msg cleaning repo files and push
           | git commit -m msg       git clean -fdx       git push
           | 
           | Without `git-add`, 1st one is a NO-OP, 2nd is a destructive
           | action, 3rd is a NO-OP. All vaguely related to the topic at
           | hand, "hallucinating" such a destructive action seems at
           | least plausible.
        
             | williamcotton wrote:
             | Yup, that is something more realistic.
             | 
             | The GitHub Copilot CLI tool that is in beta, along with
             | other tools, will show you the command and then make you
             | manually choose to run, redo or abort.
             | 
             | In practice I have yet to accidentally perform any
             | destructive operations. This makes intuitive sense because
             | those seem like unlikely completions for a model that has
             | been fine-tuned on "helpful cli recommendations"!
        
         | saghm wrote:
         | Given that it is doing actual operations under the hood, it
         | would be interesting to have it just output the "native"
         | command for the operation rather than executing it. People
         | could write wrappers around that output to execute it after
         | prompting the user for confirmation or something like that so
         | that users would have the choice to "opt into" the level of
         | automatic execution they're comfortable with.
        
           | danthelion wrote:
           | This way my approach when I created a similar tool, called
           | git-genie[0]. It's more of an educational tool first,
           | explains the generared git command in detail.
           | 
           | [0] https://github.com/danthelion/git-genie
        
         | williamcotton wrote:
         | [flagged]
        
           | agolio wrote:
           | Perhaps explain to the person you are responding to why you
           | disagree with them instead of making passive-aggressive jabs
           | at their intellect
        
             | williamcotton wrote:
             | _I_ don't disagree with them. _Reality_ disagrees with
             | them.
             | 
             | When LLMs "hallucinate" they don't do so in random ways
             | like somehow deciding to "rm -rf /". They do so in
             | predictable ways.
             | 
             | What, am I supposed to handhold every person in these
             | forums until they stop reading garbage on the internet and
             | start either doing their own empirical research or at least
             | read other empirical research?
             | 
             | Edit: Apparently the answer is yes, I am supposed to
             | handhold every person in these forums... and I will
             | tirelessly do so, even in the face of provocatively
             | incorrect yet populist statements like OPs... I still
             | imagine I lose my patience every 100 or so instances, as
             | seems about the average these days...
        
               | lolinder wrote:
               | The first two guidelines for this forum are these:
               | 
               | > Be kind. Don't be snarky. Converse curiously; don't
               | cross-examine. Edit out swipes.
               | 
               | > Please don't fulminate. Please don't sneer, including
               | at the rest of the community.
               | 
               | https://news.ycombinator.com/newsguidelines.html
               | 
               | If you get tired of respectfully explaining why people
               | are wrong, then you can always stop commenting and go get
               | some fresh air. What you should not do is lash out
               | aggressively with zero explanation for why you feel so
               | strongly about this.
        
               | williamcotton wrote:
               | Thanks, dad.
               | 
               | Funny enough, I reviewed your comment history and you
               | seem to be of the same opinion as the person I was
               | responding to...
               | 
               | ...could that have perhaps motivated your patronizing
               | tone?
        
               | lolinder wrote:
               | I didn't intend to patronize, just remind you to chill
               | out. I need the same reminders from time to time.
               | 
               | I note that the conversation that started from your re-
               | submitted (and much improved) comment was quite
               | productive and insightful on all sides, which is exactly
               | what the site guidelines are designed to enable.
        
               | williamcotton wrote:
               | Yet it somehow attracted downvotes anyways...
               | 
               | What you're missing from your perspective is that the
               | original comment was aggressively wrong.
        
         | brokencode wrote:
         | Just run all the git commands by another GPT bot that
         | determines whether it would be harmful first. GPT bots all the
         | way down.
        
           | ipaddr wrote:
           | Can someone make a bot to verify the gpt bots are up and
           | another to verify the first verifier is up
        
       | whoomp12342 wrote:
       | thanks, I hate it.
        
       | yodon wrote:
       | I've been waiting for someone to build this. My hope is it will
       | simplify recovering from the myriad forms of "I just did
       | something I didn't want" that occasionally happen with git (and
       | that I've historically used [0] to resolve)
       | 
       | [0]https://sethrobertson.github.io/GitFixUm/fixup.html
        
       | basicallydan wrote:
       | > Interfacing with git sucks
       | 
       | I disagree
        
       ___________________________________________________________________
       (page generated 2023-02-27 23:01 UTC)