Remove "dirty" in boot message

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

Remove "dirty" in boot message

Post by bradstew » Thu Sep 03, 2020 4:51 pm

Hi,
I've built a few micropython kernels for the STM32F405 boards using the PYBV11 as a template. However, the message listed on boot says something like "dirty-xxxx" where xxxx appears to be some hash.

If I remove the .git folder, this goes away. Is there some flag I can set so I can leave the .git directory and remove the "dirty" word?
Thanks,
Brad

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Remove "dirty" in boot message

Post by stijn » Thu Sep 03, 2020 6:08 pm

'dirty' probably means you have modified files, with respect to the last commit in git. Committing those changes, or undoing them, would make the 'dirty' go away. Not sure how much you know about git, but you'd run e.g 'git status' on the commandline when in the micropython directory to see which files are modified, 'git diff' to see the changes, etc.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Remove "dirty" in boot message

Post by Roberthh » Thu Sep 03, 2020 8:25 pm

I see the same. If I run git diff, it tells me:

Code: Select all

	geändert:       ../../lib/axtls (geänderter Inhalt)
	geändert:       ../../lib/libffi (geänderter Inhalt)
	geändert:       ../../lib/lwip (geänderter Inhalt)
	geändert:       ../../lib/mbedtls (geänderter Inhalt)
	geändert:       ../../lib/nrfx (geänderter Inhalt)
	geändert:       ../../lib/tinyusb (geänderter Inhalt, unversionierter Inhalt)
So its the lib directories, which change after building locally.

Note:
geändert = changed, geänderter Inhalt = changed content

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Remove "dirty" in boot message

Post by stijn » Sat Sep 05, 2020 3:29 pm

Those are submodules, which probably means they have not been updated locally and the upstream uses a newer version. 'git submodule update' should resolve that.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Remove "dirty" in boot message

Post by Roberthh » Sat Sep 05, 2020 3:33 pm

'git submodule update' should resolve that.
Nope

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Remove "dirty" in boot message

Post by Roberthh » Sat Sep 05, 2020 4:55 pm

Ok. What finally worked was a re-initialisation:

Code: Select all

git submodule deinit --all -f
git submodule update --init

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Remove "dirty" in boot message

Post by davef » Sat Sep 05, 2020 7:56 pm

For ESP32 build-generic I got :

Code: Select all

Use '.' if you really want to deinitialize all submodules
Did a bit searching and there seems to have been several changes to this command. I only installed Micropython about a month ago, is my git out of date?

Did:

Code: Select all

git submodule deinit -f .
git submodule update --init
saw a lot of activity but still get:

Code: Select all

MicroPython v1.12-662-g8da40ba-dirty on 2020-09-06; ESP32 module with ESP32

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: Remove "dirty" in boot message

Post by rcolistete » Sat Sep 05, 2020 9:43 pm

What 'git status' shows ?
Last edited by rcolistete on Sun Sep 06, 2020 12:23 am, edited 1 time in total.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Remove "dirty" in boot message

Post by davef » Sat Sep 05, 2020 11:54 pm

Apologies, I now see that there were some left-over changes when I was working on a "black-pill".

Code: Select all

On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   extmod/moduhashlib.c

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	ports/esp32/makefile
	ports/stm32/boards/WEACT_F411CEU6/

no changes added to commit (use "git add" and/or "git commit -a")
I'll sort those.
Thanks

bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

Re: Remove "dirty" in boot message

Post by bradstew » Sun Sep 06, 2020 9:48 pm

I did a "git status" and it did correctly report the changed files. I added an additional directory for my board (which is a derivative of the PYBV11).
My problem is that I would like to update the repo, but I'm scared to do this as I don't want to mess things up.
I do have my own repo (github/aerosynth) but I don't know how to update it from my PC.
Should I commit my files on the host pc then push? It's not clear in any of the git docs I have.
Also, since I forked my repo with the micpython repo, how would I update my own repo? again, I'm scared to mess up the micrpython repo.
Once I do this, will I no longer get "dirty" flags?

Post Reply