1597: "Git"

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

Moderators: Moderators General, Prelates, Magistrates

User avatar
firechicago
Posts: 621
Joined: Mon Jan 11, 2010 12:27 pm UTC
Location: One time, I put a snowglobe in the microwave and pushed "Hot Dog"

Re: 1597: "Git"

Postby firechicago » Tue Nov 03, 2015 3:13 am UTC

There are two other things you can do to minimize those types of conflicts, one of them specific to git and another general to pretty much any type of programming. The general one is dividing your code up (whether into modules, functions, classes, or whatever code-organization tools your language has) into distinct chunks with clear responsibilities and carefully defined interfaces between each other. If you've done this properly, there really ought to be only two cases where A' and D' don't play nicely:

a) You've introduced a subtle edge case bug into one of them that only appears in interaction with the other, in which case you should count yourself lucky that it popped up right away when it will be relatively easy to find and fix.

b) You've made a significant change to the interface between A and D, in which case one or both of them were going to need refactoring anyway.

The other thing you can do is adopt the practice of rebasing any branch before merging (long live the rebasers! death to the mergeist heretics!). This doesn't solve the problem per se (you still have to deal with these issues in the context of the rebase) but at least it creates a clear procedure for resolving these conflicts, and ensures that they are resolved in the context of a single pull request, rather than merging a bunch branches and having messy cleanup to do on master.

Blaisorblade
Posts: 13
Joined: Sun May 01, 2011 2:08 pm UTC

Re: 1597: "Git"

Postby Blaisorblade » Tue Nov 03, 2015 9:36 am UTC

I understand Git, but can totally relate to the comic, I remember learning it :D. I'll still claim that unlike Git, Mercurial has a command-line interface that was designed, rather than grown.

