r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

31

u/parla Jun 19 '14

Relevant in the context: https://github.com/FredrikNoren/ungit

8

u/tonsky Jun 19 '14

Ungit is good and is, like, halfway on its journey there. We’ve got in touch already: https://github.com/FredrikNoren/ungit/issues/395

29

u/[deleted] Jun 19 '14

Or you know...use Mercurial and TortoiseHG, which solved this problem ages ago.

3

u/forgotwhereiwasgoing Jun 19 '14

Can verify! TortoiseHg is smooooooth. Its default integration with kdiff3 for three-way merges is superior to any merge resolution tool I've come across since. I still use kdiff3, though with manual file input since the other gui's either don't support merging or kludge it up by choosing the wrong revisions as input (looking at you, tortoiseGit).

Just a shame mercurial doesn't allow you to branch as easily as Git does.

3

u/[deleted] Jun 19 '14

Just a shame mercurial doesn't allow you to branch as easily as Git does.

What's wrong with the branch command?

1

u/forgotwhereiwasgoing Jun 19 '14

Not much, the branch command does what it's told, but when I used mercurial there was no stash-equivalent included. Result: Every feature branch got its own clone.

I see the shelve-extension is bundled with mercurial as of november last year, so that might have changed, if it works reliably.

50

u/gibbocool Jun 19 '14

We introduced git to my software development team a couple months ago, and it's been a complete disaster. Some people understand git, some won't / can't / simply dont care. I spend hours a week helping people merge their code. These changes proposed will revolutionize the experience.

7

u/ggtsu_00 Jun 19 '14

I'm on a team that has several non-technical members committing and pushing to our git repos (designers, localization, etc).

It was tough to get them onboard, but we follow a very simple workflow for these people that makes git very simple to pick up. All they need to know is these:

git pull
git add
git commit
git push

No rebase, no branching, or anything advanced. Limiting it to that simple use case makes it easy to pick up and start using for anyone.

2

u/shenoyroopesh Jun 20 '14

I think one thing we have found useful is start with the above simple things, and also promote usage of git-svn - where each developer can start working with git even if the company/client is using svn. Over time, it gets enough people familiar with Git that moving to Git overall becomes simpler.

20

u/bachmeier Jun 19 '14

What do you do if they don't like the language they're using? Do you let them choose their own? What if they don't like the coding style? Do you let them use their own?

Basic Git usage is not difficult. I can understand if by "hours a week helping people merge their code" you are talking about complicated edge cases, but if it's just normal usage, that's just laziness.

21

u/the_other_brand Jun 19 '14

Well, one would assume that yes they did choose their own language. Most of the time a language is chosen before a developer is hired, and a developer knows what they are getting into when they chose to work in their current position. Coding style is its own issue.

Though I suspect that it isn't a matter of laziness as much as active dislike of git itself. It is really hard to learn a piece of software if you think the software is a load of crap that has no benefit and was forced on you. This has nothing to do with the actual benefits, I'm sure you can give me tons of examples; this only deals with the appearance of benefit.

From some of these dev's perspective it isn't a magic bullet that solves all source control problems, it is a source control that does the same thing as their last one but 10 times more annoying. At the very least I certainly see it that way.

8

u/nutsack_incorporated Jun 19 '14

From some of these dev's perspective it isn't a magic bullet that solves all source control problems, it is a source control that does the same thing as their last one but 10 times more annoying. At the very least I certainly see it that way.

Hear, hear.

8

u/titosrevenge Jun 19 '14

Most programmers get hired to work in a specific language. You'd have the same problem if you told your group of Java programmers that they're all required to use C# from then on.

Some will be excited to learn a new language and others will learn the bare minimum and continue to use the same old patterns with a new syntax and complain when it doesn't work the same way.

18

u/Hoepla Jun 19 '14

Git is a tool. Comparing a tool to a new language is not fair. People get hired to code C# or Java, people do not get hired to use Eclipse or IntellJ, or Git or SVN.

This is laziness.

6

u/fecal_brunch Jun 19 '14

Programming languages are tools too. Really people are getting hired to create software. The only reason they need to use specific languages is because they are required to integrate with the project.

The difference is that git is much easier to learn than a new language. Also, everyone should already know it.

-4

u/[deleted] Jun 19 '14

What? Git is totally like a programming language. It's entirely fair to compare it to one.

No I'm not being sarcastic.

It's also like a library. You have to learn about certain types of objects and how they interact with each other, and what library functions (git commands) do what to these objects.

7

u/-Y0- Jun 19 '14 edited Jun 19 '14

No it's not. Git is rather complicated because the CLI is atrocious, but day to day basics, learning the founding principles of git isn't hard and once you do you understand Git and not just clobber CLI until it does what you want. If you don't understand Git's model you are doomed to repeat arcane commands you don't understand.

