tianocore / edk2-edkrepo

Repository for the edkrepo utility
Other
21 stars 24 forks source link

Add "edkrepo clean" support for "-ff" option. #173

Open ndhaller opened 1 year ago

ndhaller commented 1 year ago

Add "edkrepo clean" support for "-ff" option.

"git clean" supports "-f" and "-ff".
https://git-scm.com/docs/git-clean "Git will refuse to modify untracked nested git repositories (directories with a .git subdirectory) unless a second -f is given."

With edkrepo 3.1.1, "edkrepo clean" does not error when "-ff" is used, but only supports the behavior of "-f".

example edk2 test setup:

Create a Combination that uses enableSubmodule on newer edk2 stable tag.

<Source localRoot="Edk2" remote="Edk2Repo" tag="edk2-stable202305" enableSubmodule="true" />

Manually checkout older Edk2 stable tag.

git checkout edk2-stable202105
git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        MdePkg/Library/BaseFdtLib/
        MdePkg/Library/MipiSysTLib/
        UnitTestFrameworkPkg/Library/GoogleTestLib/
        UnitTestFrameworkPkg/Library/SubhookLib/

"edkrepo clean -ffd" runs, but does not remove Untracked files.

"git clean -ffd" runs, and removes Untracked files.