Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Gazpacho posted:

I think the point is that if the tools are not loving up other people's systems but are loving up yours that points to a particular cause other than the tools.

Macports and fink legitimately destroy systems. Homebrew is better, but only because it does less. I do all my development now on 'disposable' vms. Vagrant helps

Adbot
ADBOT LOVES YOU

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

JetsGuy posted:

Anyway, after a quick look at the git website, it seems like it's a standalone version control program. Is this true? Is it any good?
All your questions can be answered here. Here's a summary: "git is awesome, git is good, please use git like all coders should. mercurial is cool too."

PrBacterio
Jul 19, 2000

Jethro posted:

All your questions can be answered here. Here's a summary: "git is awesome, git is good, please use git like all coders should. mercurial is cool too."
I was just going to say. At my place of work we're using SVN, but I've (and only recently, too!) started using Mercurial for all of my private projects that I do at home, and I must say that it really is quite awesome. But the choice (in my case) for Mercurial over git was really quite arbitrary, due to my having it recommended by someone I know; if he had been a git user I'm sure it'd be git I'd be using now for that purpose :geno:

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.
I finally got my work to switch to git from CVS and holy loving poo poo I forgot how much I hate CVS.

Git is the loving tits. Use it, forever, on everything. :aaa:

Unfortunately, now I've got like 30 old branches stored in separate folders that would be a pain to move into the new repo.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

the talent deficit posted:

Macports and fink legitimately destroy systems.

I'm not an expert, but how can Macports screw up a system? My understanding was it stages everything to its own directory structure and builds everything (including most dependencies) from scratch. That seems pretty self-contained.

Internet Janitor fucked around with this message at 18:02 on Apr 17, 2013

Thern
Aug 12, 2006

Say Hello To My Little Friend

PrBacterio posted:

I was just going to say. At my place of work we're using SVN, but I've (and only recently, too!) started using Mercurial for all of my private projects that I do at home, and I must say that it really is quite awesome. But the choice (in my case) for Mercurial over git was really quite arbitrary, due to my having it recommended by someone I know; if he had been a git user I'm sure it'd be git I'd be using now for that purpose :geno:

The cool thing about git, and I don't know if Mercurial has this, is the use of git-svn for if you are stuck in a place that uses SVN.

Checkout with git-svn, use git for your normal workflow, and then use git-svn to push the changes back to SVN.

OnceIWasAnOstrich
Jul 22, 2006

Internet Janitor posted:

I'm not an expert, but how can Macports screw up a system? My understanding was it stages everything to its own directory structure and builds everything (including most dependencies) from scratch. That seems pretty self-contained.

Whenever people complain about it (or Homebrew) breaking something it is almost always because they don't really understand PATH and they now have multiple non-compatible versions of libraries or binaries where the macports version won't work with the system version and you start getting obtuse error messages. You can almost always solve this by nuking the folders Homebrew/Macports install to and trying again. Homebrew is a little better about this because it refuses to run as su or perform any operations outside its configured directory. This leads to problems when you have things that only work with one or the other or only with 32/64 bit versions of libraries and suddenly you have to start caring about the multiple libraries you have installed in different places, without any decent tools for dealing with it.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
Microsoft even built support for Git into TFS2012. You can use Git for your source control, but still leverage all of the other TFS features, integrated nicely into the VS UI.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I apologize. My previous comment was too much like "Linux community support" sperging and not the right approach.

kitten smoothie
Dec 29, 2001

the talent deficit posted:

Macports and fink legitimately destroy systems. Homebrew is better, but only because it does less. I do all my development now on 'disposable' vms. Vagrant helps

This. Once you can checkin your project's entire environment config into git along with the source code and can stupidly easily spin up a VM with all your dependencies, it's amazingly liberating.

I decided to wipe & reinstall my Mac when I got an SSD and it surprised me how much I really needed to "back up" anymore, really just my photos and music. My development work is all in Github or Bitbucket and I can quickly clone it and be back off to the races with a "vagrant up."

