4 ms·
text-mode interface for Git Based on the comments here saying they love Tig, I know I'm missing something, but: doesn't Git provide a text interface (the `git`
by tnorthcutt 6y ago
text-mode interface for Git
Based on the comments here saying they love Tig, I know I'm missing something, but: doesn't Git provide a text interface (the `git` command) to Git?
I'm not trying to be obtuse; I genuinely don't know what Tig provides that Git doesn't already do, but would love to know!
- tgvaughan 6y agoIt provides a curses-based TUI, while generally git just provides a CLI.
- bkane521 6y agoTig provides a GUI that is text-based, i.e. runs right in your terminal. It's essentially a shell friendly version of sourcetree/tortoisegit etc. A great tool on its own, but particularly useful for headless servers/remote machines.
- tnorthcutt 6y agoInteresting, thank you!
- masklinn 6y agotig is a curses program, it's an interactive terminal GUI (a TUI), as opposed to a CLI e.g. you can browse and interact with your log rather than dump it in a pager and need a separate terminal to dive into a commit or whatever. magit is a good alternative, it's not exactly a TUI because it works entirely inside emacs and uses emacs concepts, but it's entirely text-based.
- tnorthcutt 6y agoInteresting, thank you! I think I need go learn more about what "curses" means
- acoard 6y ago"Curses" is a library for writing, well, TUIs[0]. I get that's a bit circular, so let me explain. With a normal CLI program, you essentially just output to STDOUT line by line. You type `git status`, and the git program basically does `print(status)`. Then you're back to your terminal and you type another command, git or otherwise. A "curses" program renders fundamentally different. It's much more like how video games render. Every time it renders, it'll draw to the entire screen. You're not in an empty command line where you can type any command, rather you are "in" the application. Take a look at this screenshot [1]. You can imagine how pressing up/down keys might move which input is selected. If you want to get back to the normal terminal you have to quit the TUI application. While not commonly thought of TUIs, generally vi/emacs/lynx/etc would all technically qualify (tho people might give you a strange look if you called them TUIs). To be clear, these do not use curses. They kind of predate curses and just wrote it manually. Curses is not a requirement ffor a TUI, but is by far the most common library to use when writing TUIs now-a-days. [0] https://en.wikipedia.org/wiki/Curses_(programming_library) https://en.wikipedia.org/wiki/Curses_(programming_library) [1] https://i.stack.imgur.com/oD7mJ.png https://i.stack.imgur.com/oD7mJ.png
- ephimetheus 6y agoActually, curses uses two buffers and diffs them so that only the delta is sent „over the wire“. In graphics, everything is redrawn every frame usually.
- httpsterio 6y agoCurses is just a library for writing command line interfaces. Normally a CLI just deals with the text buffer pushing content and the user inputting textual commands, curses allows for a bit more control like with panes, dynamic areas and giving the user more control on how to input commands.
- ezequiel-garzon 6y agoCurses is just a library for writing command line interfaces. You mean text user interfaces, right?
- minhm 6y agomagit is a good alternative, it's not exactly a TUI because it works entirely inside emacs Emacs also has TUI (when running in the Linux terminal or run `emacs -nw') so magit should also has TUI (at least on GNU/Linux where I use Emacs on).
- jjav 6y agoAs a short analogy: ps vs. top