2

I'm checking to choose between a Version Control App based on a particular need:

The source files are generated by a 4GL graphcal client that export script files. The issue is that some code part need to be ignore. here a script's code example:

BEGIN DSRECORD
   Identifier "V0"
   DateModified "1899-12-30"
   TimeModified "00.00.01"
   (...)
   StageXSize "730|48|46|48|48|48|48|48|48|48|48|48|48|48"
   StageYSize "132|48|48|48|48|48|48|48|48|48|48|48|48|48"
   ContainerViewSizing "0083 0345 0569 0735 0000 0001 0183 0680"
END DSRECORD

In that code, the line StageXSize and StageYSize should be ignore be cause each time a developer will move the box (called Stage) these value will change but I don't want to consider it as change of code.

So my question in GIT or in Subversion, does it have a way to specify to ignore a part of the code when compare 2 versions of the script ?

Thx

Hugo
  • 21
  • 1
  • With a [smudge/clean filter](http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html#_tt_filter_tt), you might be able to do this in Git. I don't think it would "ignore" part of that file, but you could in the clean step specify to restore that part of the file. – vcsjones Jun 20 '12 at 14:46

4 Answers4

2

All version control apps I ever heard of only allow ignoring per file, but not ignoring particular lines in a file.

In any VCS, you usually deal with config files (=files which need to be in the repository in some form, but should be editable by any developer without committing the changes) by checking in a "template file" with default values, and let the developer do their changes in a copy of it, which is ignored by the VCS.

Here's an example how to do this:
how to ignore files in kiln/mercurial using tortoise hg "that are part of the repository"

If somehow possible, you should try to treat the whole script file as "config file".

Community
  • 1
  • 1
Christian Specht
  • 33,837
  • 14
  • 123
  • 176
1

I don't think so.

I think the "proper" solution is to split this into two files, and have some part of the build process glue them together into the single file (presumably) needed by your runtime.

That way, each developer can change the smaller file that only contains the StageXSize and StageYSize lines, and simply not commit it.

unwind
  • 364,555
  • 61
  • 449
  • 578
0

Simply answer No. Neither for SVN nor for Git it's possible to ignore parts of a file. You can ignore files.

In SVN via svn:ignore property for a directory in Git via .gitignore file.

khmarbaise
  • 81,692
  • 23
  • 160
  • 199
0

Sounds like the values of StageXSize and StageYSize are config options that shouldn't be hard coded. They should go in a config file like stage.config or some-app.conf

vinnyjames
  • 1,951
  • 16
  • 26