ChickenOfTomorrow
Nov 11, 2012

god damn it, you've got to be kind

I clearly don't understand git.

Probably because I'm using git-gui, but every time I restore my VM I find it's less hassle to just download a zip of my projects from github and replace the files on my VM (then do a force merge with github before I continue with any changes) than it is to try to get git-gui to do the equivalent of what the GitHub client for Windows & Mac calls "sync" (i.e. fetch the newest versions of everything from github).

Obv, I don't understand git because I'm a retard.

Zamujasa
Oct 27, 2010



Bread Liar

ChickenOfTomorrow posted:

I clearly don't understand git.

Probably because I'm using git-gui, but every time I restore my VM I find it's less hassle to just download a zip of my projects from github and replace the files on my VM (then do a force merge with github before I continue with any changes) than it is to try to get git-gui to do the equivalent of what the GitHub client for Windows & Mac calls "sync" (i.e. fetch the newest versions of everything from github).

Obv, I don't understand git because I'm a retard.

I just use $ git pull --all :downs:


I think the problem here might be git-gui.

Arcsech
Aug 5, 2008

ChickenOfTomorrow posted:

I clearly don't understand git.

Zamujasa posted:

I just use $ git pull --all :downs:


I think the problem here might be git-gui.

The problem is git-gui. Some developer on it has a stick up their butt and refuses to put git pull into the GUI, which is (as far as I know) what the GitHub client does when you hit sync, instead forcing everyone to use git fetch origin; git merge origin/master, which is the same thing in almost every case but is more philosophically pure or something.

Atlassian SourceTree is the best git GUI I've found by far (but is only win/mac, no linux sadly), and git-gui is rather terrible.

Edit: the coding horror is programmers. All of us.

Arcsech fucked around with this message at 20:04 on Apr 17, 2013

ChickenOfTomorrow
Nov 11, 2012

god damn it, you've got to be kind

Arcsech posted:

The problem is git-gui. Some developer on it has a stick up their butt and refuses to put git pull into the GUI, which is (as far as I know) what the GitHub client does when you hit sync, instead forcing everyone to use git fetch origin; git merge origin/master, which is the same thing in almost every case but is less philosophically pure or something.

Jesus Christ. This sort of crap is why I hate *nix neckbeards.

Doctor w-rw-rw-
Jun 24, 2008
And people like me. I always git fetch --all then git rebase origin/master master.

On the upside, fetch works great with SourceTree since it updates the entire repo without affecting the checkout, and the rebase makes the commit graph cleaner.

Opinion Haver
Apr 9, 2007

Doctor w-rw-rw- posted:

And people like me. I always git fetch --all then git rebase origin/master master.

So, git pull --rebase?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

yaoi prophet posted:

So, git pull --rebase?

If you have master based on origin/master and you do "git pull" or "git pull --rebase", it doesn't actually update the origin/master ref, which I found confusing.

Presto
Nov 22, 2002

Keep calm and Harry on.

Sailor_Spoon posted:

Also, git is the best.
Git is a torture device invented by Linus Torvalds because he secretly hates programmers. :colbert: (I hate git.)

ToxicFrog
Apr 26, 2008


Thern posted:

The cool thing about git, and I don't know if Mercurial has this, is the use of git-svn for if you are stuck in a place that uses SVN.

Checkout with git-svn, use git for your normal workflow, and then use git-svn to push the changes back to SVN.

There's also git-cvs if you're stuck someplace that still hasn't heard of SVN, and git-p4 if you're using Perforce.

My new job uses P4, but using git on top of that is officially supported. :woop: I'm actually finding that the combination of git for local development, with p4-backed collaboration tools for code review and annotation, to be better than either VCS on its own.

evensevenone posted:

branch isn't too bad, except that you have to checkout the branch you just made for some reason.

