News for hackers. Stuff that matters.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by echelon on Sunday December 15, 2019 @05:11PM (#21799335)
I'm really curious - why do people want a graphical git client? The command line exposes everything, and the model is simple and intuitive.

I work in a very large monorepo, so it's not like I'm working in a git tree that isn't complicated.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by andybak on Sunday December 15, 2019 @07:40PM (#21799996)
> the model is simple and intuitive

I nearly spat out my drink. Git is many things but those aren't the first two words that would leap into my head.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Sunday December 15, 2019 @08:46PM (#21800243)
Git model is simple.

What is complex is the hundred features and commands it provides on top of that model.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by andybak on Monday December 16, 2019 @06:35PM (#21808765)
> Git model is simple.

I strongly disagree.

Let's list just basic git concepts that you're likely to encounter fairly early on: the working tree, staged commits, branches, remotes, stashes, detached heads, tags, submodules, merge conflicts, squashed commits, fast-forwards, rebasing, cherry-picking.

Some of these you could choose to ignore - rebasing and submodules - but on the whole you need at least a cursory understanding of everything on that list to get by without a git angel to get you out of trouble. I still have a person I phone when anything out of the ordinary happens and I've taught git to other people!

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Monday December 16, 2019 @10:03PM (#21810123)
You are confusing the model with the features built on top of that model.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by deepaksurti on Sunday December 15, 2019 @10:01PM (#21800513)
Git is a great example of worse is better philosophy.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by okusername on Monday December 16, 2019 @03:47AM (#21801692)
Thats exactly wHat GUIs are good for. Make infrequenlty used features and options accessible.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by anticodon on Monday December 16, 2019 @04:25AM (#21801853)
But GUIs for git usually do not provide access to all the features. They implement a very small subset that is just as easy to use from cmdline.

I'm also genuinely surprised that people use GUI for git. For merge I understand, but for all other tasks cmdline is easier and faster.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by fwip on Sunday December 15, 2019 @08:08PM (#21800124)
The model is relatively simple, but the UI is a disaster.

Which is exactly why people want better clients than the official git cli client.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by erklik on Sunday December 15, 2019 @09:11PM (#21800341)
I find that it has too many magic commands built-in so no-one really gets to learn the under-side of what's actually occuring so when it eventually breaks like everything does, you have no idea what you did wrong. An example would be how the git pull command is basically a bunch of different git fetch and merge commands.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by OJFord on Monday December 16, 2019 @03:45AM (#21801684)
Yes, but if it didn't exist people would say git's bad because everyone copies the same alias from StackOverflow, and it should just be built-in.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Sunday December 15, 2019 @08:19PM (#21800158)
Say you want to find a commit that occurred around June three years ago, and look at what the repo looked like after that commit -- without checking out any files. How do you currently do it?

For me, I just Right click -> TortoiseGit -> Show Log -> scroll -> Right-click -> Browse Repository.

How long does it take you? For me it takes < 10 seconds (I just timed myself).

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by tannakartikey on Sunday December 15, 2019 @09:29PM (#21800400)
Not against GUI or anything but just curious about doing it from CLI: git log | grep 'June 2017' (and remember the first 5 characters of hash) And then `got checkout <hash>`
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Sunday December 15, 2019 @09:33PM (#21800407)
I think you missed the part that said "without checking out any files"?
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by debaserab2 on Sunday December 15, 2019 @11:47PM (#21800872)
Why would checking out files matter? What exactly do you think the GUI is doing underneath the hood?
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Monday December 16, 2019 @12:01AM (#21800917)
Because it messes with your work tree. See here for a longer response: https://news.ycombinator.com/item?id=21800524
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gumby on Sunday December 15, 2019 @09:15PM (#21800350)
git log | grep -- find the hash of the one I want. or git log > file and look at it in an editor. no need to change the tools just for this unusual action.

I understand that YMMV -- de gustibus non disputandum est -- but I have ever understood the appeal of GUI tools especially for something like git. I do use magit, but even then I do most manipulation with the command line interface

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Sunday December 15, 2019 @10:04PM (#21800524)
> git log | grep -- find the hash of the one I want.

This misses the point of the problem -- the point is you don't know precisely what string to grep for.

> or git log > file and look at it in an editor. no need to change the tools just for this unusual action.

I mean, nobody said this 1 reason should be enough to make you switch tools? I was just giving an example.

And no, it's not "unusual" just because you say so to try to dismiss the problem. I know I use Browse Repository as well as the GUI logs pretty frequently, and they're godsends compared to your solution.

And lastly: this is what your solution actually looks like:

1. Dump the entire log output into a temporary file

2. Open that temp file in your editor

3. Look through the commit messages/dates/names

4. Realize that's not quite enough to narrow down your search to a single commit (maybe you want to see the diffs or file paths or something else?)

5. Try to figure out which flags you should to pass to git log to dump all the info you need

6. Call git log again, hopefully now it dumps all the info you need

7. Open the temp file again in your editor

8. Scroll through your file containing diffs/names/whatever extra info you dumped

9. Type 'git checkout COMMIT -- file/path' once you find something

10. (Hopefully,) before you press Enter, realize you're about to trash your current copy of the file, which had some other changes

11a. Run git stash, and now suddenly messing up your staging area that you'd carefully staged changes in, and also messing up the file metadata (e.g. Make will now rebuild everything...), OR

11b. Figure out how to run git checkout-index -a -f --prefix=/destination/path/ so that you check the file out into a different directory.

12. Once you have a copy of that file, look through it, maybe examine/pull out the code you wanted (or whatever)

13. Remove the temporary file you checked out.

14. Remove the temporary file in your editor.

15. git stash pop.

And somehow you always do all the above without making a mistake, otherwise have fun reverting or recovering lost data.

With a GUI log TortoiseGit's log, you literally:

1. Click on a commit with the date you're interested in

2. Select Browse Repository

3. Double-click each file you want to examine to see the diff

4. If it's not the file you want, press Escape and click again.

Not only is the number of steps smaller, each one is also significantly faster, and less risky too. No need to mess with a single temporary file, fire up your editor manually, or risk losing anything.

Anyway, again: this was just 1 example meant to get the idea across, hopefully with the aid of your imagination to extrapolate to other scenarios. But if you're going to trash this all with "this never comes up" I don't really have the energy or interest to keep bringing up examples or try to convince anyone; you should just keep using the CLI.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by debaserab2 on Monday December 16, 2019 @12:14AM (#21800951)
I don't think a lot of the steps listed in your first example are as painful as you make them about to be. Most of those steps are just as elementary as clicking a button in a GUI to someone with fluency on the CLI. I also doubt the claims that it's that much faster for someone with a lot of experience doing it.

Perhaps you could be faster with the GUI than on the CLI, but learning a GUI doesn't come with zero overhead: you have to understand it's terminology, how it's configuration works, what its icons and symbols mean. Particularly when it comes to VCS management, GUI's like to simplify sometimes complicated or nuanced VCS behavior and you can't really be sure what is being done to your repo until you've pressed the button and done it. Not to mention you are now investing time learning a program that can be abandoned at any time and leave you without the basic knowledge necessary to manage your repo (not saying this would affect you this way, but it could certainly be a reason to not learn it in the first place).

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Monday December 16, 2019 @12:49AM (#21801058)
> I don't think a lot of the steps listed in your first example are as painful as you make them about to be. Most of those steps are just as elementary as clicking a button in a GUI to someone with fluency on the CLI. I also doubt the claims that it's that much faster for someone with a lot of experience doing it.

I mean, it's not like you can ever convince me that >10 keystrokes are as fast as 1 click, but regardless, this is easy enough to settle -- just time yourself and let me know how long the steps take you on the CLI.

> Perhaps you could be faster with the GUI than on the CLI

Hence the point!

> but learning a GUI doesn't come with zero overhead:

I don't think anybody claimed this either, so it's fine.

> you have to understand it's terminology, how it's configuration works, what its icons and symbols mean.

It sounds like you haven't used TortoiseGit... at all? How often have you had to look at its manual? How many times have you had to look at the manual of git itself? Honestly, your own reply is warranted here so many times more than it was to me -- "I don't think a lot of the steps are as painful as you make them about to be."

In fact so many of the commands are so obviously self-explanatory (both in text and in icons) that you literally never need to look them up. Stuff that you would never just guess how to do in git itself. Like when you right-click a file in a commit and click "Save revision to...", which also has a floppy next to it. Is it really such a mystery what it does? Is it even remotely comparable to figuring out checkout-index (or whatever the right command is)?

And honestly: it's such a poor attempt at an argument to suggest that the minor ramp-up time of TortoiseGit is somehow not worth the perpetual git pains it saves you from that I don't even know what to say.

> Particularly when it comes to VCS management, GUI's like to simplify sometimes complicated or nuanced VCS behavior and you can't really be sure what is being done to your repo until you've pressed the button and done it.

First, this is such an unnecessary strawman. If you're so worried what some GUI command does, then just use the CLI for it instead.

Second, this is completely irrelevant for read-only operations (like log, Browse Repository, etc.) which were the ones concerned here.

And third... again, it sounds like you're only saying this because you haven't used TortoiseGit, because (shockingly enough, to someone coming from the git CLI) it's not a minefield; in fact it has a number of safeguards. "Commit" creates a commit, "Revert" reverts your changes, "Checkout" checks out a commit, etc... and in fact fails if your tree is dirty, so you don't lose data. Heck, sometimes the git commands it prints end up being more correct than what you'd type on the command line. I know I've learned a fair number of random git features from TortoiseGit.

> Not to mention you are now investing time learning a program that can be abandoned at any time and leave you without the basic knowledge necessary to manage your repo

Again, nobody said you shouldn't learn the CLI. In fact, I'll say it right here: you should definitely learn the CLI, especially for git, before moving to the GUI, or you will be confused (though even then, you'd probably be less confused than you would be if you started with the CLI itself).

> (not saying this would affect you this way, but it could certainly be a reason to not learn it in the first place).

No, it's most definitely not a reason not to learn it.The discussion was never about what you learn in the first place, but what you use. You should learn the command-line regardless. And even regarding usage, it's again a strawman: nobody even suggested you should never use the CLI. The question was "why do people want a graphical git client?" and the answer was "because it makes {tasks} easier", for some tasks. If you find any tasks that don't fall in that category, just use the CLI. It's just a tool after all, not a religion.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gumby on Monday December 16, 2019 @04:06PM (#21807190)
> I mean, it's not like you can ever convince me that >10 keystrokes are as fast as 1 click,

I know your reply was to debasarab2 and my upstream comment did say YMMV, but in fact it is a lot faster for me (and likely debasarab2) to type 10 characters than click an icon. My working mode is simply different. We’re not saying you’re wrong, what we’re saying is it’s not universal.

If I Haase to click a button I have to move a hand off the keyboard, shift my gaze, find the mouse pointer, move it, then BT my hand back to the keyboard.

Whereas on a command line I always know where my keystrokes go, I never have to move my hands or look away from the screen, and I have >40 years of typing at computers wired into my basal ganglia. (This is despite the fact that the first computer I used, a CADR lisp machine, had a mouse and bitmap display). GUI interfaces are simply much slower for me, except in very unusual applications. I am not claiming it to be universal but it is clear the affordances of the command line are significantly lower-friction for people accustomed to them.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Monday December 16, 2019 @04:12PM (#21807247)
My hands are on the keyboard most of the time too, I'm not a particularly slow typer, and there's no way I could write a proper git checkout-index command at the speed of just a click or two.

But again: I will believe you if you measure it and report back. So far the only person who's measured anything has been me, and I have to wonder why others are so averse to it.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by debaserab2 on Monday December 16, 2019 @01:42AM (#21801215)
Yeah, if you consider my arguments to be strawmen, then using a VCS GUI for the narrow use case of tracking down diffs might save you a solid few minutes. That just feels like a drop in the bucket compared to the overall time spent developing. YMMV I guess, depending on what organization/codebase you are working on.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by lllr_finger on Monday December 16, 2019 @10:15AM (#21803568)
Probably just GitHub (the browser UI). If you want to do it offline or from the command line, I understand why you might hesitate want to check out files, but stashing in git is extremely easy.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Sunday December 15, 2019 @08:47PM (#21800249)
git log, copy paste hash, git checkout

If you have a dirty wd, stash.

But, to be honest, I almost never perform that action, and when I do I use the web browser.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mehrdadn on Sunday December 15, 2019 @08:50PM (#21800260)
> git log, copy paste hash, git checkout

You remember the hash of your June commit 3 years ago??

> But, to be honest, I almost never perform that action, and when I do I use the web browser.

Web browser... for a local repo? Or do you mean you don't have a solution if your repo isn't on GitHub or you don't have an internet connection handy?

(You should also time yourself on your web interface by the way.)

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Monday December 16, 2019 @10:01PM (#21810117)
> You remember the hash of your June commit 3 years ago??

...which is what the git log above is there for.

> Web browser... for a local repo? Or do you mean you don't have a solution if your repo isn't on GitHub or you don't have an internet connection handy?

Yeah, local repo. You know, git is not GitHub. :)

> (You should also time yourself on your web interface by the way.)

Just paste the hash commit in the HEAD selector or even in the URL.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by manigandham on Sunday December 15, 2019 @09:18PM (#21800367)
> "when I do I use the web browser"

So a graphical interface then? I'm sure you can see why using a GUI for other functions is just as useful.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by cwojno on Sunday December 15, 2019 @06:12PM (#21799637)
Try doing a merge with IntelliJ's 3-way merge UI. It's flippin' fantastic compared to roaming through the files and removing sections between >>>> and <<<<.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by philwelch on Sunday December 15, 2019 @07:17PM (#21799907)
Command-line git allows you to specify a mergetool, many of which are capable of three way merges.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by cwojno on Monday December 16, 2019 @02:24AM (#21801337)
The point was convenience. I don't have to leave the IDE.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by chiefsucker on Monday December 16, 2019 @01:45PM (#21805773)
For some people Unix is the IDE.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by manigandham on Sunday December 15, 2019 @05:27PM (#21799406)
Many people are visual. It's a lot easier to see changes, compare diffs, and generally follow the development branches through a GUI instead of through a command line.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by danielbarla on Monday December 16, 2019 @02:23AM (#21801333)
I think the main advantage of GUIs in general is a contextual, curated explorability that is often lacking in CLI tools. The GUI is stateful, allows the user to click on things and prod it, and hopefully shows the most frequently used features for that context. This allows even complete newbies to be productive almost immediately.

For something like git, the slightly more visual representation is a benefit to many, too.

I'm not here to knock CLIs, there are a set of tradeoffs to be made, and CLIs win in many cases (flexibility, scriptability, being able to copy snippets you frequently use, etc). The above does tend to hold true, however.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by dabeeeenster on Sunday December 15, 2019 @05:53PM (#21799544)
Git is famous for being unintuitive?
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by OJFord on Sunday December 15, 2019 @06:29PM (#21799704)
Infamous, and a more accurate description might be that discussions about git are well-known for quickly descending into discussions about whether or not it's intuitive and whether or not that matters since you use it every day you'll soon get it and no longer care that much how intuitive it is anyway.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by aclsid on Sunday December 15, 2019 @09:16PM (#21800359)
Just give thanks that you did not have to work with the likes of CVS and such.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by muzani on Sunday December 15, 2019 @07:06PM (#21799855)
One of the advantages is you can easily explore what changes were made and merge conflicts through the tool.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by chrisseaton on Sunday December 15, 2019 @07:34PM (#21799975)
I like to drag and drop commits into an order I want when doing an interactive rebase.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Sunday December 15, 2019 @08:51PM (#21800261)
That's easy with the TUI
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by chrisseaton on Monday December 16, 2019 @04:54AM (#21801968)
Dragging and dropping? Or do I have to rearrange the lines using a text editor?
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by gdxhyrd on Thursday December 19, 2019 @04:52AM (#21833444)
Rearranging a line is 3 keystrokes in vim, which I use for that particular action, since it is perfect for that, rather than my normal GUI IDE.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by hota_mazi on Monday December 16, 2019 @12:34AM (#21801014)
I wonder the opposite thing: why do people try to use git in a terminal?

Its output is so rich and complex that it's impossible to make it legible outside of a real GUI, with graphics and colors.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by mandeepj on Sunday December 15, 2019 @05:25PM (#21799399)
for a new person, it's almost impossible to get anything done with git command line
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by OJFord on Sunday December 15, 2019 @06:32PM (#21799716)
You could say that about any tool, of course you have to spend some time to understand how to use it safely and effectively.

'for a new person, it's almost impossible to get anything done with a table saw'

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by jstrong on Sunday December 15, 2019 @08:00PM (#21800083)
do people say, "a table saw is simple and intuitive"?
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by OJFord on Tuesday December 17, 2019 @09:43AM (#21813868)
Well on the face of it, it's a simple tool isn't it? It's a spinning saw blade, and surface(s) against which to rest the wood being cut.

And I've never used one, but I'm sure it takes some learning, skill, and practice to get good cuts the way you need them, e.g. bang on 45deg all the way across for a 'mitred' corner joint. And it certainly needs learning, care, and attention to operate safely.

I don't mean it to be an insensitive analogy - accidents involving table saws are obviously horrendously worse than those involving git.

Re:JetBrains: $270M revenue, 405K paying users, $0 raised by throwawaymath on Sunday December 15, 2019 @08:45PM (#21800239)
I haven't heard anyone say that, but after thinking about it for a second I sure as hell would. A table saw is a lot easier to use than git.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by amerine on Sunday December 15, 2019 @07:09PM (#21799867)
I think most folks like a graphical merge tool, such as opendiff, or at least that's what I've been able to glean.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by kelsolaar on Monday December 16, 2019 @03:57AM (#21801734)
I work on a lot of repositories, having a GUI makes it really easy to change context and getting up-to-speed quickly.
Re:JetBrains: $270M revenue, 405K paying users, $0 raised by randomidiot666 on Sunday December 15, 2019 @06:50PM (#21799799)
As someone else mentioned here, the graphical merge tool in IDEA is extremely powerful. Plus keyboard shortcuts to all the main Git actions. It's overall more efficient. However I always use Git IDEA + Git CLI side by side.