Gl.ib.ly

(glibly); Just another techie blog.

Skype mute and unmute keyboard shortcuts in Mac OSX 10.5

Posted by Tariq • Friday, September 11. 2009 • Category: Tidbits
Ever do phone conferences? Ever put your microphone on mute only to be asked a question and then scramble your mouse to unmute your microphone? Well I do all of the above, well, until I came across a forum post at the Skype forums. I gave the guy's suggestion a go using ⌘M as the mute/unmute button but that only minimized the window. So, instead, I chose ⌘Z and it worked a charm; note, you will need to wait a little after call starts ringing before you can hit the keyboard shortcut. Plus, the keys are nice and close on the keyboard.

Defined tags for this entry: , , , , ,

Fixing binary merge conflicts in git

Posted by Tariq • Thursday, September 3. 2009 • Category: Tidbits
Git is an awesome tool for managing your code. However, it does take a while to get used to doing things in git. One question I get asked a bit too often is "how do I resolve binary merge conflicts"? Thankfully this is is pretty easy. I usually run the git mergetool command to allow me to resolve merge conflicts using a graphical interface and then manipulate the resultant files on the command line.

You can specify which editor to use in your ~/.gitconfig file. Favourites are kdiff3, vimdiff, xxdiff, and opendiff. If your on Mac OSX then you may be used to FileMerge, in which case you should be using opendiff in your .gitconfig; see below.

...
[merge]
tool = opendiff
...



So, when you are using mergetool option you will something like:
Normal merge conflict for 'lib/yui/assets/skins/sam/editor-sprite.gif':
{local}: created
{remote}: created
Hit return to start merge resolution tool (opendiff):


I just hit return so the editor opens, it will probably warn you the file is binary. In a separate terminal window navigate to the directory where the file is in and do an ls; you'll see something like what is below:
editor-sprite.gif
editor-sprite.gif.BACKUP.41930.gif
editor-sprite.gif.LOCAL.41930.gif
editor-sprite.gif.REMOTE.41930.gif


In this case editor-sprite.gif.REMOTE.41930.gif is the new file and editor-sprite.gif is the original file. To resolve the conflict just copy the REMOTE file over the original file. In my case it would be cp editor-sprite.gif.REMOTE.41930.gif editor-sprite.gif. However, I use the following one liner to resolve these conflicts more generically.


ls *.REMOTE.* | sed "s/\(\(.*\).REMOTE.*\)/cp \1 \2/g" | sh
 


I have it in shell script in my path so I just run it when I need to resolve these types of conflicts. It just finds files with REMOTE in them and then issues a cp command to copy that file over the original.

Hope this helps!

Outside of git mergetool you can just add the binary files using git add file1 file2 ....
Defined tags for this entry: , , , , , , , ,