<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 21 Aug 2016, at 13:29, Stefan Daschek wrote:</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">I’d be happy to give this a try. Could you give me some hints on what code you think could / should be removed?
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">Unused code, whatever that is :) And code that is only used by a single bundle can be moved to that bundle.</p>

<p dir="auto">There might also be use of some code that could be replaced with stdlib functionality, for example a lot of bundles use <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">e_sh</code> from <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">escape.rb</code> when they should probably instead use the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">Shellwords</code> library.</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">To check if code isn’t used in other bundles before removing it: Would it be sufficient to search across all bundles that are listed in TextMate’s bundle index?
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">Yes, I think if none of “our” bundles use the code, there should be no need to support it anymore.</p>

<p dir="auto"></p></div>
<div style="white-space:pre-wrap"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><div dir="auto">(Btw, where can I find the source of this index?)
</div></blockquote></div>
<div style="white-space:normal">

<p dir="auto">This code will echo the “git clone” instructions required to clone all bundles in the index (pipe it to <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">sh</code> when you ensure it works):</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">pp ~/Library/Application\ Support/TextMate/Managed/Cache/org.textmate.updates.default \
|grep -o 'https://api.textmate.org/.*\.tbz' \
|while read url; do curl -s $url \
|tar -jxO info.plist|pp \
|sed -n 's/.*url = "\(.*git.*\)";/\1/p' \
|( read repos; echo git clone $repos ); done
</code></pre>

<p dir="auto">Here <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">pp</code> is the property list tool found in the <em>Property List</em> bundle (under <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">Support/bin</code>).</p>

<p dir="auto">It basically just reads a property list from stdin and outputs the old-style format to stdout so that we can easily grep it. A bit like <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">pl</code> but that tool lacks support for binary property lists.</p>

<p dir="auto">And you will btw need to clone all the repositories because the deployed versions use binary property lists, so searching these would not find everything.</p>
</div>
</div>
</body>
</html>