We have a test team using Hp Unified Functional Testing. The test and development teams all share the same Git repository. No one in the test team uses the Git capabilities in HP-UFT, files are commited and pushed outside the tool.
Despite this, HP-UFT (automatically) creates and performs commits of .gitignore files, looking like below. The commits seems to be on a per-project basis, and are cluttering the git log.
#UFT ignore section
*.lck
/Res*
#end UFT ignore section
The commits are not automatically pushed.
The commit message is the same for all commits (and is not very informative):
UFT Commit
How can this wierd behaviour be disabled in Hp Unified Functional Testing (version 12.51)? To be extra clear, what I am looking for is a way to make the tool not perform these commits. I know these files and folders should be ignored, but I would rather manage one single .gitignore file further up in the folder hierarchy.
Googling or reading the User Guide has not been to any help.
I put a bounty on this question, specifying that I would like an answer containing either:
After the bounty expired, no answer fulfills these conditions, therefore I am trying to clarify what kind of answers I want.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
Note that ignores that you don't want to share, e.g. specific configuration files for an IDE that only you use, can be ignored using . git/info/exclude . The format of this file is the same as . gitignore , but this file will never be committed.
There is no straight way to avoid this behaviour in UFT. Actually, you can add your own ignoring rules under "UFT" section. For instance, you can add line
'!/Res1'
and theoretically this will allow to commit '/Res1' folder. Or, you can give another name for Result folder and freely commit it. Only keep in mind that the .lck file shouldn't get to common repository.
And why you need in repository the results of tests from the local machine?
I don't know UFT, but if you have access to the git repo managed by that tool, you might consider setting up a git pre-commit hook (in .git/hooks/pre-commit
), similar to "Use git pre-commit hooks to stop unwanted commits" by Jake McCrary (the script is just an example, and will need to be adapted to your case).
The idea is to look for the list of files which are about to be committed
git diff --cached --name-only --diff-filter=ACM
If that list includes only .gitignore
files, you reject the commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With