LWN.net Logo

The git tree is the source code

The git tree is the source code

Posted Nov 10, 2012 14:14 UTC (Sat) by pbonzini (subscriber, #60935)
In reply to: The git tree is the source code by epa
Parent article: Introducing RedPatch (Ksplice Blog)

The keyword here is *modification*. You do not need patches to modify the Red Hat tree.

You need patches to analyze a process (the creation of the Red Hat kernel) and replicate the same changes to *another* program (the Oracle kernel).

I see it the other way round: the actual preferred form of modification is flattened source code. To modify something you work on a checkout, not on a source tarball + some patches. "Source code + patches" is only acceptable because it is easily flattened.

Think of it. Suppose you have a bug in a Fedora package and you found that there is a fix upstream for it, for example via a Bugzilla search. Roughly speaking, Fedora packages are distribute as a tarball and a possibly empty set of patches.

The first things you do in order to test the fix are "fedpkg prep" to flatten the Fedora package and "git clone" to fetch the upstream change. You do not need the patches that build up the Fedora package (which is what you're modifying), but you need the patches that build up upstream (which is what you're analyzing.


(Log in to post comments)

The git tree is the source code

Posted Nov 10, 2012 16:50 UTC (Sat) by epa (subscriber, #39769) [Link]

I see it the other way round: the actual preferred form of modification is flattened source code.
There's some merit in that argument. Even when people do fetch a git tree to modify the code, they don't usually look at the history of past patches but just work on their change based on the state of the code as it is now.

The git tree is the source code

Posted Nov 10, 2012 21:48 UTC (Sat) by apoelstra (subscriber, #75205) [Link]

>There's some merit in that argument. Even when people do fetch a git tree to modify the code, they don't usually look at the history of past patches but just work on their change based on the state of the code as it is now.

Most code I changes to code, it's usually because

(a) I am a project developer, and I need git to keep track of all the work I'm doing, or
(b) I am not a project developer, so I'm just doing a small bugfix. Then I'd like 'git log' or 'git blame' to find out where the bug came from.

The git tree is the source code

Posted Nov 15, 2012 12:08 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

> (a) I am a project developer, and I need git to keep track of all the work I'm doing, or

Just use quilt, you do not need the history.

(Devil's advocate, of course---nowadays I'm spoiled by the ease of doing "git init", but I was doing the above a lot in CVS/svn days).

> (b) I am not a project developer, so I'm just doing a small bugfix. Then I'd like 'git log' or 'git blame' to find out where the bug came from.

Nice to have, but definitely not a requirement for modification.

(Not devil's advocate here, I rarely do "git clone" if I'm just fixing something for myself. I just work on top of the Fedora package).

The git tree is the source code

Posted Nov 11, 2012 11:34 UTC (Sun) by cyanit (guest, #86671) [Link]

Well, some kinds of modifications like removing or altering a specific set of changes are much better done on the git tree, and the original work (Linux) is also provided as a git tree.

It seems to me they might very well be in violation of the GPL.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds