git-annex-importfeedgit-annexhttp://git-annex.branchable.com/git-annex-importfeed/git-annexikiwiki2016-01-02T21:02:51ZReplacing dashes with underscoreshttp://git-annex.branchable.com/git-annex-importfeed/comment_1_d0197108d07873040e46577df1faadbd/joseph.rawson.works2015-12-28T22:39:49Z2015-12-28T22:39:49Z
<p>An example rss item entry:</p>
<pre><code><item><title>00135929509939-04</title><guid isPermaLink="false">http://40.media.tumblr.com/01a46c39dc0e0f3447fbed4f0807047f/tumblr_nyoj75VlaG1sgxjc6o3_1280.jpg</guid><enclosure url="http://40.media.tumblr.com/01a46c39dc0e0f3447fbed4f0807047f/tumblr_nyoj75VlaG1sgxjc6o3_1280.jpg" length="0" type=""/></item>
</code></pre>
<p>Using --template '${itemtitle}${extension}'</p>
<p>The resulting filename is <strong>00135929509939_04.jpg</strong> (The dash was replaced with an underscore).</p>
<p>I decided to just change all the filenames in each blog repository to use underscores, however, I thought you might want to know about this.</p>
comment 2http://git-annex.branchable.com/git-annex-importfeed/comment_2_25d4ed016e98609066597a8d2b956f87/joey2016-01-01T20:07:52Z2016-01-01T20:04:02Z
<p>All spaces and punctuation (other than '.') and other wacky stuff are replaced with
'_' when git-annex builds a filename from some untrusted source like a
feed.</p>
<p>I think it makes sense to do that even for '-', at least if it's at the
start of a filename. "--force" is not a filename you want to let a feed
inject into your work tree. I could perhaps be convinced to let '-'
elsewhere in the filename through unmunged, but simplicity and consistency
suggests it's just as good to always munge it.</p>
comment 3http://git-annex.branchable.com/git-annex-importfeed/comment_3_bce2b233e4d42fc87a2e17d51e2c2606/umeboshi2016-01-02T21:02:51Z2016-01-02T21:02:51Z
<p>I just thought it was surprising behavior, especially when <code>git-annex addurl --file 123-45.ext $url</code> preserves the dash in the filename, yet the rss I constructed to add multiple urls, with files, didn't do this.</p>
<p>The new <code>--batch --with-files</code> options to addurl will eliminate the need to create specially crafted rss files.</p>
<p>Thanks! <img src="http://git-annex.branchable.com/smileys/smile.png" alt=":)" /></p>