1597: "Git"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
Eternal Density
Posts: 5579
Joined: Thu Oct 02, 2008 12:37 am UTC
Contact:

1597: "Git"

Postby Eternal Density » Fri Oct 30, 2015 6:06 am UTC

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.
Play the game of Time! castle.chirpingmustard.com Hotdog Vending Supplier But what is this?
In the Marvel vs. DC film-making war, we're all winners.

m.alessandrini
Posts: 7
Joined: Thu Jan 16, 2014 1:10 pm UTC

Re: 1597: "Git"

Postby m.alessandrini » Fri Oct 30, 2015 7:56 am UTC

At last!
It was time someone authoritative told it!

User avatar
orthogon
Posts: 3074
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1597: "Git"

Postby orthogon » Fri Oct 30, 2015 8:32 am UTC

But is his friend a Rebaser or a Mergeist? You don't want to accidentally fall in with the wrong faction.
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
sfmans
Posts: 104
Joined: Mon Jun 23, 2014 9:09 am UTC
Location: High Peak, UK

Re: 1597: "Git"

Postby sfmans » Fri Oct 30, 2015 8:49 am UTC

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.

User avatar
Neil_Boekend
Posts: 3220
Joined: Fri Mar 01, 2013 6:35 am UTC
Location: Yes.

Re: 1597: "Git"

Postby Neil_Boekend » Fri Oct 30, 2015 9:38 am UTC

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?
Mikeski wrote:A "What If" update is never late. Nor is it early. It is posted precisely when it should be.

patzer's signature wrote:
flicky1991 wrote:I'm being quoted too much!

he/him/his

User avatar
Xenomortis
Not actually a special flower.
Posts: 1447
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: 1597: "Git"

Postby Xenomortis » Fri Oct 30, 2015 10:31 am UTC

This is not an inaccurate representation of my workplace.
Image

User avatar
sfmans
Posts: 104
Joined: Mon Jun 23, 2014 9:09 am UTC
Location: High Peak, UK

Re: 1597: "Git"

Postby sfmans » Fri Oct 30, 2015 10:43 am UTC

Neil_Boekend wrote:Does it need a dedicated WOM?


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

NTN
Posts: 3
Joined: Fri Sep 18, 2015 11:43 pm UTC

Re: 1597: "Git"

Postby NTN » Fri Oct 30, 2015 10:46 am UTC

Have you tried to do anything with multiple people without git? I have, and I'm definitely not doing it again.

User avatar
cellocgw
Posts: 2052
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1597: "Git"

Postby cellocgw » Fri Oct 30, 2015 11:31 am UTC

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:
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

User avatar
cellocgw
Posts: 2052
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1597: "Git"

Postby cellocgw » Fri Oct 30, 2015 11:33 am UTC

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.
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

rmsgrey
Posts: 3630
Joined: Wed Nov 16, 2011 6:35 pm UTC

Re: 1597: "Git"

Postby rmsgrey » Fri Oct 30, 2015 12:05 pm UTC

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...

mousewiz
Posts: 107
Joined: Wed Oct 26, 2011 6:50 pm UTC

Re: 1597: "Git"

Postby mousewiz » Fri Oct 30, 2015 1:11 pm UTC

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.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: 1597: "Git"

Postby ahammel » Fri Oct 30, 2015 1:33 pm UTC

Hmm, I guess I'm the only one who absolutely loves it. Maybe that's my phone number in that text file.
He/Him/His/Alex
God damn these electric sex pants!

geniekid
Posts: 8
Joined: Tue Sep 18, 2012 6:11 pm UTC

Re: 1597: "Git"

Postby geniekid » Fri Oct 30, 2015 2:06 pm UTC

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:

Kit.
Posts: 1117
Joined: Thu Jun 16, 2011 5:14 pm UTC

Re: 1597: "Git"

Postby Kit. » Fri Oct 30, 2015 2:12 pm UTC

Does anyone have a link describing that "beautiful distributed graph theory tree model"?

User avatar
Archgeek
Posts: 262
Joined: Wed May 02, 2007 6:00 am UTC
Location: Central US
Contact:

Re: 1597: "Git"

Postby Archgeek » Fri Oct 30, 2015 2:18 pm UTC

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.
"That big tube down the side was officially called a "systems tunnel", which is aerospace contractor speak for "big tube down the side."

tbc
Posts: 1
Joined: Mon Jun 10, 2013 3:39 am UTC
Location: Colorado

Re: 1597: "Git"

Postby tbc » Fri Oct 30, 2015 2:59 pm UTC

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.

sbkp
Posts: 29
Joined: Wed Jul 04, 2012 1:29 pm UTC

Re: 1597: "Git"

Postby sbkp » Fri Oct 30, 2015 3:29 pm UTC

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?

rmsgrey
Posts: 3630
Joined: Wed Nov 16, 2011 6:35 pm UTC

Re: 1597: "Git"

Postby rmsgrey » Fri Oct 30, 2015 4:15 pm UTC

Last time I used Git, it was with the Tortoise front end, which made it pretty painless.

asaz989
Posts: 4
Joined: Thu Sep 02, 2010 3:40 pm UTC

Re: 1597: "Git"

Postby asaz989 » Fri Oct 30, 2015 5:51 pm UTC

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!

User avatar
felltir
has a sniper scope and a trigger finger.
Posts: 2493
Joined: Tue Mar 04, 2008 5:01 pm UTC
Location: Back in't home town. Never at home.
Contact:

Re: 1597: "Git"

Postby felltir » Fri Oct 30, 2015 7:29 pm UTC

