Page 1 of 2

1597: "Git"

Posted: Fri Oct 30, 2015 6:06 am UTC
by Eternal Density
Image
"If that doesn't fix it, git.txt contains the phone number of a friend of mine who understands git. Just wait through a few minutes of 'It's really pretty simple, just think of branches as...' and eventually you'll learn the commands that will fix everything."

I can confirm that this is entirely correct, from two workplaces that have used Git.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 7:56 am UTC
by m.alessandrini
At last!
It was time someone authoritative told it!

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 8:32 am UTC
by orthogon
But is his friend a Rebaser or a Mergeist? You don't want to accidentally fall in with the wrong faction.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 8:49 am UTC
by sfmans
Most people don't realise that git is a write-only repository.

By the time you've found the branch you're after, you would have been better using that time to rewrite the code anyway. The average git repository, despite everyone's initial best intentions, makes a large corporate AD schema look like a model of clarity in comparison.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 9:38 am UTC
by Neil_Boekend
sfmans wrote:Most people don't realise that git is a write-only repository.

By the time you've found the branch you're after, you would have been better using that time to rewrite the code anyway. The average git repository, despite everyone's initial best intentions, makes a large corporate AD schema look like a model of clarity in comparison.

Does it need a dedicated WOM?

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 10:31 am UTC
by Xenomortis
This is not an inaccurate representation of my workplace.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 10:43 am UTC
by sfmans
Neil_Boekend wrote:Does it need a dedicated WOM?


Thank you, I'd not come across WOM before. Favourite new acquisition of the day :)

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 10:46 am UTC
by NTN
Have you tried to do anything with multiple people without git? I have, and I'm definitely not doing it again.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 11:31 am UTC
by cellocgw
Eternal Density wrote:
I can confirm that this is entirely correct, from two workplaces that have used Git.