An anecdote: On my previous employment a member of team that had very strenuous grasp on git (let's call him GitLord) simply wrote down the TEN COMMAND(MENT)S OF GIT and adhered to them religiously. My colleague who actually knew Git fairly well, would get in trouble with GitLord because allegedly he made some unneeded merges. When I once really, had enough of GitLord's preaching I actually looked at his environment and it seems that GitLord didn't obey his own commandments and was the one causing 'merge problems' . Merge problems being that GitLord didn't rebase on master before he merged his changes which led to following graph:

  *
  | \
  C   GitLord's commit
  | /
  *  

instead of:

 GitLord's commit
 |
 Colleague's commit
 |
 *

Which in on itself isn't an error...

5

u/ggtsu_00 Jun 19 '14

If you want to preserve a linear history of commits using rebase, you probably should just be using SVN. Most issues with people have with git is them trying to use it like SVN.

→ More replies (1)
→ More replies (1)

6

u/[deleted] Jun 19 '14

Programmers are hired for their skill.

If a member of my team is not willing to learn a new language/library/tool because they just don't feel like it, I'd fire them.

If you're a Java programmer, it's completely reasonable to assume you can pick up C# and work with it. It may take you a couple of weeks to get up to speed, but from then on everything should be simply a matter of Googling for the available libraries/apis.

In fact, you should be able to pick up C# even if you've been mostly programming in ruby and javascript up to that point.

8

u/s73v3r Jun 19 '14

It's reasonable that they would be able to, but I imagine most of them haven't touched it for a reason. I don't do C# because I don't want to do C#. As an employee, I'd feel fairly betrayed if I was hired for something I like doing, and then forced to do something I have no interest in doing because of some arbitrary reason.

2

u/[deleted] Jun 20 '14

Welcome to the working world, where you are paid to do what you're told?! Sheesh.

Ok, perhaps a bit harsh, but it seems only developers can get away with this attitude in today's economy given unusually high demand. I know the users who hate the internal tools I create don't have a choice but to use them.

I, for one, would be grateful to spend time learning a new language on my employer's dime, even one I wasn't particularly interested in before.

→ More replies (3)

3

u/[deleted] Jun 20 '14

You'd have the same problem if you told your group of Java programmers that they're all required to use C# from then on.

Bad example, every Java programmer I know would love to work in C#.

0

u/MrPopinjay Jun 19 '14

Sounds like some shitty employees to get rid of.

3

u/MechaBlue Jun 19 '14

The git command line is about as much fun as penicillin-resistent gonorrhoea. I understand the benefits of DCS but there are much better examples out there. Ones that aren't an exercise in pounding nails through my dick. When I use git, it's because, according to the community, Linus' farts smell like roses and cookies.

4

u/[deleted] Jun 19 '14

I ran into the same issue, the same problem people seem to have given up on trying :(

16

u/lucasvandongen Jun 19 '14 edited Jun 19 '14

Git is a disaster in terms of human interface and honestly kind of tarnished the god like reputation of Linus for me.

I mean if you build your OS on top of Unix conventions it has all the quirks of Unix conventions and all the benefits that those quirks are already known by a large group of people. You can easily switch between MacOS X Terminal, Linux terminal or some very ancient systems because basically they work the same. Not super user friendly though, but learn once apply anywhere. So I accepted some quirks because that was the legacy before it.

But if he gets the chance to design a product from the ground up and it's way harder to use than it should be just because the English words he chose as commands have a very loose connection to what they actuallly or in some circumstances do that's just bad. It's extremely inconsistent and it's also hard to build good tools on top of it and I basically use the command line for everything else than basic commit/push just because I always ended up going there anyway if I needed to do anything more spectacular than the absolute basics.

I mean you can explain how Git works on a whiteboard in five minutes. The concepts are really simple and everybody coming from TFS or SVN should basically be relieved from a lot of shit because Git is so much better but the interface adds new problems while TFS and SVN are things you learn in a day.

10

u/tonsky Jun 19 '14

I’m not sure that Linus is personally responsible for git CLI. It all started as directory management software (like rsync), and then suddenly grew into world’s most popular VCS. This grow was chaotic and there were no great design behind it. I think I even seen somewhere that he was very surprised to find out that a lot of people has started to use his humble little tool.

If git was designed from the ground up as VCS, it might have had much better, non-fragmentary UI. But, you cannot predict success.

1

u/dalore Jun 20 '14

Try and have a look at the different gui's available, especially the commercial ones. I have had success with getting Mac designers using Sourcetree.

They even know how to do branching and merging too now.

-3

u/[deleted] Jun 19 '14

Some people understand git, some won't / can't / simply dont care. I spend hours a week helping people merge their code.

Fired.

→ More replies (1)

0

u/[deleted] Jun 19 '14

[deleted]

4

u/s73v3r Jun 19 '14

I don't feel like changing how git works will fix developers refusing to learn it...

Depends on why they refuse to learn it or struggle with it so much. The interface is definitely a huge issue with that.

13

u/imforit Jun 19 '14

I was largely with it, despite being quite functional with git, until the "always online." I don't think the author has worked with multiple remotes, where one may be your personal github (sync away!) But another may be a large project's core, where you only push a perfect branch when you're good and ready. Sure, the solution provided would likely be customizable, but there was no treatment for controlling your appearance to others at all. It applied his working assumptions which are not necessarily everyone's.

3

u/TheBuzzSaw Jun 20 '14

I was about to make this exact point. Continual, uninhibited sync would be terrible. I have no problem with continual background fetching; it would be great having a notification indicating that my changes will no longer play nice with what the server has right now, but if I am shuffling stuff around and/or experimenting with a particular commit layout, I really do not want those changes showing to everyone else. Let me choose to submit that.

3

u/loup-vaillant Jun 20 '14

I believe a good UI would let you configure your work-flow first, then get out of the way.

That said, this "always online" business could actually be useful. Indeed, it will mean you "change history" on published repositories, but we could imagine having branches marked "read only" or something, until someone decides they're good enough for full publication.

In any case, you want to be able to save your work on a remote server relatively often, for whenever you lose your data locally. Remote "not ready" branches would be good for that.

Another benefits of those would be to help someone who's stuck. Just checkout the (dirty) work in progress, maybe even do some modifications, then publish everything back. You just have to know that this branch will be cleaned up some day, and the corresponding commits will be obsolete. (as in, not even part of the "official" history of the repository).

With some luck, this may not turn into a complete mess.

1

u/tonsky Jun 19 '14

What’s the problem with pushing your branch in progress? If it’s your branch nobody else won’t mess with it anyway. You can shuffle and modify it any way you want, while staying perfectly in sync.

6

u/adamcrume Jun 19 '14

Mixing rebase and automatic pushing is a recipe for disaster. Not everyone assumes that each branch is touched by only one developer.

2

u/imforit Jun 19 '14

I have one project where the protocol is a branch (actually a commit) is a fully complete thing, ready for testing and review. There are dozens of core authors and who knows how many open source contributors. You don't push upstream until it is done.

Flexibility is good. It allows for models beyond what any one person has seen.

Edit : tablet keyboard thinks it knows better then me

1

u/tonsky Jun 20 '14

Big public projects may have a problem, yes. In github, however, this is solved by forking && pull requests instead of commiting to repo directly

1

u/imforit Jun 20 '14

right, exactly. So "automatic" needs to have some controls wrapped around it. I'm sure it can be done in a way that subscribes to the principles he laid out.

6

u/kazagistar Jun 19 '14

I was with the author most of the way, but two things bothered me a bit:

  • "Instant sync" removes some of the ability to restructure or reorder your commits before making them public, which is a part of many people's workflow.

  • The advantage of having a command line interface is ease of automation. Having your UI be a server is fine for remote access, but it makes it much harder to take part of your workflow and just toss it in a shell script.

5

u/tonsky Jun 19 '14

Instant sync does not removes ability to restructure and reorder. Other people will see your branch in-progress, but then they’ll automatically see how you restructured and prettified it.

I believe Git is a human tool, not a system-level service. Nevertheless, automation is left for the CLI interface, as repos are fully compatible.

2

u/kazagistar Jun 19 '14

So they can see, but they cannot branch from it? The reason you dont mutate pushed changes is because someone else might use the history, and it would break either his, or your code to change history.

2

u/tonsky Jun 19 '14

With auto-sync, this is handled better — you’ll actually see if somebody have already used your branch or not. But in practice, you do not start using someone else branch “just because”, you usually have some informal communication before that. This is not different from normal Git usage

1

u/kazagistar Jun 20 '14

Saying "normal git usage" is your hint that you are prescribing a model of usage.

1

u/tonsky Jun 20 '14

I meant “normal Git” as in “Classical Git CLI”

1

u/TheBuzzSaw Jun 20 '14

No point. Why continue auto-sync if I'm busy experimenting or whatever? I don't want people to see my experimentation. If this mythical Git UI were to materialize, I would not use it if there was not some way to disable the auto-sync.

1

u/tonsky Jun 20 '14

No point. Why continue auto-sync if I'm busy experimenting or whatever? I don't want people to see my experimentation. If this mythical Git UI were to materialize, I would not use it if there was not some way to disable the auto-sync.

There’s no problem for other people to see your work-in-progress but in your head. There’s, however, a huge usability win by removing manual sync step. You have nothing to do once you done. It simplifies things a lot.

→ More replies (1)

14

u/khayber Jun 19 '14

A git repo is NOT immutable. Whatever gave him that idea?

16

u/chuyskywalker Jun 19 '14

Yeah, rebase/etc do not, themselves, destroy history, but eventually a git gc will run (automatically or manually) and those commits will get removed.

9

u/Peaker Jun 19 '14

"eventually" is a very long time afterwards (>90 days by default).

8

u/chrisdoner Jun 19 '14

For practical work flow purposes i.e. for "oops I messed up" scenarios it's immutable enough. For archival purposes, indeed not. Although you can turn of garbage collection if you want via git config --global gc.auto 0.

4

u/TheBuzzSaw Jun 20 '14

Git objects are just as immutable as objects in C#, Java, Ruby, etc. (String is a good example.) They absolutely cannot be altered, but they most certainly can be destroyed once it is established that no one cares about it anymore. Those languages wait until there are no references to that object anymore; git does the same thing: branches/tags are your valid references.

2

u/slashgrin Jun 19 '14

The author misuses a bunch of words, so even though he basically seems to understand what he's talking about, it doesn't come across very clearly in some cases.

I believe what he means here is that new objects are created in the git repository when you perform an operation like a rebase, rather existing objects being altered.

5

u/gopher9 Jun 20 '14

Reinventing GIT interface

Oh, again? Also, I'll just left this here: GIT-EXPLAIN.

28

u/moswald Jun 19 '14

I might sound like an ass when I say this but, do you know how I "fixed" the git interface? I use Mercurial and Hg-Git.

11

u/[deleted] Jun 19 '14

I have used Mercurial for years now and every team has picked it up without any trouble. Git on the other hand for three projects I helped a friend on was a nightmare.

8

u/warbiscuit Jun 19 '14

Not to mention that lets you use TortoiseHg, which is great for invoking from the cmdline for quick operations as needed.

4

u/cpbills Jun 19 '14

One of the things that made git easier to understand for me was thinking about commits as nodes in a linked list.

Once I made that connection, managing rebases and branches and squashing commits have all become very natural to me.

16

u/IHaveNoIdentity Jun 19 '14

It's unbelievable how many people here thinks that a tool being useable by them means it's perfectly fine and that if anyone has trouble with it they're stupid or even lesser people. And even use that as an excuse to invalidate the amount of work put into this article.

People need to realize that git is and can be used for things besides programming, for example writing scientific articles in LaTEX which is done by people like mathematicians who might not know much about computers or have any interest in how they work.

The CLI works fine for you? Good for you, these interface improvents will have no impact on you so why complain?

No wonder open source tools rarely are used by average people if there's this much resistance everywhere to improvements...

8

u/oursland Jun 19 '14

LaTEX

Writing LaTeX is far, far, far more complicated than using git. I'd be surprised to find someone who feels they can learn to work with LaTeX, but cannot learn to work with a git repository.

6

u/omnilynx Jun 19 '14

I work with far more complex systems than git all the time for sure, and I have no doubt I could learn to use git if I put the effort into it. But why should I if I don't have to? Why not simplify it so I don't have to put so much effort into it?

4

u/oursland Jun 19 '14

But why should I

You should learn to use your tools well, particularly those that serve to ensure your job.

Why not simplify it so I don't have to put so much effort into it?

I see this type of comment all the time. There are many attempts to "fix" this problem in existence already, yet none have caught on in any meaningful way. This is because they make some bad assumptions about use cases. I have already stated in another comment that I believe this to be an example of the Hurricane Lantern Effect.

Let's take this posts recommendations and look how they don't actually scale and therefore aren't useful in a real world project. One of the rules of this interface is "Branch always occupies vertical column, never bends right or left", which works well when you've got only a couple branches. I just looked at my large, 7 year project with 50 developers and found that there are over 1000 active branches because we maintain development branches, release branches, test branches, and topic branches for over 20 products all using a common code base (common in the embedded world). How well do you think this UI would work with a tenth that?

2

u/omnilynx Jun 19 '14

That's fair. So your real point is that git cannot be made easier to use without losing important (but unrecognized by newbies) features.

2

u/Plorkyeran Jun 19 '14

It's certainly not that absolute: git has gotten easier to use over time, and I see no reason not to expect that trend to change. It's more of that any dramatic simplification almost certainly breaks something very important to someone.

Incidentally, this is part of why feature creep is so deadly. Once your application is complex, it can be very hard to make it simpler later.

→ More replies (1)

3

u/IHaveNoIdentity Jun 19 '14

My point wasn't so much whether or not they can learn to use either tool but rather how high the barrier of entry is and how easy they are to work with.

Furthermore it's been my general experience that LaTeX can be incredibly complex but that it's improved tremendously by packages that makes drawing graphs and what not very easy, even for people that aren't very computer savy. It's certainly not easy like Word but it's getting there with the help of tools like TeXStudio and sharelatex and packages like amsmath.

1

u/loup-vaillant Jun 20 '14

Then lower the bar: think of a bunch of Dreamweaver users, who write a web site collaboratively. It would be nice to have a DCVS, but I don't see such people bothering with Git in its current state.

1

u/oursland Jun 20 '14

Then lower the bar

This isn't an argument. For any tool you can arbitrarily lower the bar to have something to complain about.

It would be nice to have a DCVS, but I don't see such people bothering with Git in its current state.

What domain people develop in is orthogonal to the tools they use. I have worked with programmers who write assembly and low level C collaboratively by saving the source to a network drive. I wouldn't suggest it, but some people fail to see any value in investing in understanding their tools.

1

u/loup-vaillant Jun 20 '14

The argument is, many people who could benefit from a DCVS either couldn't learn Git in its current state, or shouldn't, because it's too much hassle at the moment (not enough ROI). On the other hand, we probably could design a DCVS my grandma could use. Then they would actually benefit.

Sure, I don't want to encourage the morons in their quest for ignorance. It sucks that people don't want to invest learning time. Still, you don't want to require more time than necessary. Learn programming? Sure. Learn the dark corners of C++? No thanks. Learn distributed version control? Sure. Learn my way around Git inconsistencies? I'd rather avoid that.

1

u/oursland Jun 20 '14

My argument is that what is an acceptable level of effort, or what the perceived I in ROI is, is very much dependent upon the individual. Unless it's a big button that says "push me", you'll always have someone displeased.

I don't find git challenging; many, many others don't either. The open source world has largely embraced git, and in doing so brought in a lot who would rather complain than act by either learning it or fixing it.

→ More replies (3)

9

u/e_engel Jun 19 '14

The git command line interface is atrocious but most of it can be avoided by simply using a GUI client.

There are plenty available, all with their pros and cons, but they make it much easier to visualize branches, diffs and logs. They even make it trivial to stage hunks, which I think every git user should know how to do (but is so arcane to do with the command line that nobody does it).

These days, the only times when I ever go back to the command line is to do interactive rebases or bisects, both pretty rare operations.

Personally, I use SourceTree because I barely have to touch the mouse to operate it. Staging and pushing files is just a matter of Ctrl-Shift-+ (for each file), Ctrl-Shift-c (open commit window), type commit text, Ctrl-Enter and Ctrl-Shift-p to push.

1

u/input Jun 19 '14

When using my colleague SourceTree to fix a problem, I always end up clicking the terminal button.

It seems good for basic stuff but when you have a problem I can never find the right button and end up looking like an idiot.

44

u/[deleted] Jun 19 '14

I guess I'm alone in finding git not that hard to use. My only issue is git isn't pretty and to that end I have a few scripts to give me prettier logs (like most people have) and prettier branch summaries (my macro displays all branches, their latest commit id and dates).

Beyond that I manipulate my tree with straight up git commands.

Any halfway competent developer should be able to master git in a couple of weeks let alone be able to write their own version of git given a couple of full time weeks to work in.

57

u/slavik262 Jun 19 '14

Git's UI is terribly inconsistent and wonky. See git koans.

To summarize, if you don't have the five minutes to read something hilarious:

  • Git ignores attempts to alias core commands, but doesn't warn you that it is ignoring them.

  • git checkout does several completely unrelated things in different contexts.

  • Flags for various git commands are terribly inconsistent.

  • Git's man pages are terrible.

→ More replies (20)

22

u/rwilcox Jun 19 '14

Any halfway competent developer should be able to master git in a couple of weeks

I disagree. I've been using Git every day for 6 years now and I've found Git's learning curve to be like a rollercoaster loop-de-loop: you're doing OK, then suddenly you need to do something that makes you go WTF so much you feel like you know less than you did 6 months ago.

git add, git commit, git push, basic branch workflow, sure. Mastering Git? I'd say years.

Quick how do you find the name of the branches the current commit is on? Push the current branch to the server but name it something different? Tell me about git push --force. What does git fetch do? What's in your global core.excludesfile file?

(Seriously, the number of developers that don't even know about Git's global ignore options is staggering. (I should never see .DS_Store files in my Git repo, but what do I see all the fracking time? .DS_Store files... Yes, thanks OS X, but still....))

3

u/[deleted] Jun 19 '14

Do you ever memorize all the functions and their arguments in the standard library of your language?! If you think you have to; you're doing it wrong.

To answer your questions, and this is off the top of my head:

Quick how do you find the name of the branches the current commit is on?

I don't. I always have the name of the branch printed as part of my bash prompt. I think git branch puts a start next to the current branch name.

Push the current branch to the server but name it something different?

git push remote_name local_branch_name:remote_branch_name

Tell me about git push --force.

Push the branch after rebasing. Basically force the push even though it would change the history for the branch.

What does git fetch do?

Download the data from the remote without merging any remote branch to your local branch.

What's in your global core.excludesfile file?

I don't know :)

6

u/Peaker Jun 19 '14

I always have the name of the branch printed as part of my bash prompt

I think he means something more like:

git branch --contains HEAD

git push remote_name local_branch_name:remote_branch_name

It's not really "local_branch_name" but "local_refspec", which confusingly, must be a branch name iff the remote branch name does not currently exist.

Push the branch after rebasing

Not after rebasing -- but whenever it's not a fast-forward in general. i.e: You can push it back a few commits, or after commit --amend, etc.

Download the data from the remote

Importantly, update the remote's tracking branches.

1

u/jayd16 Jun 20 '14

Meh, don't commit to memory anything you can easily look up. I would say you've mastered git once you get to a workflow you like. All the esoteric features are to get you out of a mess you shouldn't have been in anyway.

1

u/rwilcox Jun 20 '14

Well, we actually have the Dryfuss model for skill acquisition, which I forgot about until now.

Git's CLI doesn't help the learning curve and the surprising number of times I find myself using plumbing instead of porcelain commands to accomplish tasks... doesn't help matters.

→ More replies (5)

38

u/[deleted] Jun 19 '14

Any halfway competent developer should be able to master git in a couple of weeks

The problem is that not every competent developer is interested in mastering a source control system. I work in a group that develops pretty complex NLP software and spend way too much time helping people with git.

27

u/abolishcopyright Jun 19 '14

My problem is that I don't consider it a tool that's worth sinking weeks into. My time is valuable. I'll beat my head against its tedious interface / documentation / SO articles just enough to get a minimum set of functionality that works for what I need to do today, but my efforts to really "learn git" beyond that have been a waste of time due to its tedious, non-discoverable interface.

8

u/Peaker Jun 19 '14

Git is definitely worth sinking a few weeks into.

It's a horrible interface, but it facilitates such a productivity boost that you really should spend weeks learning it.

-3

u/oursland Jun 19 '14

non-discoverable interface.

Ever tried "git help"?

12

u/[deleted] Jun 19 '14

Um, any developer should be interested in SCM. It's how you control the revisions of what you're working on it.

That's like saying "electricians don't have time to learn about multimeters" ...

37

u/[deleted] Jun 19 '14

any developer should be interested in SCM

Every developer should use an SCM - not "be interested in it", unless they are developing one. The ideal SCM would be invisible to the developer.

That's like saying "electricians don't have time to learn about multimeters" ...

Analogies, analogies...

35

u/bushel Jun 19 '14

| analogies

No, pretty much all multimeters are digital these days.

6

u/gschizas Jun 19 '14

Hint: to do

this

type

> this

3

u/kazagistar Jun 19 '14

Now that I think about it, that makes no sense. I cannot imagine why it is not "| this".

3

u/robin-gvx Jun 19 '14

Because that vertical bar is just how Reddit displays blockquote by default and has nothing to do with the Markdown our comments are written in or the HTML it is converted to.

3

u/Majromax Jun 19 '14

Now that I think about it, that makes no sense. I cannot imagine why it is not "| this".

The angle-bracket is the conventional quote-marker in text-format e-mail and newsgroups. Aside from that convention, the vertical bar is also confusable for letters (lowercase ell, uppercase eye) in ambiguous contexts, and it's visually easier to count quote levels with angle-brackets (which take up more space) than vertical bars.

→ More replies (3)

6

u/oursland Jun 19 '14

Every developer should use an SCM - not "be interested in it", unless they are developing one.

This is unnecessary pedantry. Being competent with the tools of your job requires a level of necessary interest. I am very interested in understanding how to use my text editor, but I am not interested in writing my own.

SCMs are necessarily complicated; there are a lot of operations they need to support. The fact that we have so many people saying that git's interface sucks and then coming up with an alternative interface that is equally awful seems to indicate this is more a human problem, notably the Hurricane Lantern Effect.

7

u/G_Morgan Jun 19 '14

TBH saying a developer shouldn't be interested in SCM is like saying an author shouldn't be interested in proper contents and indexing. SCM is in some senses a table of contents into our software's history. Older systems give you a "as it comes" indexing system that is crude. Git is useful (among other things) because it allows us to impose more order on our history than we could otherwise achieve.

Mastering git is why I never, ever have a minor edit stashed in with my current story. My history looks like I've never discovered a simple task in the middle of another task. It is as if all the world is magical. All the minor issues that might roadblock my task get magically solved before the first line of code was cut on the new task.

This makes it incredibly easy to see how and what got done. Changes aren't splattered over the course of history like with svn but ordered in such a way that a person coming in can see how it all fitted together. There are never disruptive unrelated edits in my changes. Like an index into the history of your software project rather than a random assortment of change sets that come in whatever order they come in.

9

u/nutsack_incorporated Jun 19 '14

TBH saying a developer shouldn't be interested in SCM is like saying an author shouldn't be interested in proper contents and indexing.

You might be interested to know that there are plenty of people who do indexing work, and plenty of authors who hire them. Indexing is a specialized skill that requires careful attention and is often tedious. It's not something all authors should or do know about. Similarly, tables of contents are often the work of editors as much as authors. (Source: one of my parents is a published author and former contract indexer.)

→ More replies (1)
→ More replies (4)

6

u/MechaBlue Jun 19 '14

I have experience with CVS, SVN, git, and darcs. git has a horrible interface. It would be more user friendly if commands were entered by inserting X-Acto blades into my urethra.

On solo projects, darcs. It has the benefits of git (except git-hub) without the pain. On shared projects, SVN because it's common and we don't have to deal with git.

Don't mistake hatred of git for a hatred of all SCMs.

1

u/TheBuzzSaw Jun 20 '14

How often do you branch in your SVN projects? Git's branching is so good; it's not even funny.

1

u/[deleted] Jun 19 '14

What day-to-day action do you find hard to accomplish with Git? I'd love to hear an example of something that you do often enough to have this feeling about it.

→ More replies (3)

7

u/G_Morgan Jun 19 '14

I think the biggest issue with git is it is caught half way between describing things in svnish terms and just talking plain git.

4

u/vxsery Jun 19 '14

I think we all love git here, and we also agree its interface leaves something to be desired.

Its awesome that you wrote your own interface over it to suite your needs, and I encourage you to share your scripts with us less then halfway competent developers. :)

Be aware there are many different types of developers. Some like to hack and build their own tools that suite there needs, and Git is just another tool they can hack over and make their own.

Others want prepackaged solution and tools that just let them get to the work they are really trying to focus on. They prefer IDEs like VS, Eclipse, etc., over Emacs or Vi(m). Git fails miserably for the those on this end of the spectrum.

What tools one is comfortable with and how much one is willing to hack on something does not say anything about ones competency with writing production worthy software. It only says how much time one is willing to invest in a problem they feel should not have to solved individually.

1

u/rcxdude Jun 20 '14

See, I'm not actually sure how to change the interface (really, it's not all that arcane despite the jargon in the man pages). Honestly the only thing I feel is weird is the staging area, and perhaps some consistency between commands which list stuff. I use a GUI to view and browse the repo and the CLI to manipulate it. If I need to do something unusual or get an odd error message I google it (and I rarely need to now).

