milke / GitFinder-Issues

Bug and issue tracker for GitFinder - git client with macOS Finder integration
16 stars 1 forks source link

GitFinder's empty "deleted" placeholder files cause Xcode issues #38

Closed uliwitness closed 6 years ago

uliwitness commented 6 years ago

The placeholder files GitFinder creates are picked up by other (non-Git) applications and cause issues there. E.g. they show up in Xcode as unassigned items in an asset catalog, preventing the asset entry from actually disappearing. Other applications also may not react too well to random files being inserted into their file packages (aka bundles).

I cannot use GitFinder with this issue. Is there any way to turn off this behaviour or at least achieve it in a different way than littering empty files over my directories?

milke commented 6 years ago

I'm preparing an update, which will handle this issue in the following manner:

#GitFinder *

will be removed from the exclude list, removing causes of some other problems with other development tools.

I'm currently busy with some things not related to GitFinder, so this new version will come out in abut two weeks. Thanks for the patience.

milke commented 6 years ago

I already posted this in #23, but I'll repeat it here, in case someone stumbles across this thread searching for problem with assets catalogs in Xcode.

First of all, git-deleted placeholder files now have custom file extension gitFinderDeleted. This removes necessity for any special, non-displayable characters in the exclude list. When this new version of GitFinder encounters a repository, it will add following lines (if they don't exist already) in the exclude file:

# GitFinder placeholder for git-deleted files. # Don't remove this line, it's needed for proper functioning of GitFinder. *.gitFinderDeleted

Like suggested by @mcfog, the detailed comment should be enough to inform users what this exclude rule is all about and why it is needed. If your exclude file already contains previously created problematic lines:

#GitFinder *\x04\x05\x06

they will be replaced with new ones. This should remove a cause of problems in IntelliJ IDEA and possibly other IDEs. Additionally, the new exclude rule can't be deleted in the GitFinder repo setting window, as - (delete) button is disabled, as in the picture below: repo_settings As per @mcfog suggestion, my first implementation was hiding that rule completely, but then I worried some users may be wondering why it isn't in there whereas it is present in the exclude file. Hence I decided to leave it in, but will clear intention to show it should not be deleted.

The new file extension gitFinderDeleted is hidden on created placeholder files, so these files appear with the same name as their originals. As before, if you try to modify the file in any way (including showing file extension), you'll be asked to escalate privileges and this should be pretty clear indication these files should be left alone and you should only use them to execute git operations on them form the Finder contextual of toolbar item menu. If your browser already contains old placeholders (with suffix \x04\x05\x06), those will be replaced with new placeholders with gitFinderDeleted extension.

Finally, to avoid problems with assets catalogs in Xcode (and possibly similar potential problems in other IDEs) reported by @uliwitness, GitFinder now had an option to create (or not) these git-deleted placeholder files. It's in the GitFinder git config prefs, see the picture below: git_config_prefs If you opt not to create placeholder files, git-deleted files will not be represented in Finder and hence you will not be able to execute git operations on them from Finder, like e.g. Stage, Unstage, Revert, See Changes and similar. However, if you opt to show git status for folders (see the picture above) and you execute any git operation on a parent folder of git-deleted file, GitFinder will be able to perform that operation (I hope it's clear what I'm talking about here, try it out yourself). Additionally, while git-deleted files aren't represented in Finder, they are still visible in the repository browser window, so you can perform all operations on deleted files from there, just like before.

All these changes are available in GitFinder version 1.0.2b1 (build 37). You can update to it from GitFinder update preferences, just choose Beta release channel, like in the picture below: update_prefs Please try/test/use all aspects of those changes. I tested smooth transition from old to new git-deleted placeholder files and all options an operations with them being created or not, but it may happen I missed something. I'd appreciate your feedback in any case, even if everything works smoothly so I can make this release official.

Once again, I apologise for delays and thanks for your patience. I hope changes are worth it.

milke commented 6 years ago

I've just made this officially available in version 1.0.2. Hence, I'll close the issue. If it doesn't work correctly, or anyone have suggestions to improve behaviour in this regard further, feel free to reopen.

cig0 commented 5 years ago

I just stumbled upon this issue, thanks for the thorough explanation @milke

milke commented 5 years ago

@cig0, as you can see, I haven't had any response about this, neither here nor in #23, and nobody has reported similar issues after 1.0.2 was released. Did it fix the problem for you?

cig0 commented 5 years ago

Yes it did!

Allow me to add: lots of times when one's issue is resolved, we tend to move along without a second thinking or stopping by to say "thanks". I know how frustrating this radio silence can be on the other side of the counter, but maybe it could help to think about it as no news, good news :)

milke commented 5 years ago

Allow me to add: lots of times when one's issue is resolved, we tend to move along without a second thinking or stopping by to say "thanks". I know how frustrating this radio silence can be on the other side of the counter, but maybe it could help to think about it as no news, good news :)

Yeah, I do the same, just moving along :-) Thanks for the write back anyway.

tshimomura commented 3 years ago

In ver1.6.1, how can I suppress the creation of placeholder files?

milke commented 3 years ago

@tshimomura, it's in the similar place as before, the only change is that all git related preferences/configurations are moved into their own window. See below, that should explain it all.

Screen Shot 2021-02-18 at 00 31 48
tshimomura commented 3 years ago

How to show "Git Configuration..." menu?

My 1.6.1 and 1.6.2(b3) menu is: GitFinderMenu

milke commented 3 years ago

If you're in the main menu, like on your picture, take a look into the WIndow submenu:

Screen Shot 2021-02-22 at 15 26 00

Although, you may be right that the main application GitFinder submenu is the better place, so I may move it over there.

Besides, git configuration is also available from the status item menu, on the right of the main menu:

Screen Shot 2021-02-22 at 15 26 13

If your preference is not to show the status item, then you can find git configuration in Finder's contextual and toolbar item menus:

Screen Shot 2021-02-22 at 15 26 57 Screen Shot 2021-02-22 at 15 26 40
tshimomura commented 3 years ago

Thanks a lot, I missed it because I am unfamiliar with macOS (I was looking for a similar product because I was familiar with Windows TortoiseGit).

AndrewLazarus commented 3 years ago

Anyone using IntelliJ, the preference to ignore *.gitFinderDeleted files completely is under Preferences, Editor, File Types, Ignored File Types. And you will need this because otherwise it tries to copy them into your output directory.