question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

west update: generalize -k / -r to include commits, not just branches

See original GitHub issue

This 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.

cc: @carlescufi @tejlmand @marc-hb

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marc-hbcommented, Feb 14, 2020

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. Does west have the ability to “successfully west rebase all repos or none”? Part of why we have manifests is to control dependencies across repos. #338 is related.

0reactions
marc-hbcommented, Jan 11, 2021

Mere bidirectional link to related https://github.com/zephyrproject-rtos/zephyr/pull/31201 doc: west: add note about west update --keep-descendants option #31201

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found