1

u/[deleted] Jun 19 '14

I only have scripts to update the presentation [like list all branches], I have a couple of others to help with movement too [gtop => move to top of git repo, bl @target => list all commits to a merge point].

As for actually writing to the repo I just use the git command.

24

u/[deleted] Jun 19 '14

This just about sums up my feelings about git, and I can't fathom why so many people's opinions fall so far on the other side of the spectrum.

7

u/cowinabadplace Jun 19 '14

It's just that there's a wider group of people on this forum than one would think.

There are half a million subscribers to this reddit, and a large fraction of them are at the point that they need simple stuff like "Big-O notation" explained to them, while some others are comfortable designing languages that advance the state of the field. There's a continuum between each extreme and we each perceive ourselves as the average.

2

u/loup-vaillant Jun 21 '14

This doesn't explain it all. The article this thread is about clearly comes from someone who understand Git deeply, yet still complains. To take another example, I know of someone who at some point understood C++98 quite deeply, yet still complained about it.

If the only people who complained about a tool are those who don't know how to use it, the problem is one of ignorance. But when power users complain, we have a strong hint that the problem lies with the tool.

-12

u/[deleted] Jun 19 '14

The problem is people get thoroughly lazy in their careers. Even in school they only study enough to pass their labs/exams and they don't care about the field at all.

