0

Might seem like a contradictory question, but hear me out: I have a project with files that constantly change every time I run a program, but I don't need to update the repository every time these files are changed. Think of log files for example. I don't want to keep track of the changes of these files, I just want to keep their existence in the repository. If I restore a project using the repository, I want those ignored files, that were committed at some point, to be restored as well.

Is there a way to "ignore" files that were already committed, without removing them entirely from the repository?

Edit: the suggested similar question, while it deals with a similar situation of not wanting to commit changes to already versioned files, it is specifically about the command line tool and doesn't really go into how the whole "ignore-on-commit" works in TortoiseSVN, which I assume would be the actual solution to my issue. In my case, I tried to use that feature, but for some reason the option is grayed out: enter image description here

Edit 2: Ok, I see now that I need to move the file to a different changelist before that even becomes an option. Still trying to figure out how everything works together, so I'm not quite at the solution yet.

Synn Ko
  • 137
  • 1
  • 15
  • 1
    Does this answer your question? [SVN: Is there a way to mark a file as "do not commit"?](https://stackoverflow.com/questions/635446/svn-is-there-a-way-to-mark-a-file-as-do-not-commit) – Ken White Aug 06 '20 at 21:12
  • @KenWhite It might, I'll take a look at it, thanks. – Synn Ko Aug 08 '20 at 10:08
  • @KenWhite I think I understand now, just want some confirmation. While your suggested question didn't directly answer my question, I think it lead me to the correct path... sorta. So there is the ignore-on-commit changelist that TortoiseSVN always has, but it's just like a regular changelist. All it does is uncheck the items listed in that changelist, so you don't accidentally commit changes of files you don't want in a sea of other files. They're not treated any differently, thus still have that red ! to indicate change, but there is a setting to not mark the folder as such. Is that correct? – Synn Ko Aug 08 '20 at 11:19
  • The ignore-on-commit changelist is special for TortoiseSVN. If you needed to create it yourself and/or it doesn't work as advertised then perhaps you have a very old version that didn't implement it yet. – Álvaro González Aug 10 '20 at 10:28

1 Answers1

0

Log files shouldn't be in the repository to begin with. Start by removing those that are there already; beware though that they'll either disappear or trigger merge conflicts as other team members update their working copy. Then set a proper wildcard in parent directory's svn:ignore property so newly created log files are no longer candidates for commit.

TortoiseSVN has a handy context menu to do both things at once:

Unversion and add to ignore list

Commit changes and you're done.

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
  • I'm sorry but from what I understand, this isn't what I asked for. Whether you think committing log files is a good idea or not is irrelevant to my question. I want to keep files around, whose contents are irrelevant - that's it. The log files were just an example to explain the problem I have. The program I work with keeps modifying files that it needs to function, but the content of those files is irrelevant. The files just have to be there. If I restore the project from the repository, those files will be missing and guess what - the program won't work anymore. – Synn Ko Aug 08 '20 at 10:07
  • I based my advice in your reference to log files, if it isn't a valid example then this answer isn't relevant to you. Your codebase, as it's now, is not 100% version control friendly so you'll have to resort to hacks like the ignore-on-commit changelist. I suspect what you really need is a build system but that's mere speculation. – Álvaro González Aug 10 '20 at 10:26