SVN with a bit of ADD

I tired of manually adding all the new files in my working copy of various projects in subversion so I started using this command:

svn add svn status | grep ? | awk '{print $2}'

... but I eventually grew tired of looking that up every time. I tried to make that into an alias, but because of the shell escaping it didn't work as is. I did a bit of digging around and found a non-shell escaped version then added these lines to the bottom of my ~/.profile (I'm sure it would also work in ~/.bash_profile):

alias svnadderall="svn status | grep '^?' | cut -b 8- | xargs svn add" alias svnridallin="svn status | grep '^!' | cut -b 8- | xargs svn remove --keep-local"

A quick breakdown of how this works:

  • alias svnadderall =
    this is the command that tells bash what will happen when you type svnadderall. You can change that to whatever you'd be more comfortable with. I used "adderall" and "ridallin" because I'm clever like that (I'll eventually get sick of the puns, but the ADHD mnemonic will help me get in the habit of using them (yes, I know they're not spelled correctly; they're phonetic mnemonics)).
  • svn status |
    prints out the status of all your files and passes it to
  • grep '^?' |
    finds each line beginning with ? and passes it along to
  • cut -b 8- |
    trims off the first eight characters and returns the rest of the lines and passes it to
  • xargs svn add
    captures everything and runs svn add [whatever it was passed]

It's the same for the svn remove except the grep is matching for lines that begin with ! and I'm using a --keep-local flag to prevent svn from trying to remove the file1 (which won't exist, since it's missing, remember?).

I tried changing the cut -b 8- to sed 's/^?[ ]+//' and even awk {print $2} but neither worked properly for some reason; the awk based version tried to svn add ? and the sed version sat there waiting for input.

On further consideration, I think cut -b 8- will be the safest. The file name won't always be the second item in the svn status output. I can't imagine any situation where that would be the case for non-versioned files, though there might be true for missing versioned files would have a secondary (or tertiary) flag.

If you're editing your bash_profile or profile be sure to run source ~/.profile (or source ~/.bash_profile) if you want your shell to pick up your changes. You can also logout and log back in (or open a new Terminal.app tab or window) as well.

  1. I don't know if it's an subversion v1.6 thing or not, but doing an svn remove on files that do not exist on the file system would exit on the first error, in this case being that the file doesn't exist. 

In Regards to iWork.com

iWork.comIn the excitement about Apple's beta version of iWork.com - the web-based document sharing/collaborating feature of their iWork suite - people have been asking about fonts. Specifically, what happens when you use a font that that isn't available on the receiving end of the shared document?

I thought immediately of the news that the nightly builds of Webkit support downloadable fonts. All it takes is a couple lines of CSS and, as Jobs would say, "Boom." Webkit is cross-platform (Apple even ships Safari for Windows), open source, and arguably one of the most popular mobile browsers. No longer will Mac users have the excuse that they can't work with anyone else, were they to use iWork. Apple benefits from the increased usage of Webkit and Safari and they get to show off how great their iWork documents look to users unfamiliar to Apple's software aesthetic.

Why wouldn't they do it that way? Digital Rights Management (or rather, the lack thereof).

Font foundries typically have strictly defined licences for their fonts, though there isn't anything technical standing in the way of breaking those licenses1. As DRM is slowly losing ground (if Apple's "One Last Thing" from the Macworld Expo Keynote was any indication), will Apple drag the typography industry into the 21st century, into a landscape currently limited to a tiny handful of fonts? One can only hope.

Addendum:

In section 5 of the iWork.com Terms of Service, Apple says:

Changes to Content You understand that in order to provide the Service and make your Content available thereon, Apple may transmit your Content across various public networks, in various media, and modify or change your Content to comply with technical requirements of connecting networks or devices. You agree that the license herein permits Apple to take any such actions.

(emphasis mine)

  1. I should clarify, it would be neither the content creators sharing the documents that would be breaking the license, nor the user viewing the document on the web, but the individual that downloaded the font and used it without being granted the license to do so. It's a distinction that needs to be made clear. 

Hahlo.app

Update: Apologies, everyone, it was in bad form of me to redistribute a Fluid-based app. Stay tuned for a tutorial on how you too can have your own Hahlo.app.


Hahlo.app

Hahlo.app

For several months now, I've been using Hahlo.com as my portal to Twitter on the iPhone. Sure, since then 2.0 has launched, and with it several viable native clients, but even still, none of them were an equal to Hahlo.

I started using a custom Fluid based app for loading Hahlo on my MacBook Pro, edging out all the other clients available. I'd tell people about this, but for the most part, when they'd finally break down and install Fluid, I'd then have to walk them through setting up Hahlo, which unfortunately, ended up looking like any other browser window and they'd miss the point.

I've set up a javascript that would, on launch, resize the window so the content area's width would match that of the iPhone, I customized the chrome options, it has Growl notifications for new tweets, and finally after a few months of pestering him, Jim has created an installer for it all.

It's Leopard only, does all the heavy lifting of setting up a Fluid app and sets you up with the proper viewport width. Enjoy.

Copyright © 2004 - 2010 M. Auayan. All rights reserved.