I've had to build a few workstations for new hires and also do their Git training (we're a Git shop here) and a few things occurred to me

  1. Any competent software developer should be able to install their own Linux distro provided the names of servers/etc in our office.

  2. Any competent developer should know their way around Linux (bash/syslogs/etc) and be able to diagnose their own problems

  3. Any competent developer should be able to learn Git in a week or two. It's not that hard.

But reality is they learn just enough to do what their bosses tell them and make excuses for everything else.

7

u/abolishcopyright Jun 19 '14

Not all programming is part of someone's "career".

I spend the majority of my free time writing free software. I'm not lazy. Learning to use git (and use it well, and getting around its quirks) has been a big time sink. It could be much better. That would give me more time to be actually building software.

→ More replies (2)

11

u/kankyo Jun 19 '14

Expecting tools not to suck != lazy.

1

u/[deleted] Jun 19 '14

Are we still talking about Git?

→ More replies (1)

1

u/[deleted] Jun 19 '14

I have no idea why you are being down voted, bizarre. The last sentence is a little harsh, but other than that your comment seems pretty accurate.

-1

u/[deleted] Jun 19 '14

The hiring process should be looked at.

2

u/cpbills Jun 19 '14

Such a simple statement, but so fucking true.

The hiring process in most companies for technical people is FUBAR.

