west update: generalize -k / -r to include commits, not just branches
See original GitHub issueThis is a behavioral change originally suggested in #380, so I’m opening an issue to solicit feedback.
Currently, west update --keep-descendants
and west update --rebase
only work if there is a branch checked out. They ignore detached heads and do not try to keep or rebase them.
This issue tracks generalizing their behavior to also work when HEAD is detached. We could have a configuration option to keep the old behavior.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Built-in commands - Zephyr Project Documentation
west update --rebase will fail in projects that have git conflicts between your branch and new commits brought in by the manifest. You...
Read more >GitHub pull request showing commits that are already in target ...
One way to fix this is to git rebase targetbranch in that PR. Then git push --force targetbranch , then Github will show...
Read more >More ways to keep your pull request branch up-to-date
To update by rebasing, click the drop down menu next to the Update Branch button, click Update with rebase, and then click Rebase...
Read more >Recovering from the Git detached HEAD state - CircleCI
Git HEAD pointing to the latest commit in feature branch. In this situation, you have two branches, the main branch and a feature...
Read more >Always Squash and Rebase your Git Commits
It's simple – before you merge a feature branch back into your main branch (often master or develop ), your feature branch should...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Having lost detached HEADs many times when using grepo, I couldn’t agree more. grepo’s “solution” to this problem is (was?) “don’t forget to create branches”. This is silly: we use computers precisely because they don’t forget what we do.
The reason users regularly “forget to create branches” is super obvious: it’s simply because plain git uses branches by default whereas grepo and west do not use branches by default. Inconsistent usability - for valid reason(s) I’m sure but inconsistent usability still.
I can think of a possibly simpler/cheaper middle ground between 1. #381 automagically rebasing everything even detached HEADs and 3. #382 just warn when something bad happens: 2. Refuse to
west rebase
if any detached HEAD is found. This could be opt-in in~/.westconfig
By the way I wonder whether west more generally supports the concept of a transactional west update. Last time I tried it did not. A plain git rebase or merge is either successful or it’s not, I mean it either commits all the files or none. Plain git also has the incredibly useful
--abort
feature. Doeswest
have the ability to “successfullywest rebase
all repos or none”? Part of why we have manifests is to control dependencies across repos. #338 is related.Mere bidirectional link to related https://github.com/zephyrproject-rtos/zephyr/pull/31201
doc: west: add note about west update --keep-descendants option #31201