4 ms·
> but haven't seen any apps built with it yet. The gitg git gui is written in vala. I've used it for several years because it allows easy staging of individua
by rogerbinns 3y ago
> but haven't seen any apps built with it yet.
The gitg git gui is written in vala. I've used it for several years because it allows easy staging of individual lines, as well as reverting them.
https://github.com/GNOME/gitg/tree/master/gitg https://github.com/GNOME/gitg/tree/master/gitg
- all2 3y ago> because it allows easy staging of individual lines I have been looking for this functionality for literally years at this point. Thank you! I will be trying this.
- calvinmorrison 3y agogit add -p
- rogerbinns 3y agoNot a gui, and rather painstaking. With gitg you single click on lines in changes (green added, red removed) which selects them. You can separately click on as many disjoint ones across as many hunks as you want. There is a 'Discard Selection' button which removes the highlighted lines from the code, and a 'Stage Selection' to add those lines to the index. While git add -p is in theory doing something similar, it is a lot more painful to use, and you are still working a hunk at a time instead of just scrolling through changes. I often use this functionality when I've made a number of changes during development and everything is now coherent, especially on a multi-language project. It is then easy to go in and discard lines that were added to debug, and stage lines across multiple commits so they are logically grouped.
- funny_falcon 3y ago`git gui` and `gitk` my Swiss-knife tools for every day git-ting. They are maintained by git core team.
- rogerbinns 3y agogit gui says unknown command for me. gitk doesn't let you click on individual lines, and revert or add them as far as I could find.
- grumpyprole 3y agoGit gui is often in a separate package that you will need to install
- rogerbinns 3y agoThanks - I eventually found it in the package repositories. It does indeed have the same functionality as gitg for staging and reverting individual lines. It does have several UI niggles. For example when selecting it does not do so on a line by line basis, but instead character by character. But the operations are line by line, (or hunk). You also can't right click on file names and choose stage, revert, or delete.
- flexagoon 3y agoDon't you just have a git client in your editor? All popular "out of the box" editors include one, and DIY editors like Emacs and Neovim have Magit and Neogit respectively. I find editor git integrations much more comfortable to use than some separate tool.
- rogerbinns 3y agoI use vscode. It didn't have line by line operations until recently. The sweet spot is working on hunks, not lines. For example hunk operations are quick and easy with short menus, while selecting some text then has the regular right click menu which is most of the height of my screen with 33 menu items, 3 of which are git operations. The selection is also character by character vs line by line.