Page 1 of 1

esp-idf git tree becomes dirty after git pull latest code

Posted: Thu Aug 20, 2020 10:50 am
by axellin
I'm using git master tree, after 'git pull' and 'git submodule update' the tree becomes dirty.
Is there any thing wrong from the components/nghttp/nghttp2 upstream?

axel@phoenix:~/esp/esp-idf$ git describe --tags
v4.3-dev-907-g6c17e3a64c02

axel@phoenix:~/esp/esp-idf$ git diff
diff --git a/components/nghttp/nghttp2 b/components/nghttp/nghttp2
--- a/components/nghttp/nghttp2
+++ b/components/nghttp/nghttp2
@@ -1 +1 @@
-Subproject commit 8f7b008b158e12de0e58247afd170f127dbb6456
+Subproject commit 8f7b008b158e12de0e58247afd170f127dbb6456-dirty

axel@phoenix:~/esp/esp-idf$ cd components/nghttp/nghttp2/
axel@phoenix:~/esp/esp-idf/components/nghttp/nghttp2$ git status
HEAD detached at 8f7b008b158e
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: third-party/mruby (new commits)
modified: third-party/neverbleed (new commits)

no changes added to commit (use "git add" and/or "git commit -a")

Re: esp-idf git tree becomes dirty after git pull latest code

Posted: Thu Aug 20, 2020 1:33 pm
by chegewara
axellin wrote:
Thu Aug 20, 2020 10:50 am
axel@phoenix:~/esp/esp-idf/components/nghttp/nghttp2$ git status
HEAD detached at 8f7b008b158e
You are not in master branch.

Code: Select all

git checkout master

Re: esp-idf git tree becomes dirty after git pull latest code

Posted: Thu Aug 20, 2020 1:47 pm
by axellin
chegewara wrote:
Thu Aug 20, 2020 1:33 pm
axellin wrote:
Thu Aug 20, 2020 10:50 am
axel@phoenix:~/esp/esp-idf/components/nghttp/nghttp2$ git status
HEAD detached at 8f7b008b158e
You are not in master branch.
I'm sure I'm in esp-idf master.

https://github.com/espressif/esp-idf/tr ... nts/nghttp
It shows nghttp2 @ 8f7b008

Re: esp-idf git tree becomes dirty after git pull latest code

Posted: Thu Aug 20, 2020 1:56 pm
by boarchuz
git submodule update --recursive

Re: esp-idf git tree becomes dirty after git pull latest code

Posted: Fri Aug 21, 2020 4:29 am
by devanl
So, depending on how far you jumped when migrating to master, in some cases, the submodule dependencies of another submodule may have changed and left behind a submodule directory whose contents git suddenly no longer is tracking as a submodule.

That can lead to the behavior you see where you have properly done a

Code: Select all

git submodule update --init --checkout --recursive
And there are still unexpected changes deep down in one of the submodules.

You can see discussion on different approaches to cleaning up those submodules, including the somewhat scary option of doing a submodule recursive git clean with two -f flags to force it to really remove old submodules that are left behind:
https://gist.github.com/nicktoumpelis/11214362

Personally, I'm not so confident that I would actually do the submodule recursive git clean from the ESP IDF repo root. I would just do it from one of the submodules closer to the actual changed module where I'm less concerned about the likelihood of blowing away something important.

Re: esp-idf git tree becomes dirty after git pull latest code

Posted: Fri Aug 21, 2020 5:33 am
by axellin
boarchuz wrote:
Thu Aug 20, 2020 1:56 pm
git submodule update --recursive
This works, thanks.