1

I have a git repo for my team to track my testing architecture and test cases for a model.

In this repo there is a "special file" that is used to perform the testing, as engineers develop and test out their new test cases this file will be modified.

In order to merge changes to this file, tests will be exported and then added to a merge directory with in the repo.

I was thinking that multiple people could work on the test cases from the same branch, add their test cases to the merge directory and then at some point after one or more pushes from one or more people an assigned person could update the "special file" with the new test cases, and then clear out the merge folder.

In this process I have a few concerns:

  1. Does the process I am describing seem to be somewhat reasonable?

  2. Is it possible to have the test case writers only add/commit/push changes to the merge folder without overwriting the "special file." (at the same time they shouldn't be deleting anyone elses files in this directory I think that git add . testCases\toBeMerged would handle this though Im not completely sure)?

  3. I've found that if a push has been made by one test writer then the next has to pull before he can add his changes. It would be bad if the local special file was overwitten durring the pull process how can I protect it?

  4. There will be times when the test writer will want to "start over" how can I enable them to pull and overwrite all local files in that scenario including the special file?

ryan jones
  • 63
  • 6

1 Answers1

0

It would be bad if the local special file was overwitten durring the pull process how can I protect it?

Then... don't version it. It won't be part of the pull/merge process and won't be impacted/erased.

Instead: generate it, automatically, on checkout, with a smudge script part of a content filter driver, using .gitattributes declaration.

smudge (image from "Customizing Git - Git Attributes", from "Pro Git book")

The generated actual file remains ignored (by the .gitignore): your actual working tree does not get "dirty".

The smudge script:

  • detect the right environment (like the branch, with branch=$(git rev-parse --symbolic --abbrev-ref HEAD))
  • selects the correct value files (like the tests cases "to be merged") and generates the correct file based on the template, during a git checkout.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250