disable scan for .xpr files in the project tree?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
piotrb
Posts: 18
Joined: Fri Jan 09, 2009 9:18 pm

disable scan for .xpr files in the project tree?

Post by piotrb »

Apologies if this is covered somewhere in the documentation -- I've tried a few searches: here in the forum, in the help section, and under Options|Preferences, but nothing helpful seemed to come up.

Problem: can't get rid of a random .xpr file in the source tree, it gets prioritised over my project file that sits outside the tree.

The potential testcase is the TEI source code (https://github.com/TEIC/TEI) . It contains an .xpr file: `I18N/examples-zh-tw/teiI18N.xpr` .
And it also contains a .gitignore that specifies `*.xpr`. From the perspective of git, the project file is invisible and doesn't bother anyone.
But, apparently, oXygen scans the project tree immediately upon accessing it, and either grabs the only .xpr file in that tree, or presents the user with an option to choose, if more such files are present. Probably important: I also use the git add-on.

I've worked with the TEI source for years, and the .xpr file is, gosh, 16 yrs old (check) -- but the problem started recently. I can't precisely recall if it started with version 27; most probably not (but my memory is foggy in this respect).

How to recreate (that is not going to be a minimalist test case, I'll just tell you what I have):
  • a regular project file outside the source tree (my project files sit in the projects/ directory, and the tree in question is in projects/LingSIG/TEI/)
  • the git add-on
  • and now, either: have a different project opened and switch to the regular TEI project; in my case, the git extension lags behind and I have to manually change the working copy, and which point oXygen takes me out of my TEI-based project and lands me in the teiI18N.xpr mentioned above;
  • or: have the TEI-based project open in oXygen and close the editor while looking at the project view. Upon reopening, switch to the git view, and, bang, you're again moved to the teiI18N.xpr project
One practical solution that comes to mind is: disable the scan for .xpr files in the source tree. Can that be done somehow, please? Or is this whole note misplaced completely and should go to the add-on maintainers? (It is, for now, pretty obvious that the add-on plays a role, but I obviously couldn't say if it's the culprit or maybe just a trigger.)
A workaround that I've just discovered: copy the teiI18N.xpr file somewhere else in the TEI tree, and now oXygen will ask you to choose from the two projects -- and you can cancel the dialog and keep the regular project.
alex_jitianu
Posts: 1015
Joined: Wed Nov 16, 2005 11:11 am

Re: disable scan for .xpr files in the project tree?

Post by alex_jitianu »

Hello,

Yes, it is related with the Git Client. I'm sorry for the inconvenience, it is a behavior that we thought to help people, but it appears to do more harm in this particular scenario. Fortunately, it can be disabled: please go to Options->Preferences... on page Plugins / Git Client and:
- select "Never switch to the new working copy" on the "When detecting a Git repository inside a newly opened projects"
- unselect "Detect open Oxygen projects (.xpr) from opened repositories"

You can explore different combinations, but the one above should solve it.
Alex
piotrb
Posts: 18
Joined: Fri Jan 09, 2009 9:18 pm

Re: disable scan for .xpr files in the project tree?

Post by piotrb »

Thank you so much, Alex! I must have used some wrong keyword in searching through the oXygen options, but it's also good to have this clearly confirmed (I've linked this post from GitHub issues in the TEI repo).

I have only done the second thing you mention (unselected project detection), and it seems to give me exactly the behaviour that I prefer.

Best wishes,
Piotr
Post Reply