bobthecow / coda-cli

Makes Panic's Coda a first-class *nix citizen
http://justinhileman.info/coda-cli/
MIT License
53 stars 4 forks source link

Git integration with coda -w #1

Closed marijn closed 12 years ago

marijn commented 13 years ago

I'm having some trouble with the git integration. The commit message file opens up in coda but it doesn't save it correctly to the stream.

output

$ git commit
Traceback (most recent call last):
  File "/usr/local/bin/coda", line 200, in <module>
    while list(set(files) & set(open_tabs())):
TypeError: 'NoneType' object is not iterable
error: There was a problem with the editor 'coda -w'.
Please supply the message using either -m or -F option.
bobthecow commented 13 years ago

Try opening coda and changing line 95 from return None to return []

marijn commented 13 years ago

This removes the error but now my git commit is prematurely ended due to an empty commit message (it does open the commit message in coda though).

bobthecow commented 13 years ago

Open a file in Coda (make sure it's not unsaved) and run coda --ls-tabs ... does it actually show you your file names?

marijn commented 13 years ago

I'm not sure I understand what I should do, just to be sure I've included what I've done.

  1. Create a new file from the command line by invoking coda TESTME. The file TESTME is created successfully.
  2. Save the file by invoking the save command in coda.
  3. Return to the command line and invoke coda --ls-tabs. Running the command does not result in output.

I'm not sure if this is what you wanted me to do though...?

bobthecow commented 13 years ago

I just wanted you to run coda --ls-tabs while you have at least one file open in Coda.

When you have open files in Coda, the command coda --ls-tabs should give the full paths to all of your open files. If there are no files open, --ls-tabs should list nothing. coda -w relies on this to know whether you've closed the file it cares about.

For example:

justin@dan:~$ coda .gitconfig
justin@dan:~$ coda --ls-tabs
/Users/justin/.gitconfig

If yours isn't listing any open files, that's a problem. And it would explain why git doesn't get a commit message.

marijn commented 13 years ago

Well, it appears that this is not working on my MacBook Pro. Admittedly this OS X install is not in proper shape, so this might just be my machine. To confirm I'll also try my iMac at the office this week (won't be there until wednesday unfortunately). Will get back on it by than, thanks for the help so far!

marijn commented 13 years ago

Unfortunately coda --ls-tabs isn't working on my iMac either. What information should I provide you with to help resolve this issue?

bobthecow commented 13 years ago

Hmm. What version of OS X and Python are you running?

marijn commented 13 years ago

Sorry for my late response, my Python version:

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 

And my Mac OS X version

Mac OS X 10.6.6 (10J567)

Any additional information needed?

marijn commented 13 years ago

Forgive me for being whining, but have you gotten a chance to look at this @bobthecow?

bobthecow commented 12 years ago

I think I might have found your problem.

Try this version: https://raw.github.com/bobthecow/coda-cli/develop/coda

Let me know if that does anything for you.

marijn commented 12 years ago

I'll try it right away.

marijn commented 12 years ago

@bobthecow, thanks for addressing this. It is working as expected!

bobthecow commented 12 years ago

That most likely means you have a broken osax in /Library/ScriptingAdditions or ~/Library/ScriptingAdditions ... You can test by running this in Terminal:

osascript -e 'say "hi"'

If there are any errors, that's your problem. If I were to hazard a guess, I'd blame Adobe :)

marijn commented 12 years ago

This seems error-ish:

2011-10-18 15:51:14.189 osascript[10936:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found.  Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

Leave it to Adobe to wreck your system at the cost of a small car :-( Thanks for pointing that out though!

bobthecow commented 12 years ago

Yep. That's the culprit.

Release v1.0.2 now works around Adobe's reckless abandon. Closing the issue. Thanks for your help :)