tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Unified way to synchronize `.git` in the worktree or test directories

Open lukaszachy opened this issue 1 year ago • 5 comments

Currently we have few options and some auto detection. Would be good to have it under same name and documented behavior to limit surprises.

Motivation to remove this directory is to save disk space and limit the amount of transferred data between host and guests. But sometimes user needs it at guest as well.

At the moment:

  • _initialize_worktree() always skips .git (affects 'prepare', 'finish' and 'discover.shell' without url option)
  • discover.shell has --keep-git-metadata which applies only if 'url' is used, by default .git is removed. There is no way how to keep .git without the 'url' option.
  • discover.fmf has .git always present. Note the --sync-repo exists to copy git root instead of fmf root to the test directory.

The expected behavior:

  • .git is not present in the worktree or test directories unless user asks for it or user uses option which requires .git to be present.
  • Option to keep .git has same name across all plugins (IMO --keep-git-metadata is verbose enough)
  • Prepare and Finish phases should be able to ask for .git to be present as well

lukaszachy avatar Oct 31 '23 12:10 lukaszachy