Skip to content

A few trivial fixes #17691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

A few trivial fixes #17691

wants to merge 2 commits into from

Conversation

yf13
Copy link
Contributor

@yf13 yf13 commented Jul 16, 2025

Summary

This contains some trivial fixes met during my learning journey.

Testing

Checked with UNIX port on Ubuntu 22.04.

yf13 added 2 commits July 16, 2025 17:04
This mutes usage error for blobless update from older `git` to
reduce noise upon submodule updating.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This aligns the prefix string in L285 to that in L284 though the
two strings have equal length.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.44%. Comparing base (5e9189d) to head (8a17b87).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17691   +/-   ##
=======================================
  Coverage   98.44%   98.44%           
=======================================
  Files         171      171           
  Lines       22204    22208    +4     
=======================================
+ Hits        21859    21863    +4     
  Misses        345      345           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@@ -268,7 +268,7 @@ submodules:
$(ECHO) "Updating submodules: $(GIT_SUBMODULES)"
ifneq ($(GIT_SUBMODULES),)
$(Q)cd $(TOP) && git submodule sync $(GIT_SUBMODULES)
$(Q)cd $(TOP) && git submodule update --init --filter=blob:none $(GIT_SUBMODULES) || \
$(Q)cd $(TOP) && git submodule update --init --filter=blob:none $(GIT_SUBMODULES) 2>/dev/null || \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is an error, I think the stderr output would be useful to understand what went wrong.

@yf13
Copy link
Contributor Author

yf13 commented Jul 17, 2025

@dlech, thanks for the comment.

Here is what I got usually from master branch:

$ git switch master
Switched to branch 'master'
Your branch is up to date with 'upstream/master'.
yf@r7:icropython$ make -C ports/unix submodules
make: Entering directory '/home/yf/Projects/micropython/ports/unix'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Updating submodules: lib/mbedtls lib/berkeley-db-1.xx lib/micropython-lib
Synchronizing submodule url for 'lib/berkeley-db-1.xx'
Synchronizing submodule url for 'lib/mbedtls'
Synchronizing submodule url for 'lib/micropython-lib'
usage: git submodule [--quiet] [--cached]
   or: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--[no-]single-branch] [--] [<path>...]
   or: git submodule [--quiet] set-branch (--default|--branch <branch>) [--] <path>
   or: git submodule [--quiet] set-url [--] <path> <newurl>
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
make: Leaving directory '/home/yf/Projects/micropython/ports/unix'
yf@r7:icropython$

And here is the output after the change:

 git switch pull-cosmetics
Switched to branch 'pull-cosmetics'
Your branch is up to date with 'origin/pull-cosmetics'.
yf@r7:icropython$
$ make -C ports/unix submodules
make: Entering directory '/home/yf/Projects/micropython/ports/unix'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Updating submodules: lib/mbedtls lib/berkeley-db-1.xx lib/micropython-lib
Synchronizing submodule url for 'lib/berkeley-db-1.xx'
Synchronizing submodule url for 'lib/mbedtls'
Synchronizing submodule url for 'lib/micropython-lib'
make: Leaving directory '/home/yf/Projects/micropython/ports/unix'

Note that the operation actually succeeds in my case, but it shows an error which may waste users' time.

On the other hand, if there is really an error stopping git operations, then both operations will fail and stderr of the last use will still show.

@dlech
Copy link
Contributor

dlech commented Jul 17, 2025

Ah, I missed the || logic. I guess you have an older git that doesn't support the --filter option. So your proposed change makes sense now. 👍

@Josverl
Copy link
Contributor

Josverl commented Jul 17, 2025

Ah, I missed the || logic. I guess you have an older git that doesn't support the --filter option. So your proposed change makes sense now. 👍

I still think the cure is more dangerous than the issue as it may/will hide other issues

@dlech
Copy link
Contributor

dlech commented Jul 17, 2025

I think it is OK in this case since it essentially calls the same command again if the first one fails - the only difference being the --filter arg. So if there is another problem, the second call should have the same error message and there is no sense in printing it twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy