Skip to content

Conversation

mbolivar
Copy link
Contributor

Fixes: #380

I've tested the following matrix of west updates:

{descendant branch checked out + dirty tree,
detached head + dirty tree,
branch checked out + clean tree,
detached descendant HEAD + clean tree}

x

{default behavior,
--keep-descendants,
--rebase}

And the output always warns when something surprising happens. The win is mostly due to removing the --quiet from the 'git checkout --detach' and letting git do the work for us.

I want to backport these changes to 0.7.2, so I'm intentionally preserving the existing --keep-descendants behavior. We can defer changes to that to 0.8.0 pending resolution of #381.

Nobody is using the MANIFEST variable.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Make the 'west update' output more helpful:

- If --keep-descendants is given, also run 'git status' to highlight a
  dirty tree, etc. Also make the west output prefixed by 'west update';
  it's clear what project is being worked on due to the earlier banner.

- if --rebase is given, do the same change to just use 'west update'
  as an output prefix.

- if neither is given, remove --quiet and the small_banner() call. This
  also shows information about a dirty tree.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
@carlescufi
Copy link
Member

LGTM, thanks. This is enough for the time being.

@carlescufi
Copy link
Member

Forgot to say, tested both with local uncommitted changes and with an extra commit on a detached HEAD.

if take_stats:
start = perf_counter()
project.git('checkout --detach --quiet ' + sha)
project.git('checkout --detach ' + sha)
Copy link
Collaborator

Choose a reason for hiding this comment

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

unsure if this could become too noisy to some users.
But, only one way to find out.

Alternative could be to do this when -v is given.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the same number of lines of output when the tree is clean

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.

west update is not verbose enough by default

4 participants