ponder-lab / Rejuvenate-Logging-Levels

An Eclipse plug-in research prototype for automatically rejuvenating log statement levels using degree of interest
Eclipse Public License 2.0
2 stars 3 forks source link

Random git repositories appearing #183

Closed khatchad closed 5 years ago

khatchad commented 5 years ago

I am finding seeminly random .git directories on the machines where we are running the tool. They are appearing in my home directory, workspace directory, and code top-level directories. Is it possible for the tool to create git repositories?

khatchad commented 5 years ago

I wonder if it's Eclipse.

orenwf commented 5 years ago

It doesn't happen when I run N2O, I wonder if it's something to do with the way Logging uses the egit plugin?

yiming-tang-cs commented 5 years ago

.git are hidden on windows. I did not notice it before. I can let the tool create a git repository, but the repo does not have any git history.

khatchad commented 5 years ago

Can the tool create git repositories?

khatchad commented 5 years ago

Seems like this only happens when subprojects are involved. My guess is that this is a situation where the project (subproject here) doesn't have a git repo because it's part of a part that does have a git repo, and this somehow leads to the creating of the fake embedded repo.

yiming-tang-cs commented 5 years ago

Seems like this only happens when subprojects are involved. My guess is that this is a situation where the project (subproject here) doesn't have a git repo because it's part of a part that does have a git repo, and this somehow leads to the creating of the fake embedded repo

You are right.

https://github.com/ponder-lab/Logging-Level-Evolution-Plugin/blob/cbc529262bb2425cb0b40c1204536f2ea899b934/edu.cuny.hunter.mylyngit.core/src/edu/cuny/hunter/mylyngit/core/analysis/GitHistoryAnalyzer.java#L406

The reason that the folder could be in the top-level directory is that the tool also recursively searches the repository file. If it cannot find a repo, it will return the top-level directory and initialize a repo for it.

khatchad commented 5 years ago

Most of these projects have subprojects and we can't have git submodules randomly around.

yiming-tang-cs commented 5 years ago

I have two ideas to fix it.

Option 1: I could let the tool only search the parent file. The tool will not recursively search the top-level file.

Option 2: let the tool recursively search the top-level file until it reaches the workspace directory.

Both of them may miss some projects. Which way do you think it is better?

khatchad commented 5 years ago

To be clear, the behavior should stay the same except for the .git directories being created in sub-projects. Everything else remains the same.

yiming-tang-cs commented 5 years ago

To be clear, the behavior should stay the same except for the .git directories being created in sub-projects. Everything else remains the same.

I see. I should find a solution to let the tool initialize the repo only if the directory is a repo.

yiming-tang-cs commented 5 years ago

I tested selenium and the .git was not created in the directory of subproject. I think this issue is fixed by https://github.com/ponder-lab/Logging-Level-Evolution-Plugin/pull/244

khatchad commented 5 years ago

What happens if there's a .git directory already in a subproject prior to the analysis? Does it remove it?

yiming-tang-cs commented 5 years ago

What happens if there's a .git directory already in a subproject prior to the analysis? Does it remove it?

No, it doesn't remove anything. I tested just now. When the subproject had a .git the directory which was generated by the previous version of code, the tool would throw an exception. Although the subproject has .git directory, the tool doesn't think the subproject directory is a repo directory and throws an exception.