However add/reset, fetch/pull, checkout and rebase are pretty badly named. Which are also the ones you use the most.

Rebase makes perfect sense to me, and I think at least some of the confusion around reset and checkout (and revert) is because they have the same name as commands in SVN but do different things.

That said, it certainly doesn't help that some of them seem to have multiple largely unrelated (from the user's perspective) uses. git reset is used to unstage uncommitted changes from the index and restage changes from a previous commit without touching the working tree and move HEAD around (and optionally adjust the index, working tree, or both to match the new HEAD). git checkout is used to switch branches and switch a commit without a branch and revert files in the working tree to the state they had in a previous commit or in HEAD (and has the same name as a totally unrelated SVN command). git rebase is used not to just graft branches to different points on the commit tree, but also do hardcore interactive history rewriting. Some of these make sense once you know how things work internally, but I'm not convinced all of them do.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Suspicious Dish posted:

If you have master based on origin/master and you do "git pull" or "git pull --rebase", it doesn't actually update the origin/master ref, which I found confusing.

Bare git pull does update all remote tracking branches for the remote that you're pulling from. It's git pull origin master that doesn't update the ref.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Lysidas posted:

Bare git pull does update all remote tracking branches for the remote that you're pulling from. It's git pull origin master that doesn't update the ref.

Aha, I second guessed myself because I thought what I said was more plausible. I still really don't understand it, but OK.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Doctor w-rw-rw- posted:

And people like me. I always git fetch --all then git rebase origin/master master.

I do this too, but mostly because I usually don't want to merge right now but I still want those patches, not because I oppose the philosophical impurity of using git pull or whatever. :spergin::hf::reject::coffee:

Volmarias fucked around with this message at 00:51 on Apr 18, 2013

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Thanks for mentioning SourceTree; we've been using the default Windows client just ... just because really. And SourceTree is already worlds ahead I think.

Tetraptous
Nov 11, 2004

Dynamic instability during transition.
Mercurial is mostly the same as git, especially if you include extensions, and is maybe a little easier to learn. I like it.

As for Mac package management systems, after playing with all if them, I really do think MacPorts is the most mature and Brew the least. I like that Fink and MacPorts dump their stuff into special directories that you can remove with rm. Neither can break your system unless you configure them in a really weird and non-default way! For the most part, Macports only breaks itself when Apple updates the OS/Xcode. I don't like how Brew throws stuff into /usr/. Other stuff defaults to the same place.

Captain Capacitor
Jan 21, 2008

The code you say?
I've mostly gotten used to git, but I still have to consult the progit book to remind myself how to do certain things.

Mercurial subrepos are a billion times better than git submodules, though. Submodules can go gently caress themselves.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Doctor w-rw-rw- posted:

Checkout is checkout.
This is precisely why it *is* confusing. Checkout means different things to different people. I'm not saying git can be perfectly usable once you know its quirks, but already there's been a page of discussion about all the various commands and so on. I don't think you can claim it is easy.

(though SourceTree makes it a joy to use)

Hughlander
May 11, 2005

Sagacity posted:

This is precisely why it *is* confusing. Checkout means different things to different people. I'm not saying git can be perfectly usable once you know its quirks, but already there's been a page of discussion about all the various commands and so on. I don't think you can claim it is easy.

(though SourceTree makes it a joy to use)

Yah, I'm a bit baffled by the quote. "The commands literally could not be expressed simpler, in my mind" Really? There's no simpler way to express source control concepts than to have the same command mean "create a new branch" "Switch to a different branch" and "Reset this changed file"? If you have an intimate knowledge of the reflog why they're the same command makes sense, but even then I wouldn't say that checkout is the literally the simplest way they can be expressed.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Checkout is kind weird and it seems that it's had some random stuff grafted on to it just because it can.

