Disable commit view for bare repos
Reported by Owen Yamauchi | January 30th, 2009 @ 05:10 AM
Commit view doesn't apply when viewing bare repositories, so it's probably best to hide it from users.
I've written a fix; I can attach a patch or push my branch, whichever you prefer.
Comments and changes to this ticket
-

Johannes Gilger January 30th, 2009 @ 03:57 PM
Thanks for pointing this one out. Patches are best sent via email, though you can attach them here as well.
The other problem we're facing with a bare repository is that the index shows all files as deleted (because thats what git diff-index --cached says), which of course is not the case. gitk had the same problem and solved it by checking for a bare repo before doing anything on the display of staged/unstaged changes.
I'm still in the process of finding my way through the many similarly named Objective-C files, or I would have fixed it myself already.
-

Pieter de Bie January 30th, 2009 @ 04:53 PM
I think the real problem is that GitX currently isn't really aware of any worktree / git tree. What I'd like to see is a change to PBGitRepository, where on load it tests if it's bare. Then there should be the possibility to ask for the git dir (which should be there in any case), the worktree (which might be NULL in case of a bare repository), the directory gitx cli was started in (so you can do 'gitx .' in a subdir) or the best possible match (subdir > worktree > git dir).
Now it just does some ugly stuff with repository.fileURL.path, which I don't like at all :)
@Johannes: The layout is actually pretty simple. There's a 'controller' map in XCode where all the controllers are in. General controllers are in the root, and controllers for specific views are in the submaps. There's a map for each view (history, commit and diff, which does the 'git diff | gitx' handling).
There's a 'master' controller for each view, usually called 'PBGit_View_Controller', e.g. PBGitHistoryController. Then, if there's a web controller, that one has the same name but with "Web" in it, eg PBWebHistoryController, though the naming might differ a bit. There might also be subcontrollers if there's a lot of code. For example, in the commit view, there is an IndexController to keep track of everything index-related.
The same structure is what you also see in the 'html' subdirectory .. the 'history' part is in 'html/views/history', etc. The PBWebHistoryController will automagically load in 'html/views/history/history.html', so by comparing names you can know what matches each other. This is also why the naming is similar sometimes.
-

Owen Yamauchi January 30th, 2009 @ 05:17 PM
I just got around the problem where all files show up as deleted by disabling the mode selector in the toolbar and the mode selection menu items when you're viewing a bare repo.
All I did to PBGitRepository was give it an instance method -isBareRepository, which just calls the class method. Is that OK?
P.S., who should I email the patch to?
-

Johannes Gilger January 30th, 2009 @ 05:44 PM
Yeah, that sounds cool, by now I had found a way to check for a bare repo from PBGitCommitController.m too, but I also had thought of making the whole isBare as an extra method.
So, please mail the patch(es) to Pieter (frimmirf+gitx@gmail.com) as well as me (heipei@hackvalue.de)
-

Johannes Gilger January 31st, 2009 @ 09:43 AM
Ok, I looked at your patches and they work fine. There is one problem though: When I open GitX in commit-view in a non-bare repo, close GitX with commit-view active and then start it on the bare repo it will start in commit-view and you're not able to switch back.
-

Pieter de Bie February 12th, 2009 @ 11:50 AM
- State changed from new to open
I think Johannes had another patch for this? I'll take a look at it when I have the time again, but I think there patches that were sent for this were ok.
-

-

Johannes Gilger March 25th, 2009 @ 04:04 PM
What do you mean? You merged all the relevant commits a while back:
- 2009-01-31 10:29:08 +0100 06f675b Johannes Gilger PBGitWindowController: Default to historyViewController for bare repo
- 2009-01-30 18:59:40 -0500 82b6efc Owen Yamauchi Fix ticket #84: disable commit view for bare repos
- 2009-01-29 23:19:00 -0500 64dfd99 Owen Yamauchi Make finding the history/commit selector more robust.
So, I think the ticket can be closed
-

Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
GitX is the nice-looking gitk clone for OS X
People watching this ticket
Referenced by
-
#84 Disable commit view for bare repos
2009-01-30 18:59:40 -0500 82b6efc Owen Yamauchi Fix ticke...