Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable automatic commits of .gitignore files?

Tags:

git

hp-uft

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:

  • A way to disable these commits from the tool itself. I know I can do workarounds with git hooks, and other solutions.
  • A link to a trustworthy source specifying that it is not possible to disable this behaviour from the tool.

After the bounty expired, no answer fulfills these conditions, therefore I am trying to clarify what kind of answers I want.

like image 259
Magnilex Avatar asked Oct 07 '16 07:10

Magnilex


People also ask

How do I remove a Gitignore commit?

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.

Do Gitignore files get committed?

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.


2 Answers

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?

like image 109
mpril Avatar answered Oct 20 '22 05:10

mpril


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.

like image 43
VonC Avatar answered Oct 20 '22 05:10

VonC