Skip to content
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

compare: add --decorate #662

Merged
merged 1 commit into from
May 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/west/app/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,19 @@ def print_rev_info(self, project):
return

def rev_info(rev):
return project.git(
['log', '-1', '--color=never', '--pretty=%h %s', rev],
title = project.git(
['log', '-1', '--color=never', '--pretty=%h%d %s',
'--decorate-refs-exclude=refs/heads/manifest-rev',
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you check that this doesn't introduce a requirement for a more recent version of git?

Copy link
Collaborator Author

@marc-hb marc-hb May 11, 2023

Choose a reason for hiding this comment

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

No I hadn't, my bad. These options were introduced in git commit v2.16.0-rc0~64^2 git/git@65516f586b69307f977

Git 2.16.0 was released in January 2018, 5+ years ago.

I couldn't find what is the minimum git version required by west, where is it defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine then; we have a if self.git_version_info < (2, 22): check up on line 659.

rev],
capture_stdout=True,
capture_stderr=True).stdout.decode().rstrip()
# "HEAD" is special; '--decorate-refs-exclude=HEAD' doesn't work.
# Fortunately it's always first.
return (
title.replace('(HEAD) ', '').replace('(HEAD, ', '(')
.replace('(HEAD -> ', '(')
)

head_info = rev_info('HEAD')
# If manifest-rev is missing, we already failed earlier.
manifest_rev_info = rev_info('manifest-rev')
Expand Down
Loading