→ More replies (2)
→ More replies (2)

0

u/[deleted] Jun 19 '14

[deleted]

9

u/[deleted] Jun 19 '14

Ok let me rephrase that. You shouldn't need to drag a co-worker to your desk for basic bash command help like how to change directories or copy files.

And frankly any software developer in 2014 who doesn't have some experience with a Linux distro of some sort is really shooting themselves in the foot even if their now current job is on a Mac or Windows machine.

8

u/kkus Jun 19 '14

I am supposed to be the git guy where I am but I still recheck every thing twice if I ever need to type rebase. Sucks because I run git svn rebase all the time

3

u/[deleted] Jun 19 '14

I made an alias for git svn fetch and rebase. I called it git spull.

→ More replies (1)

1

u/[deleted] Jun 19 '14 edited Jun 19 '14

I disagree. Installation of, and knowing their way around, most operating systems are so well documented that anyone with an IQ that is above average should be able to do it. Some Border Collies can even install operating systems.

Edit: added ”and knowing their way around"

→ More replies (5)

15

u/huyvanbin Jun 19 '14

See, I think development tools should be pretty. If your job is to design an elegant, understandable software system, what does it say that your tools don't meet the same criteria? Were they made by worse developers than you are? Did they just not care enough? Etc. To me the Unix mentality just saps my energy every time I encounter it and makes me want to go do some woodworking or something else that doesn't make me face the accumulated stupidity (or indifference) of generations of programmers.

3

u/Crandom Jun 20 '14

The git model is elegant and understandable. It's just the UI that sucks.

1

u/[deleted] Jun 19 '14

The unix mentality is powerful if you know how to use it.

E.g. doing something like piping the output of grep through sed or awk to format some output is useful as opposed to waiting for a single binary program that does all of those random combinations.

The problem is we have a generation or two of "developers" who are nothing more than glorified script monkeys.

10

u/huyvanbin Jun 19 '14

I had a similar thread here and still feel a sufficiently bad taste to not want to rehash those arguments. But I'm not saying anything about the glories of piping grep to sed, I'm talking about things like inconsistent or unintuitive arguments. By your own admission git is not pretty and my argument is that this is a nontrivial flaw. There is a thing called The Unix Haters Handbook which probably makes these arguments more masterfully than I could.

2

u/[deleted] Jun 19 '14

Ya but "pretty" is relative. The way I have my .bashrc setup is probably different than yours. That's kinda the upside of the unix philosophy.

I mean unless you want to "OBEY" and have everyones workstation look exactly the same ala MacOS or Windows...

→ More replies (7)

5

u/abjuk Jun 19 '14

Any halfway competent developer should be able to master git in a couple of weeks

But that half competent developer can gain that same mastery of SVN in half an hour and get a couple of weeks of real work done.

3

u/stickcult Jun 19 '14

Maybe I'm just really biased and not looking at the right sources, but I disagree. I had to start using SVN for a job I started a month ago. I randomly got a tree conflict in a directory I never touched, I couldn't resolve it, and eventually said fuck it and deleted the repo and checked it out again. Also selectively committing files is a pain, and branching downright sucks.

Maybe it's because I miss the complexity of git, but I find git much easier than svn.

2