If all it did was switch to an existing branch/revision/tag/whatever it would make a lot of sense. But it's got random stuff like the -b flag that causes people to learn "this is how you create a branch", which then makes the whole thing make little sense. It would be much better if git-branch had a -c flag or something that said "Also checkout the branch you just created".

The -p flag has a similar issue, really.

Hughlander
May 11, 2005

Jabor posted:

Checkout is kind weird and it seems that it's had some random stuff grafted on to it just because it can.

If all it did was switch to an existing branch/revision/tag/whatever it would make a lot of sense. But it's got random stuff like the -b flag that causes people to learn "this is how you create a branch", which then makes the whole thing make little sense. It would be much better if git-branch had a -c flag or something that said "Also checkout the branch you just created".

The -p flag has a similar issue, really.

I was just thinking of it in terms of explaining git to someone who used p4 before the conversation would be roughly:

"How do I make a new client-spec? Checkout. Ok, how do I swap from one to another? Checkout. Ok, how do I revert a file? Checkout."

Doctor w-rw-rw-
Jun 24, 2008

Hughlander posted:

Yah, I'm a bit baffled by the quote. "The commands literally could not be expressed simpler, in my mind" Really? There's no simpler way to express source control concepts than to have the same command mean "create a new branch" "Switch to a different branch" and "Reset this changed file"? If you have an intimate knowledge of the reflog why they're the same command makes sense, but even then I wouldn't say that checkout is the literally the simplest way they can be expressed.

But git branch creates a branch. git checkout -b does a git branch then checks out a ref. I create branches with git branch, so according to my usage they are not redundant. Git checkout -b is a shortcut to do two things. One of those things is a checkout, one of those things is a branch. As for "switch to a different branch" and "reset this changed file", those aren't basic operations. Branches are a layer of abstraction on top of Git. Branches are just labels to parts of the DAG, where each node reflects the state of the codebase. The checkout command is a tool to read a node on the DAG and transition the working copy to that state. If you apply it to a file, it applies it to just that file.

tl;dr: I don't create branches with git checkout, and both /switching branches/ and /resetting a file/ are the same thing - resetting state to a commit - but different in scope.

evensevenone posted:

Yeah the real problem is that git commands have no particular relationship to what one would reasonably assume that they do based on their names, or what those commands do on other vcs.

evensevenone posted:

branch isn't too bad, except that you have to checkout the branch you just made for some reason.

However add/reset, fetch/pull, checkout and rebase are pretty badly named. Which are also the ones you use the most.
My original post was a response to the above. My point was that given an understanding of Git's data model, all of the commands are IMO completely intuitive, and their names aren't misleading. Given an understanding of Git's data model. SVN, Perforce, and Mercurial are all delta-storage version control systems. Git is a version control system using DAG-based content storage[1]. Mercurial is simpler given a shallow understanding of your tools[2], but Git is intuitive if you actually learn Git rather than understand something else and try to adapt your understanding of Git to that world.

[1]http://www.slideshare.net/chacon/getting-git, slide 67
[2]http://mercurial.selenic.com/wiki/GitConcepts - Git's words not mine, but I used hg for quite some time before I switched to git, and I agree

EDIT: clarity, spelling

Also, are we getting off-topic, or are we agan indulging in the "we are the horror" cycle? Though, frankly, the idea of most people using Git actually cargo-culting based off of some other DVCS instead of learning how it works is a horror.

Doctor w-rw-rw- fucked around with this message at 03:05 on Apr 19, 2013

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Welcome to the Unix command line.

Doctor w-rw-rw-
Jun 24, 2008

Gazpacho posted:

Welcome to the Unix command line.

gently caress. You just put that in perspective for me. I'm too young to die become a neckbeard! :qq:

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Doctor w-rw-rw- posted:

