Skip to content

Add utility to identify branches merged to upstream#3

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/list-merged-branches
Draft

Add utility to identify branches merged to upstream#3
Copilot wants to merge 4 commits intomasterfrom
copilot/list-merged-branches

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 6, 2026

Developers maintaining forks need to identify local branches already merged to zephyrproject-rtos/zephyr for cleanup and tracking.

Implementation

  • scripts/list_merged_branches.py: Uses git branch --merged to detect branches incorporated upstream
  • scripts/list-merged-branches.sh: Shell wrapper for convenience
  • scripts/list_merged_branches.README.md: Documentation with examples

Usage

# Check current branch
python3 scripts/list_merged_branches.py

# Check all local branches
python3 scripts/list_merged_branches.py --all

# Fetch upstream first
python3 scripts/list_merged_branches.py --all --fetch

Prerequisites

git remote add zephyrproject https://github.com/zephyrproject-rtos/zephyr.git
git fetch zephyrproject

Script supports custom remote/branch names via --remote and --branch flags.

Original prompt

I need list of my branches, from the repo, that have aready been merged to zephyrproject


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 6, 2026 08:54
- Created list_merged_branches.py to identify local branches that have been merged upstream
- Added shell wrapper script list-merged-branches.sh for easy usage
- Script supports checking current branch or all branches with --all flag
- Includes --fetch option to update remote before checking
- Provides helpful error messages when remote is not configured

Co-authored-by: de-nordic <56024351+de-nordic@users.noreply.github.com>
- Created comprehensive README with usage examples
- Documented all command-line options
- Included troubleshooting section
- Added examples for common use cases

Co-authored-by: de-nordic <56024351+de-nordic@users.noreply.github.com>
- Replace bare except clauses with 'except Exception'
- Improves error handling to not catch system exits and keyboard interrupts
- Addresses code review feedback

Co-authored-by: de-nordic <56024351+de-nordic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fetch merged branches from zephyrproject Add utility to identify branches merged to upstream Feb 6, 2026
Copilot AI requested a review from de-nordic February 6, 2026 08:58
de-nordic pushed a commit that referenced this pull request Mar 20, 2026
1. Mostly complete.  Supports MPU, userspace, PSPLIM-based stack
guards, and FPU/DSP features.  ARMv8-M secure mode "should" work but I
don't know how to test it.

2. Designed with an eye to uncompromising/best-in-industry cooperative
context switch performance.  No PendSV exception nor hardware
stacking/unstacking, just a traditional "musical chairs" switch.
Context gets saved on process stacks only instead of split between
there and the thread struct.  No branches in the core integer switch
code (and just one in the FPU bits that can't be avoided).

3. Minimal assembly use; arch_switch() itself is ALWAYS_INLINE, there
is an assembly stub for exception exit, and that's it beyond one/two
instruction inlines elsewhere.

4. Selectable at build time, interoperable with existing code.  Just
use the pre-existing CONFIG_USE_SWITCH=y flag to enable it.  Or turn
it off to evade regressions as this stabilizes.

5. Exception/interrupt returns in the common case need only a single C
function to be called at the tail, and then return naturally.
Effectively "all interrupts are direct now".  This isn't a benefit
currently because the existing stubs haven't been removed (see #4),
but in the long term we can look at exploiting this.  The boilerplate
previously required is now (mostly) empty.

6. No support for ARMv6 (Cortex M0 et. al.) thumb code.  The expanded
instruction encodings in ARMv7 are a big (big) win, so the older cores
really need a separate port to avoid impacting newer hardware.
Thankfully there isn't that much code to port (see #3), so this should
be doable.

Signed-off-by: Andy Ross <andyross@google.com>
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.

2 participants