Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ConDec-498: Manage file system directories for branches of git reposi…
…tories (#137) * CONDEC-498: manage paths for git repo branches * GitRepositoryFSManager class for given project, git uri and default branch name should return a unique path on server's file system. * assuming usage of multiple independent gitclient instances in this project, branches should be checked-out in their own folders on the file system to prevent conflicts with work on other branches. GitRepositoryFSManager arranges the file system and provides interfaces which can be later used by Gitclient implementations. [issue] Cloning git repositories costs a lot of time. How can providing branch related folder be accelerated? [/issue] [decision] Copy or rename already existing repository folders to branch dedicated folder, pull updates and checkout the branch files in the dedicated folder![/decision] [pro] Simple but sufficient implementation. [/pro] [con] Inefficient usage of disk space. [/con] [con] Not any more used branches should be recycled or deleted. [/con] [pro] Disk space is cheaper compared to network, RAM and CPU resources.[/pro] [pro] Branch folder recycle strategies could be imlemented.[/pro] * maintain/recycle old branch folders [issue]Not any more used branch folders waste disk space and users most likely will not recycle such folders, how can this be improved? [/issue] [decision]Upon a request for branch folder GitRepositoryFSManager will check if some branch folders are not used for longer time and eventually return them to temporary folders pool! Temporary folders can be reused by future requests and keep the number of folders for given git repository at low level.[/decision] [pro]Relatively simple strategy to implement[/pro] [con]"Longer time" is not defined. Deciding for which parameters a branch folder is not needed any more is not black and white.[/con] [con]Does not help much in some edge cases like when at short period of time many branches were accessed and not manually released by the user/programmer.[/con] [pro]Implementation can begin with last request time for a branch and a fixed look-back-duration constant.[/pro] [alternative]React only if the operating system runs out of space, then delete the oldest branch folder![/alternative] [pro]Once checked out branch is almost forever available on the file system.[/pro] [con]Very dangerous for the machine hosting the solution.[/con] [con]Irresponsive utilization of resources.[/con]
- Loading branch information