Heck, I can confirm this is entirely correct for PTC Integrity and PLM too :( :(

Next, we can discuss how to delete backup files from TimeMachine if you don't want to "enter" the TimeMachine app. :twisted:

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 11:33 am UTC
by cellocgw
Neil_Boekend wrote:
sfmans wrote:Most people don't realise that git is a write-only repository.

By the time you've found the branch you're after, you would have been better using that time to rewrite the code anyway. The average git repository, despite everyone's initial best intentions, makes a large corporate AD schema look like a model of clarity in comparison.

Does it need a dedicated WOM?


Oh, like This One . True story, revealing my age: one of my undergrad Physics profs gave us photocopies of the original datasheet. This was back when a video terminal was sharp new stuff, along w/ our PDP-11.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 12:05 pm UTC
by rmsgrey
My experience with Git has been that it's a great way to find out which bits of the code are being overworked - most of the time, branches merge without difficulty, except when two or more people have been messing with the same chunk of code for different purposes...

Though, yeah, for most purposes, it's just a more automated replacement for renaming existing files with dummy extensions and then working on a new copy - most of the time, you're just working with a backed-up stable version and a currently developing version...

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 1:11 pm UTC
by mousewiz
The tar one I could not relate to, as it's not hard to memorize the few commands that I actually use.

This comic, though, describes my understanding of git perfectly.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 1:33 pm UTC
by ahammel
Hmm, I guess I'm the only one who absolutely loves it. Maybe that's my phone number in that text file.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 2:06 pm UTC
by geniekid
This comic resonates so strongly with me haha. Git is one of those things that's super powerful but takes a long time to learn because you use 95% of its functionality 1% of the time. :lol:

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 2:12 pm UTC
by Kit.
Does anyone have a link describing that "beautiful distributed graph theory tree model"?

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 2:18 pm UTC
by Archgeek
NTN wrote:Have you tried to do anything with multiple people without git? I have, and I'm definitely not doing it again.

Yup. Drive is a nightmare, Dropbox is weirdly unreliable, and SVN works out alright, just don't ask me how to properly merge a branch to the trunk using the actual branch merging tools.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 2:59 pm UTC
by tbc
YIL git add -p:
Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.

This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See "Interactive mode" for details.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 3:29 pm UTC
by sbkp
cellocgw wrote:Oh, like This One . True story, revealing my age: one of my undergrad Physics profs gave us photocopies of the original datasheet. This was back when a video terminal was sharp new stuff, along w/ our PDP-11.


I used to work a couple of blocks from Signetics. I had no idea they were up to such advanced stuff!

I've never used Git (was always partial to Perforce), but we are transitioning to it at work. Occasionally I write something in Perl. Given Perl's reputation as a write-only language, if I check one of these into Git, is it kind of like crossing the streams?

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 4:15 pm UTC
by rmsgrey
Last time I used Git, it was with the Tortoise front end, which made it pretty painless.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 5:51 pm UTC
by asaz989
Kit. wrote:Does anyone have a link describing that "beautiful distributed graph theory tree model"?


First read this page.

Then read this one.

Then this whole chapter.

And that should do it!

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 7:29 pm UTC
by felltir
The temptation to perform the alt text of the comic on this thread is pretty high.

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 9:42 pm UTC
by Cousj001
This is probably one of my all-time favourites. So, so true. I am sure there is a simple way of dealing with merge conflicts that I don't know. I just commit; push and pull to Github; and occasionally create branches. Doing anything else...

Code: Select all

$ man git
$ man man
$ man git
$ git -i -b sommat helpme @aaaaaaaaaaah
$ shutdown -brain -now
$ sudo shutdown -P -brain -now

Re: 1597: "Git"

Posted: Fri Oct 30, 2015 9:56 pm UTC
by Eternal Density
Actually, my second workplace switched to Mercurial, for their large multi-project multi-organisation codebase.
Actually it was the same codebase as at my first employer.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 4:08 am UTC
by RogueCynic
Were there two comics today? http://forums.xkcd.com/viewtopic.php?f=7&t=112941&p=3875038#p3875038 Or is Randall linking polio with GIT?

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 5:39 am UTC
by HaniiPuppy
Alternatively, you could just use a GUI Git-based application, like the Github client.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 6:43 am UTC
by Gargravarr
NTN wrote:Have you tried to do anything with multiple people without git? I have, and I'm definitely not doing it again.

Very true. I once did work for an advertising agency who wanted to get involved in coding. They refused to use SVN because they thought it was a waste of time. Turns out it isn't. Also, I had to diplomatically explain why uploading untested code to a live server may not be the best idea ever.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 7:15 pm UTC
by Futune
I've only used git for one project, and that description was eerily accurate. Especially the memorization of arcane shell commands, the exact purpose of which I never understood. I'm now compiling a mental list of people to share this comic with.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 7:44 pm UTC
by xtifr
I think I was lucky. We tried switching from SVN to Mercurial first, and that was such a huge improvement that I'd rather have a root canal than go back to SVN. Then, once we were all used to Mercurial, we gave git a try, and now that we understood the model, the advantages of git became a lot more clear.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 8:14 pm UTC
by jonam
So true. I've started using sourcetree which has turned git from hideous into merely unpleasant.

Re: 1597: "Git"

Posted: Sat Oct 31, 2015 10:23 pm UTC
by Flumble
HaniiPuppy wrote:Alternatively, you could just use a GUI Git-based application, like the Github client.

The github client is especially great when doing things with github repos, like handling pull requests.

I like eclipse's egit for what it's worth, but you do need to learn which buttons to touch and which to avoid. In my experience using the context menu (and notably its submenu "Team") in the project view leaves a horrible taste in your mouth, whereas the same options in the repository view work like a charm better. And I still don't understand the conflict resolution view, so I tend to just edit files where necessary and then mark all as merged and be done with it.

Re: 1597: "Git"

Posted: Sun Nov 01, 2015 7:13 am UTC
by metamorphosis
The standard GIT gui is fine, you don't need the github one specifically. But FUCK learning command line arguments. I can't believe anyone would go for that.

Re: 1597: "Git"

Posted: Sun Nov 01, 2015 6:22 pm UTC
by Echo244
Gargravarr wrote:
NTN wrote:Have you tried to do anything with multiple people without git? I have, and I'm definitely not doing it again.

Very true. I once did work for an advertising agency who wanted to get involved in coding. They refused to use SVN because they thought it was a waste of time. Turns out it isn't. Also, I had to diplomatically explain why uploading untested code to a live server may not be the best idea ever.


Oh yeah, I've been in situations like that. I still have a twitch every time anyone asks me to "just" shortcut part of our normal process...

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 12:42 am UTC
by J%r
orthogon wrote:But is his friend a Rebaser or a Mergeist? You don't want to accidentally fall in with the wrong faction.

I know that you should never rebase while merging. And even if you get it right you might have overwritten the history, and next time someone's IDE does git blame it would be your name next to a lot of code. Instead you can merge while merging and merge a branch back into itself.

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 3:21 am UTC
by commodorejohn
git is the only VCS I have strong feelings about, because it seems to be the only one whose adherents mistake it for a proper distribution method for source code. I can't recall ever having had to install a Mercurial client in order to merely download the latest working snapshot to build something, but it seems like every time I do a Linux install I wind up having to install git and look up the magic words to make a local copy of the source for at least one piece of software I want to install. At least GitHub finally added a ZIP-download feature...

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 6:03 am UTC
by Mikeski
J%r wrote:you can merge while merging and merge
[yodawg.jpg]

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 8:35 am UTC
by teelo
Git alternative: change your business model. Instead of a software development firm with 30 employees all working on one project, just have 30 employees and 30 projects, and push out the estimated release dates. Source long term investors.

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 3:10 pm UTC
by ucim
asaz989 wrote:First read this page.
Then read this one.
Then this whole chapter.


Thanks, that was very helpful. I'm left with one question - is it the case that a "project" is a group of files, and that merging merely copies (pointers to) the newest versions of those files? So if your project is all one big file, you'll have to manually merge anyway, and if your project is a ton of teeny files, it should merge nicely most of the time?

And how often does the case come up that branch foo has new versions of files: A', B', and C', while branch bar has new versions of files: D', E', and F', where A played nicely with D' and where A' played nicely with D, but when merged, A' and D' are mustardy together?

Jose

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 3:18 pm UTC
by ahammel
ucim wrote:Thanks, that was very helpful. I'm left with one question - is it the case that a "project" is a group of files, and that merging merely copies (pointers to) the newest versions of those files? So if your project is all one big file, you'll have to manually merge anyway, and if your project is a ton of teeny files, it should merge nicely most of the time?
If the branches being merged have changes in different files, then they are guaranteed to merge nicely. If they have changes in the same file, then they may or may not merge nicely, depending on whether the algorithm can figure out if the changes are non-overlapping. If I add a comment at the bottom of the file and you add one at the top, that will merge no problem, but if we both rewrite the same method that will require conflict resolution.

And how often does the case come up that branch foo has new versions of files: A', B', and C', while branch bar has new versions of files: D', E', and F', where A played nicely with D' and where A' played nicely with D, but when merged, A' and D' are mustardy together
If by "plays nicely with" you mean "can be merged with automatically", then that never happens, if I'm understanding you correctly. If by "plays nicely with" you mean "works correctly with", then yeah, that happens (and no VCS can do anything about it).

The solution is to merge into master frequently and run a comprehensive set of functional tests every time.

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 4:45 pm UTC
by Sandman81
I once listened to a TED talk about how Git could be used by citizens to collaborate in drafting new laws. It sounded like an interesting idea, and the speaker made it sound like Git was very easy to use, so I thought I would look into it.

Big mistake.

"Track changes" has its faults, but at least it does not require taking evening classes to acquire the level of learning required to login and create a document.

Re: 1597: "Git"

Posted: Mon Nov 02, 2015 8:40 pm UTC
by ps.02
ucim wrote:And how often does the case come up that branch foo has new versions of files: A', B', and C', while branch bar has new versions of files: D', E', and F', where A played nicely with D' and where A' played nicely with D, but when merged, A' and D' are mustardy together?

Obviously a question like "how often" is hugely dependent on more context than you've given. Certainly it is always possible that if each of us makes a self-contained set of changes to a single larger project, that even if these changes do not textually overlap, they can semantically conflict. For example, I rename a function eat_a_burger to eat_a_sandwich, and you add another reference to eat_a_burger, using the old name because you didn't know I was renaming it. Merge our changes together and bam, you're calling a function that doesn't exist.

As others have noted, there are strategies to avoid and detect such problems:
  • merging "early and often", so the changes you're getting from your teammates and - they from you - are generally small, and what you're working on is not hugely out of date;
  • visually reviewing all changes that you pull in from others, to keep a sense of whether your work is likely to conflict semantically with others' work (this can pay the additional dividend of quality control, an "additional set of eyes" on the work);
  • automated testing - unit tests, for a start - which is fast enough and convenient enough that people will actually run the tests frequently, as a routine part of work;
  • keeping the codebase as close as possible to 100% free of compiler or runtime warnings, so that if one does pop up, you notice it right away. Many semantic conflicts will cause warnings of some sort.
Of course, none of this is specific to Git. Any collaborative software development effort with any technology will benefit from those same habits and processes.