u/Houndie Jun 20 '14

Because SVN can't do as much.

→ More replies (1)

4

u/SoundOfOneHand Jun 19 '14

Git is a very powerful set of tools. It is fast and flexible.

Its UI is arcane and difficult to use compared to other SCMs. This includes both the native gitk and git gui tools, and even the Windows shell extension tools like Tortoise.

I didn't even know that git gui existed till the other day when a colleague showed it to me. I'd already been using it for over two months and read an entire book on git. I told the colleague about interactive add and he'd never heard about it. He has been using git for over two years. Individual user experiences vary widely due to its adherence to the unix philosophy of many small, independent tools. So it's not easy to understand all that's available and there are many ways to do the same task.

It is not difficult to fuck up a repo doing complex merges with rebase. It is not difficult to miss changes in a commit between the file system and the index. It is not difficult to inadvertently commit unwanted changes.

You need discipline to use git properly on any real-world project, you need to pay close attention to what you are doing, and you need to understand how the system works at a fairly low level.

There is nothing wrong with any one of these things but honestly they are not attributes I particularly want in an SCM. There is a lot I like about git but you can easily shoot yourself in the foot with it if you don't know what you're doing. This alone makes it a bad fit for many projects/teams, honestly.

0

u/[deleted] Jun 19 '14

run ... git .... status.

Honestly if your commits are missing files you need to go back to git basics...

I don't get what a "complex" merge ... Do you mean one with conflicts? Because conflicts happen in all SCMs. Merging in git is dead simple

 git merge [--no-ff] source_branch

I don't understand how that could be simpler. Heck if you do --no-ff merges you can undo the merge with git reset HEAD1 --hard and you're back to the state before the merge. Or you could do your merges into a new branch of your target and just throw away the new branch if it goes wrong.

You find it hard to use because you're not thinking like you're using git. You can always create a scratch branch to practice merges/rebase/etc into. None of those commands delete commit objects.

Heck I can do

 git checkout -b new
 git rm -f *
 git commit -am "fuck the world!"

And from there either do

 git reset HEAD~ --hard

or

 git checkout master
 git branch -D new

and I'm back to where I started

2

u/Guvante Jun 19 '14

Heck if you do --no-ff merges you can undo the merge with git reset HEAD^1 --hard and you're back to the state before the merge.

And why it can't it be just as easy when you don't do --no-ff?

If I am working somewhere where we do --no-ff exclusively and I was new so forgot to alias it require a bit of work and looking at several man pages to undo?

2

u/[deleted] Jun 19 '14

If you merge a branch that has > 1 commit on them you can't revert the merge without going back n-many commits.

--no-ff should be the default for all non-trivial merges (e.g. >1 commit) because it allows you to revert the merge easily.

4

u/Guvante Jun 19 '14

--no-ff should be the default for all non-trivial merges (e.g. >1 commit) because it allows you to revert the merge easily.

And this is an example of a fix that git could use to be more usable.

It is my understanding that most people want a GUI with changes like the OP is mentioning and a CLI with a few subtle ease of use changes like --no-ff being default and more sane force options. For instance git push -f being --force-with-lease instead of --force.

→ More replies (4)

2

u/cpbills Jun 19 '14

I picked this up somewhere recently, it seems to be a standard non-standard pair of aliases, provides a nice visualization on the CLI of your tree.

[alias]
  lol = log --graph --decorate --pretty=oneline --abbrev-commit             
  lola = log --graph --decorate --pretty=oneline --abbrev-commit --all

3

u/loup-vaillant Jun 20 '14

I guess I'm alone in finding git not that hard to use.

Actually, that's not the point of the article. The point is, git is harder than it should be.

Any halfway competent developer should be able to master git in a couple of weeks

And that is much too much time. I bet you could explain to a fellow developer the foundations of git (commits, DAG, merge…) in a few minutes, maybe an hour. This hours represents essential complexity.

On the other hand, by your own estimation, it would take weeks, to master the current interface. Let's be lenient, an make it days. Those days represent total complexity.

The conclusion is obvious: git's interface has much accidental complexity.


The point of the article is simple: in its current form, git is more complex and harder to learn than it could (and should) be. And that's by a wide margin. This article has convinced me that git can be made very easy to use. So easy that after a day of using a good interface, it would feel easier than subversion, even for hardcore Tortoise users.

Just apply Brett Victor's lessons to this revamped interface, and all will be well.

→ More replies (2)

1

u/dixieStates Jun 19 '14

No you're not alone. I use git from the command line with just a few locally defined aliases. I think of git in the same way that I think of *NIX in general: it is very user friendly, it is just damned particular about who it's friends are.

The only foray away from the command line is a half-hearted effort from time to time to use emacs' magit interface. I don't really need magit but I have a few friends who swear by it.

1

u/steveklabnik1 Jun 19 '14

You aren't alone. I always feel alone when I read these articles too.

→ More replies (3)

1

u/cabalamat Jun 19 '14

Any halfway competent developer should be able to master git in a couple of weeks

Yes, but they shouldn't have to, because it imposes cognitive load.

1

u/TheBuzzSaw Jun 21 '14

That "cognitive load" is nothing compared the amount required to deal with branches/marges with old tools.

1

u/loup-vaillant Jun 20 '14

I second that: git is more complex than it could be. The power it has doesn't justify its warts.

0

u/[deleted] Jun 19 '14

[deleted]

7

u/phySi0 Jun 20 '14

Actually, I picked up UNIX itself pretty quickly. Git is on a different level. I'm starting to get my head around some of it, but it's pretty weird and incomprehensible. To me, there's a big difference between how hard it is to learn Git and UNIX.

1

u/brtt3000 Jun 21 '14

I self-learned Git but finally 'got it' after I figured out the core of git is just a key-value database and blobs/trees/commits are just hashes of files, directories and fields, and branches and tags and such are just references to hashes.

Then the front layer are just operations you can do to manage these.

With this is sort of fell into place and then it was just understanding the operations you could do on that data.

-19

u/[deleted] Jun 19 '14

Honestly if you use it on a daily basis for a couple of weeks it's simple to use.

No true software developer (or hardware one for that matter) should be stumped by Git.

20

u/kankyo Jun 19 '14

The Right Thing should be easy. Dangerous things should be hard. Simple day-to-day operations should leave you in weird states for no obvious reason.

Git fails in this regard. I just found the subset of operations that I trust and never ever perform any operation outside that small list. Then I'm fine. That's not high praise for a tool imo.

2

u/cpbills Jun 19 '14

The Right Thing should be easy. Dangerous things should be hard.

A hammer is easily used to do dangerous things. Just because you want your tools to protect you from yourself doesn't mean that's the right approach.

git is a tool, and like all tools, there are right and wrong ways to use it. Learning how to use it prevents you from hurting yourself.

8

u/cjthomp Jun 19 '14

But a hammer isn't software. The person who builds a hammer can't also build in failsafes, checks, and safeguards.

That's kind of why software.

→ More replies (1)
→ More replies (1)

18

u/abolishcopyright Jun 19 '14

I'm not "stumped" but learning its interface is a time sink, and my time is valuable. I've been waiting for someone to write a smarter interface wrapper around it.

2

u/cpbills Jun 19 '14

The time saved in learning how to use git effectively more than makes up for the time spent learning how to use it.

In fact, you could probably replace 'git' in that sentence with ANY good tool.