However, cargo-cult usage of Git on the command line, like described, sounds like using Emacs, only ever using the four arrow keys for moving around :shock: :? (I've seen that, honest) — use a graphical client please!

For extra Ignobel points, you can boast about using Emacs, and only ever use the left and right key, even if you want to go from the first to the last line, on an Emacs with scrollbars :mrgreen: (I might not have witnessed this, but I wouldn't swear it).

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

Re: 1597: "Git"

Postby xtifr » Wed Nov 04, 2015 12:46 am UTC

commodorejohn wrote: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...


Huh, I certainly used to encounter the same circumstances with CVS and SVN. Maybe not Mercurial, but then I haven't actually seen a lot of projects that use Mercurial. (Though I think it's a fine system, I hasten to add.)

In any case, if all you want is the latest snapshot, that hardly requires any arcane magic. You don't need to learn about all the odd features like the staging area or merging strategies or fast-forwarding or any of the other stuff that generally trips newbies up when first approaching git. It's literally no harder with git than with any other VCS.
"[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.

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

Re: 1597: "Git"

Postby commodorejohn » Wed Nov 04, 2015 2:35 am UTC

That very well may be so, but my point is more that if you have to install a VCS client at all just to get a snapshot of the source, that's more complicated that it really ought to be.
"'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.

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

Re: 1597: "Git"

Postby Flumble » Wed Nov 04, 2015 12:10 pm UTC

On the other hand, source code releases (as in both tagged commits and the distribution) are supposed to go in tarballs served over HTTP (or FTP or, you know, a proper package manager) and git leaves that part to other tools that are specifically designed for this purpose.
Then again, git does include a tarball generator, which can be done just as well by the tool that is specifically designed for that purpose.

What's really missing is ubiquitous advice to install nginx next to git and use this one weird trick git hook script to create a tarball in your www directory every time a new tag is pushed. (Or an addition to git that serves a listing of all tags with a link to get that tarball over HTTP. But hey, scm administrators need to do something for their job.)
Really, the only result I could find for the latter is this, which isn't really helpful other than showing that it's possible to filter commits on a tag update.

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

Re: 1597: "Git"

Postby commodorejohn » Wed Nov 04, 2015 3:52 pm UTC

You're right that it's a cultural problem and not a technical one, but that's exactly what I was saying. (And, in any case, cultural problems in software tend to become entrenched enough that they might as well be technical problems.)
"'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.

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

Re: 1597: "Git"

Postby orthogon » Wed Nov 04, 2015 3:56 pm UTC

commodorejohn wrote:You're right that it's a cultural problem and not a technical one, but that's exactly what I was saying. (And, in any case, cultural problems in software tend to become entrenched enough that they might as well be technical problems.)

Culture is Layer 11, isn't it?
xtifr wrote:... and orthogon merely sounds undecided.

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

Re: 1597: "Git"

Postby Flumble » Wed Nov 04, 2015 4:40 pm UTC

commodorejohn wrote:You're right that it's a cultural problem and not a technical one, but that's exactly what I was saying.

Yes, we're on the same team :D , I'm just specifically advocating the approach to having git administrators serve tarballs from their webhost/blog/mailserver instead of alternatives like adding a webserver to the git daemon.

Anyway, how often do you encounter a git repository that's not hosted on github nowadays?

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

Re: 1597: "Git"

Postby commodorejohn » Wed Nov 04, 2015 4:54 pm UTC

Less frequently, thankfully, but it seems like I always manage to run into at least one...
"'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.

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

Re: 1597: "Git"

Postby xtifr » Thu Nov 05, 2015 8:47 am UTC

commodorejohn wrote:That very well may be so, but my point is more that if you have to install a VCS client at all just to get a snapshot of the source, that's more complicated that it really ought to be.

To get a snapshot? Hardly any projects are in the habit of handing out arbitrary snapshots. Getting a snapshot usually required a VCS long before git was created. Some projects had unstable development releases, to get wider testing of new features, but public CVS servers were what started to kill that. SVN and later git merely accelerated the process. Heck, I first installed SVN just to grab snapshots, long before I switched to it from CVS for my own use. Git wasn't even a notion at that time.

Anyway, if you're using a system where installing git (or cvs/svn/bazaar/mercurial/etc.) is harder than typing "apt-get install [whatever]", then you're using the wrong system! You should just be happy you really only need one VCS for the task these days. At one point, I had four installed, of which three were just used for downloading snapshots.
"[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.

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

Re: 1597: "Git"

Postby commodorejohn » Thu Nov 05, 2015 2:55 pm UTC

It's not that it's difficult to install git. That part is easy. It's that it's a pain in the ass having to remember the magic formulae to use it when all you want is a source tarball (especially in a software ecosystem where you're basically expected to build any non-repository programs from source.) CVSes are a fine thing for collaborative development, I'm sure - but treating them as a method for software distribution is like giving someone a mail-order car-parts catalog and telling them "okay, here's a car!"
"'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.

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

Re: 1597: "Git"

Postby xtifr » Thu Nov 05, 2015 9:21 pm UTC

commodorejohn wrote:It's not that it's difficult to install git. That part is easy. It's that it's a pain in the ass having to remember the magic formulae to use it when all you want is a source tarball (especially in a software ecosystem where you're basically expected to build any non-repository programs from source.) CVSes are a fine thing for collaborative development, I'm sure - but treating them as a method for software distribution is like giving someone a mail-order car-parts catalog and telling them "okay, here's a car!"


First, as I pointed out, not an issue specific to git. And second, I don't think I've ever seen a project that made their version control repository public that didn't also prominently feature the necessary magic formula on their web page, so the only thing you have to remember is how to cut-and-paste.

Also, I think that source distribution is much more analogous to handing someone the parts and saying "here's a car". But you don't seem to be complaining about the hassle of compiling/installing, so your objection seems a bit overblown. Not that I don't sympathize, a bit. It is one more step. But it seems like a really, really simple one to me. And making tarballs for public distribution is just a bit of extra tedious gruntwork for the devs; frankly, I'd rather have them focused on the code, rather than on making things easier for the tiny fraction of users who want to build things themselves, but don't want the official releases.

Anyway, most places I've worked at that insist on building outside software themselves also insist on proper packaging (rpm or deb), so ops doesn't have to pull out their hair every time an upgrade is needed, and are usually perfectly happy if you start with the distro's source-rpm or source-deb, assuming one exists. And if one doesn't exist, then you get the fun of creating the packaging scripts, which totally dwarfs the difficulty of downloading (whether by tarball or by version control) and building. And which, if you're at all sane, you do under version control... :)
"[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.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: acunning40, mscha, qvxb and 93 guests