Version control

First, sorry, because of my poor English and explanation. This is an edited version of my question after receiving some comments, and I understand that you were confused.

The project I'm working on has about 10 people, and each person will implement the "work" in the project.

  • We share 20 model files (text files)
  • When people "work", they have to directly access the model files and add / delete / edit some lines in the 20 text files above.

Let's pretend that:

  • A implemented work no. 1, 4, 6 and 10.
  • B implemented work no. 2, 3, 7 and 9.
  • ...

A implemented (4) to B implemented (7). In file X, some values ​​/ lines changed to (4) are redefined (7).

Later, when we carry out an assessment of energy conservation and find out (4), in fact, this does not save energy, so we decide to take (4).

So the question is that if we have any version control that can take (4) (implemented by A ) without touching any overridden values ​​/ lines made by (7) (implemented by B ).
In other words, I want to delete all changes made by A to the working number (4) ONLY. Work 1, 6, 10 done by A is still in the model files.

Right now we are using RCS ... but I don’t know if RCS can do this and how? I am considering GIT and SVN. I think that SVN is more appropriate, since all the data in the project is placed in 1 place (1 folder). Our server is Linux Red Hat.

If you have experienced this, share it.

Sorry again and thanks for your time.

+1
source share
3 answers

For configuration, it is better to use the version:

  • template configuration files with only variables in it
  • values ​​of each module separately
  • a script that can recognize which module is running and replace the variable in the template files with actual values

Thus:

  • the actual configuration file (the one that has the values ​​used by the module) is never a version (but always generated).
  • it deals with any organization / module dependencies (since, as Jon mentions in the comment), it is not entirely clear whether you have a common file modified by several modules or the same set of files (modules) in several versions.

If you don’t have the ability to generate files modified at the same time, then the branches are the right solution , so SVN or any DVCS (Git, Mercurial, ...)
This will impose merger overhead to report some of your changes from one branch to another.


The type of selective merge you want is a "negative merge" (in which you change some changes and not others: also called subtractive merge )

Git processes without problems through " rebase --interactive " , where you re-write (you can even change / change one of the commits is replayed).
You will also have the Git revert option if you do not want to rewrite the history of past commits.

I don’t know how RCS will handle this unless you make a new revision by manually comparing the current version with previous versions made with A to remove the correct lines.

+2
source

the general approach when using version control is as follows:

  • You have a trunk with a stable version of the code
  • You have a problem -> you create a branch from your outside line
  • while you fix the problem, you update the changes from the trunk to your branch to stay as close as possible to the stable version → so you will immediately notice that changing stable does not work with your code;)
  • After the problem is fixed / tested (!), You will merge the branch into the trunk

Note:

  • if other developers change the same line of code, there will be conflicts → this will happen and must be processed manually
  • return is also possible.
0
source

To uninstall the version from SVN (I assume it will be something similar to git), you use the following command line in your working copy:

 svn merge -c -4 . 

This will negatively affect version 4 changes on your working copy. After that, you can check the changes and copy them back to the repository.

0
source

Source: https://habr.com/ru/post/1396141/


All Articles