→ More replies (12)

10

u/MrDOS Jun 19 '14

You are confusing the ability to write software with the ability to effectively use software. It is not a valid assumption that those who understand code can intuitively pick up any program they come across. I know a number of intelligent people who write solid code who are very bad at using new and unfamiliar interfaces.

→ More replies (7)

27

u/[deleted] Jun 19 '14

[removed] — view removed comment

7

u/oursland Jun 19 '14

This is not an instance of the No True Scottsman fallacy. For it to be so would require this to be an unreasoned assertion. I find it reasonable to believe that a professional programmer should be capable of learning and using the Git SCM.

→ More replies (9)

-2

u/[deleted] Jun 19 '14

Which is kinda how I prefer my tools because computers are not natural or intiuitive, they're unlike any other interface in the world. There's no need for it to be completely logical ;p

7

u/vanderZwan Jun 19 '14 edited Jun 20 '14

EDIT: I just realised the tone of my post is a bit harsh, my apologies. FWIW, I did not downvote you.

What does natural or intuitive have to do with things being logical and consistent?

"Natural" in the context of interface design usually refers to some implicit assumption that there is this foundational, embodied "truth" upon which we build our deeper understanding of the world, and that it is better to be closer to this foundational starting point. This is highly debatable (I'm not a fan of it myself), but let's not go there right now. Similarly, intuitive in practice tends to mean "like something the user is already familiar with," which makes something easier to approach edit: often at the cost of limiting how novel the idea being presented can be (as it is not free to be completely different).

The command line is not very natural, but compared to how interaction with computers worked before it was invented it definitely has 'intuitive' roots if we go by the definition I just used: it mixed the typewriter interface with the idea of engaging in a call-response dialogue with a machine, through either a line printer or later a computer screen (in a strange, unnatural language, but still). All concepts the user must have been familiar with before ever sitting down in front of a terminal.

Anyway, none of this has anything to do with whether or not the internal rules of an application are consistant to the point where you can predict functionality based on what you already know ("if combining a with c results in A, then combining b with c should result in B"). That improves discoverability, and that is a good thing for an interface to have, regardless of how natural or intuitive it otherwise is.

0

u/[deleted] Jun 19 '14

[deleted]

28

u/moor-GAYZ Jun 19 '14 edited Jun 19 '14

The set of things you can do with a repository is small enough

The set of things I need to do often, sure, is small enough.

But there's quite a long tail of things that I need to do rarely and have to look them up on the internet because they don't logically follow from anything I do day to day.

How do I delete remote commit tag? How do I make a branch tracking if I failed to do that initially? WTF is the difference between "tree-ish" and "commit-ish" and why does git archive use it to decide whether to use local or commit time when checking out?

That's not at all what the OP is concerned about by the way. They talk about reinventing several fundamental concepts of the interface, like embrace the fact that git repository is append-only (until gc runs) and make it truly append only, so that you always have access to the original commits that you rebased. Also automatically make WIP commits of the working copy before any git operations that can affect it -- I would actually go even further and say that these commits should be fully automatic and continuous, basically I want a persistent undo tree which I can tag as I work and then, after I'm done, arrange my changes into changesets that go to the public history.

7

u/[deleted] Jun 19 '14

I would actually go even further and say that these commits should be fully automatic and continuous

Holy shit! No dude! I don't want it to do that.

Git is a system level tool; not a note taking application.

8

u/moor-GAYZ Jun 19 '14

Holy shit! No dude! I don't want it to do that.

Git is a system level tool; not a note taking application.

You mean, it should be uncomfortable, hard to use, unforgiving, and require constant attention to minor details, to build character and turns smooth-cheeked youths, those who survived the hardships that is, into grizzly grey-bearded veterans?

10

u/[deleted] Jun 19 '14

It should not do things on its own or make assumptions about your workflow.

5

u/masklinn Jun 19 '14 edited Jun 19 '14

It obviously disagrees with you since git pull exists and the only way to coerce rebase -i in letting you rewrite the history without rebasing is arcane and inane (and may fail and end up trying to rebase your whole history on top of whoever the fuck knows what)

→ More replies (1)

8

u/moor-GAYZ Jun 19 '14

Is Vim a pussy note taking app because it puts all your actions into the undo tree automatically?

The only thing that doesn't make assumptions about your workflow is a pile of sand. Everything else is valuable precisely because it introduces structure, and structure by definition means excluding some workflows.

→ More replies (14)

7

u/[deleted] Jun 19 '14

How do I delete remote commit?

You don't. That was easy :-)

How do I make a branch tracking if I failed to do that initially?

Git literally tells you this:

fatal: The current branch fake has no upstream branch.
To push the current branch and set the remote as upstream, use

     git push --set-upstream origin fake

etc...

11

u/moor-GAYZ Jun 19 '14

How do I delete remote commit?

Oops, I meant remote tag. I even more or less remember it by now, it's something like git push :/refs/tags/<tag>. It doesn't make much sense to me, but whatever.

Git literally tells you this:

... if I try to push. Just making a branch tracking is more involved.

And to answer my third question, apparently a "tree-ish" that's definitely not a "commit-ish" should have the form <commit-ish>:<path>, where path can be empty if you want to get a snapshot of the entire repository. This is folk wisdom propagating through forums and stackoverflow, by the way, at least I've never seen anything like that in the FM.

3

u/[deleted] Jun 19 '14

Oops, I meant remote tag

You shouldn't do that either. If someone had pulled that tag down they won't notice you deleted it. They'll forever have the older copy of the tag. (which I admit is a failing in Git).

2

u/moor-GAYZ Jun 19 '14

I'm doing that to then point the tag at a different commit, so that's OK, I think.

→ More replies (5)
→ More replies (1)

10

u/[deleted] Jun 19 '14

If that's all you do with git, than you're very far from any kind of "mastery" over git.

Tell me how to do this simple thing: View what hasn't been pushed yet.

The internet is full of answers to that question, and none of them actually work. And that's what makes git difficult.

I work with git all day, and the simple things are simple. But many other things that should be simple, aren't.

6

u/Peaker Jun 19 '14

View what hasn't been pushed yet.

If it's for a single given branch, it's a simple log:

git fetch <remote>
git log <remote>/<name>..<name>

Shows commits in <name> that are not yet pushed into <remote>/<name>.

3

u/[deleted] Jun 19 '14

diff (local) branch with remote/branch?

4

u/Peaker Jun 19 '14

Ideally log, and not diff.

4

u/rwilcox Jun 19 '14

View what hasn't been pushed yet.

Good lords of Kobol, yes. I needed this the other day and just gave up. (Paid the price for my hubris too... ended up f'ing up the remote something bad. Thankfully it was late enough at night that a git reset and force push fixed it... couldn't imagine the mess if it had been during work hours...)

0

u/[deleted] Jun 19 '14

[deleted]

4

u/[deleted] Jun 19 '14 edited Jun 19 '14

What you want is the differences between the local and remote branch

No, what I want is to see what I haven't pushed yet. In all branches. git log <remote>..<local> doesn't allow me to do that. Don't tell me that I want something different. This isn't a matter of having the wrong view. Local changes may exist that I forgot about because git let's you work on so many things at same time with ease. I need to know what local commits I've made so that I can put them in a remote location so that when my house burns down I won't lose all my work. I need to know that I can safely rm -rf a clone without losing work.

Currently, the only way to do that is to do an actual git push, and then still it's not garantueed to push everything I've committed locally .

→ More replies (1)

-3

u/[deleted] Jun 19 '14

The other thing I find unfortunate is how many people assume that the GUI tools are a good idea. I like using gitk/gitg to visualize branches but that's about it. I train staff here to only do writeable commands via the command line (e.g. merges/tags/branches/etc).

Along with that the amount of people who seem to think that you need a github account to use git ...

13

u/[deleted] Jun 19 '14

I use TortoiseGit all the time. Tell me, why is that bad?

1

u/TheBuzzSaw Jun 20 '14

It depends on the tool. I have personal beef with TortoiseGit (mainly for issues relating to locking folders/files on me), but if it helps you with your workflow, that's great.

SmartGit makes me mad because it redefines all terminology. That's fine for someone who knows both the CLI and SmartGit, but when interfacing with someone who uses SmartGit exclusively, it's a royal pain. I cannot tell him to "checkout a branch"; SG has a Switch Branch button. I cannot tell him to "add" anything; SG calls it staging. I cannot tell him to "reset"; SG calls it discard.

-1

u/[deleted] Jun 19 '14

For starters it's not obvious what branch you are on looking at a folder in a file manager.

On my command line I print out the branch I'm on with a couple of flags for things like unstaged changes, stashes, etc...

5

u/[deleted] Jun 19 '14

I don't have any branches. So now what?

→ More replies (13)

10

u/kankyo Jun 19 '14

It's "git" not "GIT". Might want to change that.

5

u/ccharles Jun 19 '14

The proper noun is Git. The command-line tool is git. GIT is nothing (in this context).

-2

u/crazedgremlin Jun 19 '14

I was actually wondering what Gee-Eye-Tee was when I started reading.

2

u/[deleted] Jun 19 '14

I had something like this that I've wanted to do for a while. Glad someone else actually did.

1

u/usernamenottaken Jun 19 '14

Well they wrote about it, they haven't actually done it as far as I can tell.

1

u/[deleted] Jun 20 '14

Well he's but further along than I am

2

u/brtt3000 Jun 19 '14

TortoiseGIT does a lot of this and it rocks. Nice thing is that it doesn't change paradigms so you still learn the proper terms and usage, only from convenient GUI's.

3

u/warbiscuit Jun 19 '14

Should mention TortoiseGIT is Windows-only :(

What git needs is a uniform cross-platform gui which can be invoked for single-use actions from a context menu OR the cmdline.

3

u/tonsky Jun 19 '14

Can you give some examples of what (from the article) TortoiseGIT can do? From screenshots I see it’s pretty ordinary GIT clients — just a nice graphical wrapper for the same command-line philosophy

5

u/SoundOfOneHand Jun 19 '14

It's great until you need to do something unusual or complicated or someone just sends you how to do it on the command line and it all boils down to being unable to figure out how to get Tortoise to do the exact same thing...

Nothing compares to the Tortoise Hg Workbench for DSCM systems, overall. Everything in one place, unambiguous, at-a-glance. Would really love to see a unified UI for git like this, but I'm not sure it's possible.

2

u/brtt3000 Jun 19 '14

Eh? TortoiseGIT work fine together with commandline git (it even shows the commands it runs when using the GUI so it easy to learn basic git with it)

I occasionaly do CLI for advanced stuff (eg: pasting shit from stackoverflow :). But for my daily tasks the GUI works excellent.

1

u/gauiis Jun 21 '14

I used to use TortoiseGit but then I stumbled upon SmartGit, I haven't looked back since then. Although I'm fairly comfortable with the CLI so I mainly use the "Conflict Solver" in SmartGit, it's awesome.

1

u/brtt3000 Jun 21 '14

Looks pretty good, the Github PR integration is very attractive.

Very pricey though.. 100 euro with the addons (no support)... that's steep compared to TortoiseGit's + Github's zero dollar price.

1

u/Denvercoder8 Jun 19 '14

His model seems to lose the ability to commit part of your working tree. That's one of the biggest reasons I'm using git, and thus makes this hypothetical redesign completely useless.

3

u/Peaker Jun 19 '14

He does mention the staging area, using (iiuc) a split of the WIP commit.

1

u/Denvercoder8 Jun 19 '14

Yeah, but splitting your changes afterwards seems a lot harder than adding only what you need on the go.

2

u/Peaker Jun 19 '14

The split is the add operation itself. You don't have to do it after the fact. You can do exactly the same add operations on the staging area even if it is represented by a commit.

1

u/gauiis Jun 21 '14

I introduced Git to my team, them coming from TFS. The shift was very hard at first, but in the end it forced us to use a better workflow. Before with TFS you had no idea what you were merging, because you always merge on a file level. But now you eather cherry-pick a commit or merge feature branches, and you always know exactly what you're merging. We love it.

There are some who absolutely despise the CLI and don't want anything to do with it. Then we stumbled upon SmartGit and they have been happy ever since. Me myself am fairly comfortable with the CLI, but I love the Conflict Solver and visual representation in SmartGit. It's awesome. Check it out.

1

u/javistitch Jul 02 '14 edited Jul 02 '14

I guess this is just a human UI alternative proposal right? I doubt a lot that any other kind of interfaces may profit from these. Like for example, continuous integration systems. Believe it or not, git is used by machines too, and they usually don't like using web browsers...

Also, some of the proposals may make sense, some others should be optional. For example, layout coloring by author? Believe it or not too, lots of people use git by themselves, with no collaborators, so coloring by author makes no sense.

Automatic syncing of branches to remotes? Perhaps, but sometimes branches are just local ones made for the sole purpose of testing things. Why on earth would you wish to sync them to remotes automatically?

-3

u/deadstone Jun 19 '14

The constant "he"s referring to the viewer got annoying quickly.

5

u/thedeemon Jun 19 '14

That comes from author's native tongue - Russian.

0

u/TheStonehead Jun 20 '14

My own two cents to the story. I found svn and tfs much nicer to work with than git. I've been using it for two months at work now and I understood the basics after a few days (and a few sizeable articles explaining how it works) while svn and tfs were understandable within an hour - tops.

Local repostitory thing is kinda cool and there are a few nice features other SCMs could adopt, but overall it's a beast to tackle. I don't want to tackle beasts, I just want to save some of my code. Tree structure is much easier to understand and manipulate than graph structure.

You can call me lazy and stupid all you want, and you're probably correct. ^

-2

u/[deleted] Jun 19 '14

The interface of git is the way it is for a reason; it was built specifically for the linux kernel project and when used there, git is commonly wrapped in bash scripts that automate and hide away many of the complexities.

3

u/tonsky Jun 19 '14

Yes, it’s a shame lot of other people started to use it too :(

-10

u/[deleted] Jun 19 '14

No, git's interface is not that complicated. If you think it is, that might be due to the first impression effect.

You just need a small shift in perspective.

Understand: git is a system-level tool. Treat it as you treat your programming language.

If your team members can't understand git, it's as if they don't understand the language they're using. They just need to work on it.

Honestly git is not that hard to understand and not that hard to use.

Get over it.

3

u/tonsky Jun 19 '14

If Git was a programming language, it would’ve been Bash. And Bash is really shitty as a programming language.

4

u/softwaredev Jun 19 '14

Git over it

1

u/ggtsu_00 Jun 19 '14

Git good or die trying.