Also, are we getting off-topic, or are we agan indulging in the "we are the horror" cycle? Though, frankly, the idea of most people using Git actually cargo-culting based off of some other DVCS instead of learning how it works is a horror.
It's one thing when ti's a non-technical user forced to use git, but I'm amazed by how many developers there are that use git on a daily basis yet don't bother to learn anything at all about it. The core concepts behind it are pretty astonishingly simple; there's a reason why it only took a week to become self-hosting and two months to be good enough for the linux kernel.

ChickenOfTomorrow
Nov 11, 2012

god damn it, you've got to be kind

Plorkyeran posted:

I'm amazed by how many developers there are that use git on a daily basis yet don't bother to learn anything at all about it

Some of us write PHP, all right :colbert: :colbert: :colbert:

evensevenone
May 12, 2001
Glass is a solid.

Doctor w-rw-rw- posted:

Mercurial is simpler given a shallow understanding of your tools[2], but Git is intuitive if you actually learn Git rather than understand something else and try to adapt your understanding of Git to that world.

This is kind of the opposite of what the word "intuitive" means.

Anyway, I like git, I use it both for work and personal projects. My employer's git workflow works really well for us and mixes well with . And I agree with you, to use it you have to understand the underlying data model and what each of the commands does to that underlying model.

All I am saying is that the commands have lovely names that give terribly poor indications of what they do, the documentation is pretty bad, and the commands are poorly segregated and have overlapping functionality. If you aren't pretty experienced at git, even if you know exactly what you want to do in terms of the data model, it can be a struggle to figure out what you need to do make that happen. That is entirely symptomatic of a poor interface.

Presto
Nov 22, 2002

Keep calm and Harry on.

Doctor w-rw-rw- posted:

Though, frankly, the idea of most people using Git actually cargo-culting based off of some other DVCS instead of learning how it works is a horror.
The problem is that I've tried to learn how it works. We had tutorial meetings about it at work. I've read all the sites. But there's just something about it that I just. don't. get.

The other problem is that it's insidious. Every time I think I finally have a handle on it, it does something that I can't fathom. "OK, I'll just do a pull here and... wait, how can I have a merge conflict in a file that I haven't loving touched?" And if you gently caress something up with git, then God help you. We used to use CVS, and yeah, it's primitive; but if something got trashed at least I could fix it manually if I had to. :( Now my work computer is littered with directories called things like "wtf.git", "git.poo poo", and "fuckyougit" because usually it's just easier to clone the repository again and start over than to figure out how to undo whatever just happened because I cast the wrong git spell. Not to mention the commits I have with a comment like "WTF just happened?"

Right now I just have a series of commands that I follow that I don't really understand, but that do what I want. Hooray for cargo cult revision control!

shrughes
Oct 11, 2008

(call/cc call/cc)
How the gently caress do you gently caress stuff up with git? What the gently caress is wrong with you? I never hosed poo poo up with git. Why? I don't know, maybe it's because I don't rebase? I'm basically a complete git noob, all I know is push, push -u origin branch, pull, commit -am, checkout -b, log -10, and help.

You're not going to get a merge conflict in a file you haven't touched unless you're doing something extremely loving stupid. You should either quit computers or bomb your coworkers.

(USER WAS PUT ON PROBATION FOR THIS POST)

Progressive JPEG
Feb 19, 2003

Sorry that you don't care enough to learn your tools?

Git's pretty good about not throwing away your data even when you screw things up. See eg reflog.

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Unless you do some kind of weird `git reset --hard` or use `git checkout .` (bad idea) it is kinda tough to lose stuff in git. The fact that you can use git stash/git stash apply to save your work is also pretty useful

Learning git does take some time. Essentially I learned commands as I needed to figure them out. I still have to look up a lot of things though because its a pain to memorize some of the syntax.

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Progressive JPEG posted:

Sorry that you don't care enough to learn your tools?

Git's pretty good about not throwing away your data even when you screw things up. See eg reflog.

Yeah, I was going to post this. Reflog is great; unless you go into the .git directory and physically mess something up, it's pretty hard to get into a state you can't get out of using reflogs to check out a good state.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply