3

I'm developing a script with (Groovy/Java) which compare two folders and generate a diff patch file in zip format. The thing now is i have to ignore some file within the iteration because they should not be included in the patch file.

Requirement:

Create a configuration file (like gitignore file) which list the path of ignored files in the comparison process.

The problem:

I like to stick at convention/codestyle guidelines but now i cannot find any reference on how should this be done (not the code, i know how to do it) in terms of:

  1. the name, the extention and/or location of the file.
  2. the codestyle, how files should be listed (maybe i should copy gitignore pattern).
  3. Other things to consider.

I hope i've been clear and my question is within SO's topic scope.

Thanks in advance

Community
  • 1
  • 1
Rcordoval
  • 1,932
  • 2
  • 19
  • 25

1 Answers1

2

1 and 2 are addressed in gitignore man page: the .gitignore file would be part of the source files you are scanning and would apply to files from the .gitignore folder and below.

It uses a glob pattern, like fnmatch does (meaning: no regexes).

If it was an actual git repo, git check-ignore -v -- afile could tell you if that file is ignored or not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I'm using [Rational Team Concert](https://en.wikipedia.org/wiki/Rational_Team_Concert) for source control management. Thanks for your help! – Rcordoval Oct 21 '18 at 05:56
  • @Rcordoval So you have .jazzignore files (https://jazz.net/help-dev/clm/index.jsp?topic=%2Fcom.ibm.team.scm.doc%2Ftopics%2Ft_scm_eclipse_ignore.html), not .gitignore. – VonC Oct 21 '18 at 05:58
  • Sure, but **i do** want to include that file in change sets (commits) @VonC – Rcordoval Oct 21 '18 at 06:51
  • @Rcordoval OK, but I haven't much more on the RTC side, I am afraid. – VonC Oct 21 '18 at 06:54
  • I just want to recreate a XXXignore file. But that file should be included on the source code management software, that's all. Thanks again! – Rcordoval Oct 21 '18 at 06:55