CINXE.COM

LKML: Linus Torvalds: Re: Kernel SCM saga..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>LKML: Linus Torvalds: Re: Kernel SCM saga..</title><link href="/css/message.css" rel="stylesheet" type="text/css" /><link href="/css/wrap.css" rel="alternate stylesheet" type="text/css" title="wrap" /><link href="/css/nowrap.css" rel="stylesheet" type="text/css" title="nowrap" /><link href="/favicon.ico" rel="shortcut icon" /><script src="/js/simple-calendar.js" type="text/javascript"></script><script src="/js/styleswitcher.js" type="text/javascript"></script><link rel="alternate" type="application/rss+xml" title="lkml.org : last 100 messages" href="/rss.php" /><link rel="alternate" type="application/rss+xml" title="lkml.org : last messages by Linus Torvalds" href="/groupie.php?aid=1" /><!--Matomo--><script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDoNotTrack", true]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//m.lkml.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script><!--End Matomo Code--></head><body onload="es.jasper.simpleCalendar.init();" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="180" align="center"><a href="/"><img style="border:0;width:135px;height:32px" src="/images/toprowlk.gif" alt="lkml.org" /></a></td><td width="32">聽</td><td class="nb"><div><a class="nb" href="/lkml"> [lkml]</a> 聽 <a class="nb" href="/lkml/2005"> [2005]</a> 聽 <a class="nb" href="/lkml/2005/4"> [Apr]</a> 聽 <a class="nb" href="/lkml/2005/4/8"> [8]</a> 聽 <a class="nb" href="/lkml/last100"> [last100]</a> 聽 <a href="/rss.php"><img src="/images/rss-or.gif" border="0" alt="RSS Feed" /></a></div><div>Views: <a href="#" class="nowrap" onclick="setActiveStyleSheet('wrap');return false;">[wrap]</a><a href="#" class="wrap" onclick="setActiveStyleSheet('nowrap');return false;">[no wrap]</a> 聽 <a class="nb" href="/lkml/mheaders/2005/4/8/172" onclick="this.href='/lkml/headers'+'/2005/4/8/172';">[headers]</a>聽 <a href="/lkml/bounce/2005/4/8/172">[forward]</a>聽 </div></td><td width="32">聽</td></tr><tr><td valign="top"><div class="es-jasper-simpleCalendar" baseurl="/lkml/"></div><div class="threadlist">Messages in this thread</div><ul class="threadlist"><li class="root"><a href="/lkml/2005/4/6/121">First message in thread</a></li><li><a href="/lkml/2005/4/8/9">Linus Torvalds</a><ul><li><a href="/lkml/2005/4/8/14">Chris Wedgwood</a><ul><li><a href="/lkml/2005/4/8/18">(H. Peter Anvin)</a><ul><li><a href="/lkml/2005/4/8/42">Rogan Dawes</a><ul><li><a href="/lkml/2005/4/8/44">Daniel Phillips</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2005/4/8/43"> ross&#64;lug ...</a><ul><li class="origin"><a href="/lkml/2005/4/8/341">Linus Torvalds</a><ul><li><a href="/lkml/2005/4/8/341">Petr Baudis</a><ul><li><a href="/lkml/2005/4/9/19">"Randy.Dunlap"</a></li><li><a href="/lkml/2005/4/9/144">Phillip Lougher</a></li></ul></li><li><a href="/lkml/2005/4/9/70">Paul Jackson</a><ul><li><a href="/lkml/2005/4/9/74">Linus Torvalds</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2005/4/8/46">Andrea Arcangeli</a><ul><li><a href="/lkml/2005/4/8/113">Matthias Andree</a><ul><li><a href="/lkml/2005/4/8/119">Florian Weimer</a></li></ul></li><li><a href="/lkml/2005/4/8/155">Linus Torvalds</a><ul><li><a href="/lkml/2005/4/8/180">Matthias-Christian Ott</a><ul><li><a href="/lkml/2005/4/8/190">Linus Torvalds</a></li><li><a href="/lkml/2005/4/8/315">Marcin Dalecki</a></li></ul></li></ul></li></ul></li><li><a href="/lkml/2005/4/8/48">Marcel Lanz</a><ul><li><a href="/lkml/2005/4/8/82">Geert Uytterhoeven</a></li></ul></li><li><a href="/lkml/2005/4/8/76">Matt Johnston</a></li><li><a href="/lkml/2005/4/12/54">Kedar Sovani</a><ul><li><a href="/lkml/2005/4/12/83">Catalin Marinas</a></li><li><a href="/lkml/2005/4/13/4">Ricky Beam</a></li></ul></li></ul></li></ul></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerl.gif" width="32" height="32" alt="/" /></td><td class="c" rowspan="2" valign="top" style="padding-top: 1em"><table><tr><td><table><tr><td class="lp">Date</td><td class="rp" itemprop="datePublished">Fri, 8 Apr 2005 08:50:21 -0700 (PDT)</td></tr><tr><td class="lp">From</td><td class="rp" itemprop="author">Linus Torvalds &lt;&gt;</td></tr><tr><td class="lp">Subject</td><td class="rp" itemprop="name">Re: Kernel SCM saga..</td></tr></table></td><td></td></tr></table><pre itemprop="articleBody"><br /><br />On Fri, 8 Apr 2005 ross&#64;jose.lug.udel.edu wrote:<br />&gt; <br />&gt; Here's a partial solution. It does depend on a modified version of<br />&gt; cat-file that behaves like cat. I found it easier to have cat-file<br />&gt; just dump the object indicated on stdout. Trivial patch for that is included.<br /><br />Your trivial patch is trivially incorrect, though. First off, some files<br />may be binary (and definitely are - the "tree" type object contains<br />pathnames, and in order to avoid having to worry about special characters<br />they are NUL-terminated), and your modified "cat-file" breaks that. <br /><br />Secondly, it doesn't check or print the tag.<br /><br />That said, I think I agree with your concern, and cat-file should not use <br />a temp-file. I'll fix it, but I'll also make it verify the tag (so you'd <br />now have to know the tag in advance if you want to cat the data).<br /><br />Something like<br /><br /> cat-file -t &lt;sha1&gt; # output the tag<br /> cat-file &lt;tag&gt; &lt;sha1&gt; # output the data<br /><br />or similar. Easy enough. That way you can do<br /><br /> torvalds&#64;ppc970:~/git&gt; ./cat-file -t `cat .dircache/HEAD `<br /> commit<br /><br />and<br /><br /> torvalds&#64;ppc970:~/git&gt; ./cat-file commit `cat .dircache/HEAD `<br /><br /> tree ca30cdf8df2f31545cc1f2c1be62619111b6f6aa<br /> parent c2474b336d7a96fb4e03e65d229bcddc62b244fc<br /> author Linus Torvalds &lt;torvalds&#64;ppc970.osdl.org&gt; Fri Apr 8 08:16:38 2005<br /> committer Linus Torvalds &lt;torvalds&#64;ppc970.osdl.org&gt; Fri Apr 8 08:16:38 2005<br /><br /> Make "cat-file" output the file contents to stdout.<br /><br /> New syntax: "cat-file -t &lt;sha1&gt;" shows the tag, while "cat-file &lt;tag&gt; &lt;sha1&gt;"<br /> outputs the file contents after checking that the supplied tag matches.<br /><br />I'll rsync the .dircache directory to kernel.org. You'll need to update <br />your scripts.<br /><br />&gt; Now to see what I come up with for commit, push, and pull...<br /><br />A "commit" (*) looks roughly like this:<br /><br /> # check with "show-diff" what has changed, and check if<br /> # you need to add any files..<br /><br /> update-cache &lt;list of files that have been changed/added/deleted&gt;<br /><br /> # check with "show-diff" that it all looks right<br /><br /> oldhead=$(cat .dircache/HEAD)<br /> newhead=$(commit-tree $(write-tree) -p $oldhead &lt; commit-message)<br /><br /> # update the head information<br /> if [ "$newhead" != "" ] ; then echo $newhead &gt; .dircache/HEAD; fi<br /><br />(*) I call this "commit", but it's really something much simpler. It's<br />really just a "I now have &lt;this directory state&gt;, I got here from<br />&lt;collection of previous directory states&gt; and the reason was &lt;reason&gt;". <br /><br />The "push" I use is<br /><br /> rsync -avz --exclude index .dircache/ &lt;destination-dir&gt;<br /><br />and you can pull the same way, except when you pull you should save _your_<br />HEAD file first (and then you're screed. There's no way to merge. If<br />you've made changes and committed them, your changes are still there, but<br />they are now on a different HEAD than the new one).<br /><br />That, btw, is kind of the design. "git" really doesn't care about things<br />like merges. You can use _any_ SCM to do a merge. What "git" does is track<br />directory state (and how you got to that state), and nothing else. It<br />doesn't merge, it doesn't really do a whole lot of _anything_.<br /><br />So when you "pull" or "push" on a git archive, you get the "union" of all<br />directory states in the destination. The HEAD thing is _one_ pointer into <br />the "sea of directory states", but you really have to use something else <br />to merge two directory states together. <br /><br /> Linus<br />-<br />To unsubscribe from this list: send the line "unsubscribe linux-kernel" in<br />the body of a message to majordomo&#64;vger.kernel.org<br />More majordomo info at <a href="http://vger.kernel.org/majordomo-info.html">http://vger.kernel.org/majordomo-info.html</a><br />Please read the FAQ at <a href="http://www.tux.org/lkml/">http://www.tux.org/lkml/</a><br /><br /></pre></td><td width="32" rowspan="2" class="c" valign="top"><img src="/images/icornerr.gif" width="32" height="32" alt="\" /></td></tr><tr><td align="right" valign="bottom"> 聽 </td></tr><tr><td align="right" valign="bottom">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerl.gif" width="32" height="32" alt="\" /></td><td class="c">聽</td><td class="c" valign="bottom" style="padding-bottom: 0px"><img src="/images/bcornerr.gif" width="32" height="32" alt="/" /></td></tr><tr><td align="right" valign="top" colspan="2"> 聽 </td><td class="lm">Last update: 2009-11-18 23:46 聽聽 [from the cache]<br />漏2003-2020 <a href="http://blog.jasper.es/"><span itemprop="editor">Jasper Spaans</span></a>|hosted at <a href="https://www.digitalocean.com/?refcode=9a8e99d24cf9">Digital Ocean</a> and my Meterkast|<a href="http://blog.jasper.es/categories.html#lkml-ref">Read the blog</a></td><td>聽</td></tr></table><script language="javascript" src="/js/styleswitcher.js" type="text/javascript"></script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10