Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repos initialized with git-svn break the app #5

Closed
appden opened this issue Mar 8, 2011 · 10 comments
Closed

Repos initialized with git-svn break the app #5

appden opened this issue Mar 8, 2011 · 10 comments
Milestone

Comments

@appden
Copy link

appden commented Mar 8, 2011

It only loads this far: http://d.pr/I79X

@quimrodri
Copy link

Same problem here with 0.8.0. I've tried with 0.8.1 and now it crashes. With a non git-svn repo it works as expected.

Crash report: http://pastebin.com/w1EPfsF0

@jasonrm
Copy link

jasonrm commented Mar 14, 2011

By commenting out the following I'm able to compile 0.8.1 and it works with a git-svn init'ed repo. Not sure what else it breaks as I haven't had time to track down why it was an issue.

--- a/PBGitSidebarController.m
+++ b/PBGitSidebarController.m
@@ -171,7 +171,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(
  -(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote
  {
         NSLog(@"remote.title=%@",[remote title]);
-       [remote setAlert:[self remoteNeedFetch:[remote title]]];
+//     [remote setAlert:[self remoteNeedFetch:[remote title]]];
  }

@jralls
Copy link

jralls commented Mar 15, 2011

The state of thread 1 turns out to be a distraction; the crash is actually due to an unhandled exception in thread 4, from calling an unknown method "setAction" on PBGitSVRemoteItem.

This patch corrects the error:

  diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m
  index a9a936e..992080d 100644
  --- a/PBGitSidebarController.m
  +++ b/PBGitSidebarController.m
  @@ -171,7 +171,7 @@ - (void) observeValueForKeyPath:(NSString *)keyPathofObject
   -(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote
   {
          NSLog(@"remote.title=%@",[remote title]);
  -       [remote setAlert:[self remoteNeedFetch:[remote title]]];
  +       [remote setTitle:[self remoteNeedFetch:[remote title]]];
   }

   -(NSNumber *)countCommintsOf:(NSString *)range

@laullon
Copy link
Owner

laullon commented Mar 15, 2011

Problem found... I'll solvet it soon...
This is a temp patch

diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m
index a9a936e..41b33e1 100644
--- a/PBGitSidebarController.m
+++ b/PBGitSidebarController.m
@@ -170,8 +170,10 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(

 -(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote
 {
-       NSLog(@"remote.title=%@",[remote title]);
-       [remote setAlert:[self remoteNeedFetch:[remote title]]];
+       NSLog(@"remote.title=%@ (%@)",[remote title],remote);
+    if([remote isKindOfClass:[PBGitSVRemoteItem class]]){
+        [remote setAlert:[self remoteNeedFetch:[remote title]]];
+    }
 }

@alexwall
Copy link

Nice but why you didn't apply it to the master branch?

@laullon
Copy link
Owner

laullon commented Mar 15, 2011

not yet...

@alexwall
Copy link

Ok

PS: thx for your engagement

@jralls
Copy link

jralls commented Mar 15, 2011

No, scratch that: It masks the error, which isn't that PBGitSVRemoteItem doesn't have a setItem method, it's that the pointer that's being passed in is a PVGitSVOtherItem, which doesn't.

The following patch is a workaround, but it's still not clear to me from whence the bad object is coming.
diff --git a/PBGitSidebarController.m b/PBGitSidebarController.m
index 992080d..48a0a63 100644
--- a/PBGitSidebarController.m
+++ b/PBGitSidebarController.m
@@ -171,7 +171,12 @@ - (void) observeValueForKeyPath:(NSString *)keyPath ofObjec
-(void)evaluateRemoteBadge:(PBGitSVRemoteItem *)remote
{
NSLog(@"remote.title=%@",[remote title]);
- [remote setTitle:[self remoteNeedFetch:[remote title]]];
+ if ([remote isMemberOfClass:[PBGitSVRemoteItem class]]) {
+ [remote setAlert:[self remoteNeedFetch:[remote title]]];
+ }
+ else {
+ NSLog(@"evaluateRemoteBadge called with object of wrong type.");
+ }
}

   -(NSNumber *)countCommintsOf:(NSString *)range

@laullon
Copy link
Owner

laullon commented Apr 18, 2011

solved on 0.8.2

@laullon laullon closed this as completed Apr 18, 2011
@laullon
Copy link
Owner

laullon commented Apr 25, 2011

V0.8.2 beta is out http://gitx.posterous.com/gitx-l-v082-beta

tsnow pushed a commit to tsnow/gitx that referenced this issue Jul 30, 2014
tsnow pushed a commit to tsnow/gitx that referenced this issue Jul 30, 2014
tsnow pushed a commit to tsnow/gitx that referenced this issue Jul 30, 2014
…n't retain them under ARC.

For laullon#5 we need to run under Leaks to detect stuff like this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants