开发者

Using subversion, is it possible to "invisibly" include a file in version control?

My project contains a couple of IDE configuration files that are constantly changing, but do not have any effect on the build itself. I would like these files to be included in every commit and update, but I would rather that they did not show up in the list of modified files. Is this possible?

Details:

My IDE (Xcode) uses per开发者_开发技巧-user configuration files to keep track of things like window position, local build directory, color coding, etc. These configuration files are stored along with the project file itself (in the same bundle), and are not relocatable. If I instruct subversion to ignore these files, they are excluded from commits. If I pull an update and another developer has modified the project, my local config files are obliterated. If I do not ignore these files, they constantly show up "Modified" in my subversion client, and I would rather not clutter up the repository history with tiny commits just to upload my local config files. I do, however, want them stored in the repository so that I can pull down an update without losing any settings.

I would be happy with a setup in which my config files were silently included in all commits and updates. I realize that this results in a compromise: some settings would be lost if they were made after my commit, and before I pulled an update. I can live with that arrangement.


You say, "If I instruct subversion to ignore these files, they are excluded from commits. If I pull an update and another developer has modified the project, my local config files are obliterated." If you put the files into .svnignore, and check that in, then no one will commit the settings files, and they will never be clobbered when you pull an update.


How about path based authorization?

http://svnbook.red-bean.com/en/1.4/svn.serverconfig.pathbasedauthz.html

[calc:/branches/calc/bug-142]
harry = rw
sally = r
[calc:/branches/calc/bug-142/secret]
harry =

Only sally access to secret so no of the other devolpers will even get a copy to commit in. (It does not look like it has individual file level granularity though. So you have to convince your ide to put its file in on directory.)


You can use the property svn:ignore. The svn:ignore property will prevent users from seeing these files with svn status and from adding them with svn add *. However, it doesn't make them invisible, and users can still add them to the repository. Once added, they will show up with svn status, and an svn commit will commit the changes.

Therefore, you also need a pre-commit hook to prevent these files from being added into the repository just incase someone tries (and they will).


Those files should not be under version control at all. Take them out (svn del them) and then set svn:ignore on *.pbxuser and *.mode1v3 on the project.xcodeproj directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