News for hackers. Stuff that matters.
Re:Guitar – Git GUI Client by laszlokorte on Wednesday April 22, 2020 @05:52AM (#22943900)
In my opinion git GUIs have two major adventages:

1. you can see all the information at on glance: current branch, all local branches all remotes and remot branches, local changes, recent commits, current merge conflics

2. cherry picking single lines for staging in multiple files is much faster in a GUI than via terminal (maybe there are clever tricks to make it easier I don't know of)

Re:Guitar – Git GUI Client by ProZsolt on Wednesday April 22, 2020 @03:06PM (#22949038)
1. Do you really need that? It looks good, but how useful it is? I usually only care about my branch and the branch I like to merge in.

2. Yes, that was the only reason I have used git GUIs, but most modern editors have these features built-in.

Re:Guitar – Git GUI Client by richardwhiuk on Wednesday April 22, 2020 @06:05AM (#22943977)
`git add -p` is pretty fast for staging parts of files
Re:Guitar – Git GUI Client by konart on Wednesday April 22, 2020 @07:14AM (#22944349)
Unless I'm missing something - it only shows you a hunk, without much (or any) context. It's relatively fast to stage hunk like this, but you are doing it like blindly.
Re:Guitar – Git GUI Client by skrtskrt on Wednesday April 22, 2020 @12:39PM (#22947442)
I use git add -p almost exclusively & I'm a big fan, to me the limitation is when the part I want to stage and the part I don't are so close together that they get presented to me as a single atomic chunk to add/not add.
Re:Guitar – Git GUI Client by dbalatero on Wednesday April 22, 2020 @02:41PM (#22948802)
Do you ever hit 'e' to edit? You can alter the patch manually in Vim/$EDITOR – this is what I do when I hit those edge cases.
Re:Guitar – Git GUI Client by richardwhiuk on Sunday May 03, 2020 @04:17PM (#23061542)
You can also press 's' to split in some cases.
Re:Guitar – Git GUI Client by skrtskrt on Wednesday April 22, 2020 @04:52PM (#22950068)
Ah no - but I will now!

Still, usually what I need there is the ability to leave a line or two there but don't stage it.

Re:Guitar – Git GUI Client by u801e on Wednesday April 22, 2020 @10:15AM (#22945772)
An alternative is using TUI application like vim in conjunction with tools like recountdiff and git apply to handle staging and unstaging parts of files.

You get more context because you can see other parts of the diff in the editor, unlike when using the -p switch with the git add or reset commands.

Re:Guitar – Git GUI Client by konart on Wednesday April 22, 2020 @01:04PM (#22947730)
I'm actually using NeoVIM + fugitive and git-gutter.

GitGutter make working with hunks easy

Re:Guitar – Git GUI Client by u801e on Wednesday April 22, 2020 @03:53PM (#22949505)
Looking at the README of vim-gitgutter[1] (assuming that's the plugin you're referring to), it says the following:

>> You cannot unstage a staged hunk.

I'm not sure if that's a feature they plan to support, but something like this could easily be done by highlighting the hunk displayed when running git diff --cached in vim's linewise visual mode and filtering it through git apply -R --cached -.

[1] https://github.com/airblade/vim-gitgutter

Re:Guitar – Git GUI Client by blux on Wednesday April 22, 2020 @06:10AM (#22943998)
What is the use case for 'seeing all information at once'. Normally you want to see something specific, in which case a terminal allows you to see that specific information faster than a GUI.
Re:Guitar – Git GUI Client by laszlokorte on Wednesday April 22, 2020 @06:19AM (#22944061)
If all information is already on the screen I am faster moving my eyes to the spot of interest than typing the command (or even a single letter alias).

I guess you would not want to edit a text file of which you could only see a single line at a time.

Re:Guitar – Git GUI Client by konart on Wednesday April 22, 2020 @07:11AM (#22944324)
>What is the use case for 'seeing all information at once'.

Projects can be messy and sometime you really need a bird's view of what's going on with all those branches\merges etc.

Re:Guitar – Git GUI Client by hombre_fatal on Wednesday April 22, 2020 @12:31PM (#22947356)
GUI also makes it easy to cross-reference between branches, automatically pull submodules, see/do all sorts of things without keeping crufty cli args in your head. I mean, the latter is huge.

I felt a certain bravado in uni for always using the cli that I see among other HNers. As I get older, I couldn't give less of a damn. Scrolling manpages to find an re-remember the unintuitive cli arg I need vs just clicking a button that does it? I prefer the latter. The former is always available if I need it.

The few times I have to drop into cli git are the things I always have to look up anyways, like git-reflog.