The temptation to perform the alt text of the comic on this thread is pretty high.
Spoiler:
RoadieRich wrote:He's a super flexible furry martial artist from London. She is a Rabbit breeding mad scientist from Michigan. They fight crime!
The Great Hippo wrote:I THINK THE SOLAR SYSTEM MIGHT BE AN ATOM OF OXYGEN.


Blog

he/him/his

Cousj001
Posts: 33
Joined: Wed Aug 31, 2011 10:55 am UTC

Re: 1597: "Git"

Postby Cousj001 » Fri Oct 30, 2015 9:42 pm UTC

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
Magic is real, unless declared integer.

User avatar
Eternal Density
Posts: 5579
Joined: Thu Oct 02, 2008 12:37 am UTC
Contact:

Re: 1597: "Git"

Postby Eternal Density » Fri Oct 30, 2015 9:56 pm UTC

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.
Play the game of Time! castle.chirpingmustard.com Hotdog Vending Supplier But what is this?
In the Marvel vs. DC film-making war, we're all winners.

RogueCynic
Posts: 403
Joined: Sun Nov 22, 2009 10:23 pm UTC

Re: 1597: "Git"

Postby RogueCynic » Sat Oct 31, 2015 4:08 am UTC

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?
I am Lord Titanius Englesmith, Fancyman of Cornwood.
See 1 Kings 7:23 for pi.
If you put a prune in a juicer, what would you get?

HaniiPuppy
Posts: 3
Joined: Thu Jun 09, 2011 2:05 pm UTC

Re: 1597: "Git"

Postby HaniiPuppy » Sat Oct 31, 2015 5:39 am UTC

Alternatively, you could just use a GUI Git-based application, like the Github client.

Gargravarr
Posts: 74
Joined: Mon Dec 21, 2009 8:34 am UTC

Re: 1597: "Git"

Postby Gargravarr » Sat Oct 31, 2015 6:43 am UTC

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.

Futune
Posts: 7
Joined: Wed Jan 11, 2012 9:07 pm UTC

Re: 1597: "Git"

Postby Futune » Sat Oct 31, 2015 7:15 pm UTC

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.

xtifr
Posts: 364
Joined: Wed Oct 01, 2008 6:38 pm UTC

Re: 1597: "Git"

Postby xtifr » Sat Oct 31, 2015 7:44 pm UTC

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.
"[T]he author has followed the usual practice of contemporary books on graph theory, namely to use words that are similar but not identical to the terms used in other books on graph theory."
-- Donald Knuth, The Art of Computer Programming, Vol I, 3rd ed.

jonam
Posts: 2
Joined: Sat Oct 31, 2015 8:13 pm UTC

Re: 1597: "Git"

Postby jonam » Sat Oct 31, 2015 8:14 pm UTC

So true. I've started using sourcetree which has turned git from hideous into merely unpleasant.

User avatar
Flumble
Yes Man
Posts: 2248
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: 1597: "Git"

Postby Flumble » Sat Oct 31, 2015 10:23 pm UTC

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.

metamorphosis
Posts: 20
Joined: Sun Sep 26, 2010 8:56 am UTC

Re: 1597: "Git"

Postby metamorphosis » Sun Nov 01, 2015 7:13 am UTC

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.

User avatar
Echo244
Posts: 511
Joined: Wed May 20, 2015 9:49 am UTC
Location: Ping! Ping! Ping! Ping!

Re: 1597: "Git"

Postby Echo244 » Sun Nov 01, 2015 6:22 pm UTC

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...
Unstoppable force of nature. That means she/her/hers.
Has committed an act of treason.

J%r
Posts: 44
Joined: Sun Aug 16, 2015 12:02 pm UTC

Re: 1597: "Git"

Postby J%r » Mon Nov 02, 2015 12:42 am UTC

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.

commodorejohn
Posts: 1180
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: 1597: "Git"

Postby commodorejohn » Mon Nov 02, 2015 3:21 am UTC

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...
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

Mikeski
Posts: 1099
Joined: Sun Jan 13, 2008 7:24 am UTC
Location: Minnesota, USA

Re: 1597: "Git"

Postby Mikeski » Mon Nov 02, 2015 6:03 am UTC

J%r wrote:you can merge while merging and merge
[yodawg.jpg]

teelo
Posts: 782
Joined: Thu Apr 08, 2010 11:50 pm UTC

Re: 1597: "Git"

Postby teelo » Mon Nov 02, 2015 8:35 am UTC

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.

User avatar
ucim
Posts: 6857
Joined: Fri Sep 28, 2012 3:23 pm UTC
Location: The One True Thread

Re: 1597: "Git"

Postby ucim » Mon Nov 02, 2015 3:10 pm UTC

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
Order of the Sillies, Honoris Causam - bestowed by charlie_grumbles on NP 859 * OTTscar winner: Wordsmith - bestowed by yappobiscuts and the OTT on NP 1832 * Ecclesiastical Calendar of the Order of the Holy Contradiction * Heartfelt thanks from addams and from me - you really made a difference.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: 1597: "Git"

Postby ahammel » Mon Nov 02, 2015 3:18 pm UTC

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.
He/Him/His/Alex
God damn these electric sex pants!

Sandman81
Posts: 8
Joined: Mon Mar 11, 2013 12:24 pm UTC

Re: 1597: "Git"

Postby Sandman81 » Mon Nov 02, 2015 4:45 pm UTC

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.

ps.02
Posts: 378
Joined: Fri Apr 05, 2013 8:02 pm UTC

Re: 1597: "Git"

Postby ps.02 » Mon Nov 02, 2015 8:40 pm UTC

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.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: Google [Bot] and 113 guests