2

We have a development settings file in our application that needs to go in a certain location, but varies in content from machine-to-machine.

What we'd like to do is commit to repository a "base" version of the file, which anyone can check out, but for subversion to ignore changes to the file to prevent it being checked back in by others. Is something like this possible?

Thanks for any help!

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
Kieran
  • 718
  • 1
  • 16
  • 33
  • Woops, not exactly a duplicate, but see this if it helps... http://stackoverflow.com/questions/895548/subversion-ignore-modifications-to-a-file-locally-on-one-client-only – J.N. Nov 23 '12 at 17:05
  • [Subversion FAQ](http://subversion.apache.org/faq.html#ignore-commit) repeats @J.N. solution – Lazy Badger Nov 23 '12 at 18:11

3 Answers3

3

Some solutions

  • Windows-only TortoiseSVN solution (you didn't mention your client-side tools)

Use ignore-on-commit changelist TSVN feature (yes, on every client)

  • Lock file

While not widely-used, lock-model (instead of branch-merge) still exist in Subversion. You can commit and lock (and never unlock) your file. If lock will be performed under special "locker" user, nobody will be able break locking by mistake


On the rights of delusional raving

  • Mercurial as SVN-client

hg ci -X filename will exclude versioned filename from commited changeset, even if filename was changed, ci -X may be defined as replacement-alias for ususal ci

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
1

I fear this is not possible.

Usually, the process is to create a "distribution" version of the file with a different extension and svn ignore the normal one. Upon a new checkout, you have to manually copy the "dist" file to its final name.

I often use this for my makefile configuration:

  • makefile.conf.dist -- the base version that's committed
  • makefile.conf -- the actual file read by the build system, not committed

If you can accept this for a single machine have a look at this question.

Community
  • 1
  • 1
J.N.
  • 8,203
  • 3
  • 29
  • 39
1

I happen to have a pre-commit hook that will do exactly what you want. You could set it up, so only you have the ability to make changes on this file. It also can make sure that files have the right properties set on them, and even completely ban new files based upon their name.

It requires Perl which comes with all Unix and Linux distros, and the Mac. You can also get Perl for Windows. The hook requires no non-standard Perl modules. However, it can use Net::LDAP (an optional module), so you can set permissions according to your LDAP groups (like if you use Windows Active Directory).

David W.
  • 105,218
  • 39
  • 216
  • 337