Hi Luca,

On 10/3/22 23:15, Luca Ceresoli wrote:
Hi Quentin,

On Mon,  3 Oct 2022 19:04:01 +0200
"Quentin Schulz" <[email protected]> wrote:

From: Quentin Schulz <[email protected]>

It happened that the git repositories were dirty and resulted in
incorrect files being used. Let's use git clean -ffdx to force a
completely clean git repositories before and after checking out a branch
so that nothing is left from or to another branch build

Cc: Quentin Schulz <[email protected]>
Signed-off-by: Quentin Schulz <[email protected]>
---
  scripts/run-docs-build | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/run-docs-build b/scripts/run-docs-build
index c6b3965..69e3257 100755
--- a/scripts/run-docs-build
+++ b/scripts/run-docs-build
@@ -61,6 +61,7 @@ for branch in 1.46 $(git branch --remote --contains 
"$first_sphinx_commit" --for
echo Building bitbake $branch branch
      git checkout $branch
+    git clean -ffdx
      git checkout origin/master releases.rst
      make clean
      SPHINXOPTS="-j auto" make publish
@@ -80,7 +81,7 @@ for branch in 1.46 $(git branch --remote --contains 
"$first_sphinx_commit" --for
      fi
cp -r ./_build/final/* $outputdir/bitbake/$branch
-    git reset --hard
+    git clean -ffdx

Sure this is correct? 'git clean -ffdx' does not revert changes to
tracked files, be them staged or not.


Nope, not sure this is correct. I misread git clean manpage, we should have a git reset --hard and git clean -ffdx. Now the question is when those are necessary because with this patch we do it twice, before and after the git checkout. I did this because I remember doing checkouts between branches of U-Boot/kernel and while the pre-checkout branch was not dirty, the after-checkout branch was dirty. I assume this might have something to do with build artifacts of the pre-checkout build that weren't .gitignored in the afer-checkout branch? Something that git clean -ffdx should tackle I think.

Sooo, I guess only having git reset --hard and git clean -ffdx before a checkout should be enough and we don't need them both before and after the checkout like I did in this patch?

Cheers,
Quentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#58262): https://lists.yoctoproject.org/g/yocto/message/58262
Mute This Topic: https://lists.yoctoproject.org/mt/94095578/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to