This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 67900 - .DS_store file shouldn't be added to repository on MaxOSX
Summary: .DS_store file shouldn't be added to repository on MaxOSX
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 5.x
Hardware: Macintosh Mac OS X
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords:
Depends on: 201015
Blocks: 68124
  Show dependency tree
 
Reported: 2005-11-01 13:13 UTC by Jan Horvath
Modified: 2011-08-16 19:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2005-11-01 13:13:31 UTC
build 200510311900

.DS_store file shouldn't be added to repository on MaxOSX
Comment 1 Maros Sandor 2005-11-01 13:45:56 UTC
All files under versioned folders are supposed to be tracked by CVS unless they
are set as being Ignored. You can create a .cvsignore file in your home
directory and put .DS_store entry in it. This will ignore all .DS_store files on
your local machine.
Comment 2 Jan Horvath 2005-11-01 15:16:41 UTC
I didn't mention that this file is used to store icon layout on MacOSX, so its not desirable to add this files 
generaly on mac platform. Maybe similar as Thumbs.db on windows?
Comment 3 Maros Sandor 2005-11-01 15:22:21 UTC
I know what those files are and my comment still holds. I am forwarding your
request to the (imho) appropriate module. If we decide to address this issue
somehow then SharabilityQuery should return false for these files.
Comment 4 Jesse Glick 2005-11-01 19:02:01 UTC
Has nothing to do with SharabilityQuery. This file is already excluded by
VisibilityQuery.
Comment 5 Maros Sandor 2005-11-02 09:21:43 UTC
.DS_store files are not visible, which is fine, so VQ works well. What does NOT
work well is SQ which reports that this file is sharable. .cvsignore files are
also invisible according to VQ yet sharable according to SQ.
Comment 6 Jesse Glick 2005-11-02 19:18:31 UTC
Well, most of the VQ-excluded files are things that should not go into CVS or
into any version control system. Probably javacvs should special-case .cvsignore
since it knows what it is for. A project's SQ cannot really know what each
backup file etc. is for; that is only handled by VQ, which is configurable as a
user option. So I suggest javacvs commit a file f iff

SQ.isSharable(f) && (f == .cvsignore || VQ.isVisible(f))

Not the cleanest way out but I don't see any better alternative.
Comment 7 Maros Sandor 2005-11-03 10:10:02 UTC
I am not comfortable with this solution.
Comment 8 Jan Horvath 2005-11-03 16:36:54 UTC
What solution do you propose than, Maros?
Comment 9 Maros Sandor 2005-11-04 09:18:09 UTC
I already suggested a solution and it was rejected. I have no other ideas now.
You can easilty work around this as I wrote in my first comment in the meantime.
Comment 10 Jesse Glick 2005-11-04 17:29:59 UTC
Another option would be for
org.netbeans.modules.masterfs.GlobalVisibilityQueryImpl to also implement
SharabilityQueryImplementation and report some or all of the same filename
patterns to be unsharable (wherever they are). This SQI would have to precede
org.netbeans.modules.projectapi.ProjectSharabilityQuery in global lookup (or
org.netbeans.spi.project.support.ant.SharabilityQueryImpl would have to report
UNKNOWN rather than SHARABLE for files which are not NOT_SHARABLE). But the
problem remains that GVQI would then need to know that although .cvsignore files
are supposed to be hidden, they are still supposed to be sharable, unlike most
other hidden files. This would hardcode knowledge specifically about CVS in
openide/masterfs, which seems undesirable. Consider that if another popular VCS
has its own sharable metadata files we would need to hardcode that in masterfs
too. That is why I suggested that it would be preferable to put the special-case
handling of .cvsignore in javacvs, which is where other CVS-related
functionality naturally belongs. (Or GVQI could report all hidden files as
non-sharable, and then javacvs could add its own SQI with even higher precedence
in lookup which reported .cvsignore as sharable.)

Anyway, the obvious workaround stands - correct your CVS ignore lists (either
per-directory, per-user, or per-repository). This would anyway be needed by
command-line CVS.
Comment 11 Maros Sandor 2005-11-05 03:02:58 UTC
I will follow up jesse with my comments:
1) SQI ... implemented by some global entity ... reports known files as
unsharable (.DS_store, Thumns.db, .*, some other patterns, etc) and all other
files as UNKNOWN. It considers current OS environment. I think it must be the
first in lookup.
2) SQIs ... implemented by projects ... report some directories (build, dist) as
unsharable as it is now.
3) VQ is completely independent
CVSlite (or any other entity) that queries SQ may treat special files, such as
.cvsignore, in a special way, so SQImpls may safely report them as not sharable.
Comment 12 Jesse Glick 2005-11-06 17:18:20 UTC
The problem is #3. Currently there is a *user-configurable* ignore list (in
IDESettings, accessed via reflection from masterfs) which drives the default
VQI. Now should that also be used for the SQI you describe in #1? It means, in
effect, that files the user does not normally see will also normally be omitted
from CVS. Which is perhaps the expected behavior, though it is not obvious that
this is correct. For reference, the default pattern, adopted from Ant's default
excludes:

^(CVS|SCCS|vssver\.scc|#.*#|%.*%|\.(cvsignore|svn|DS_Store))$|^\.[#_]|~$

Now I think that with the exception of .cvsignore (which you seem to agree could
be special-cased?), all of these patterns are reasonable to exclude from CVS as
well as from IDE display.

If the user adjusts the pattern (which is probably unusual, given both the tough
regular expression syntax and the exclusion of this setting from the new Options
dialog - only available in "Classic" view), does the user expect any custom
exclusions to also affect CVS and other VCS commits?
Comment 13 Jesse Glick 2005-11-06 17:22:45 UTC
If you agree that sharing the same regexp for VQI and a global SQI would make
sense, then I guess this can be reassigned to masterfs (?) for implementation.
Comment 14 Maros Sandor 2005-11-07 16:10:48 UTC
I think we can share this pattern in both queries. As this is an IDE-wide
implementation that only affects version control modules, it may be provided by
the versioncontrol library module (autoloaded) that would just delegate the call
to VQ. Be it masterfs or versioncontrol, what about #1? Can we guarantee order
of SQ implementations?
Comment 15 Jesse Glick 2005-11-08 00:54:10 UTC
"[the proposed new SQI] may be provided by the versioncontrol library module
(autoloaded) that would just delegate the call to VQ" - not as safe as being in
masterfs, since it would be (perhaps adversely) affected by any other installed
VQI's.

"Can we guarantee order of SQ implementations?" - not as such but we can put the
new SQI before ProjectSQI by using #position in META-INF/services/SQI.
Comment 16 Maros Sandor 2005-11-08 09:10:42 UTC
I am moving this to masterfs then. The task is to implement global SQ that just
reuses the pattern from global VQ.
Comment 17 rmatous 2005-11-11 15:42:45 UTC
/cvs/openide/masterfs/src/META-INF/services/org.netbeans.spi.queries.SharabilityQueryImplementation,v
 initial revision: 1.1

/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/GlobalSharabilityQueryImpl.java,v
 initial revision: 1.1

/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/GlobalVisibilityQueryImpl.java,v
 new revision: 1.5; previous revision: 1.4

/cvs/openide/masterfs/test/unit/src/org/netbeans/modules/masterfs/GlobalSharabilityQueryImplTest.java,v
 initial revision: 1.1
Comment 18 Jan Horvath 2005-12-15 10:08:52 UTC
v