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

EdkRepo: Process Refs By Priority Order in List-Repos and Combo #186

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

ashedesimone
Copy link
Contributor

In the List-Repos command a combo referencing a combination of tag, sha, and branch would only have the branch listed. Update if / elif block to ensure that all ref types are listed

In the combo commmand a combo containing a combination of tag, sha and branch would only show the branch. Update the conditionals such that the printed ref follows EdkRepo's priority order of ref usage (SHA > Tag > Branch)

Fixes #182

ui_functions.print_info_msg(" {} : {}".format(source.root.ljust(length), source.commit), header=False)
elif source.tag:
elif source.tag and not source.commit:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the second part of all of these elif conditions are redundant...

  • not source.commit is implied already if we didn't pass into if source.commit
  • Similarly, not (source.commit or source.tag) is implied if we didn't pass into if source.commit and elif source.tag

Copy link
Contributor Author

@ashedesimone ashedesimone Sep 25, 2023

Choose a reason for hiding this comment

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

Agreed that it appears redundant.

However I felt this was a better way of documenting the priority order than adding a comment while also making the logic future proof if another conditional case were added.

In the List-Repos command a combo referencing a combination of tag,
sha, and branch would only have the branch listed. Update if / elif
block to ensure that all ref types are listed

In the combo commmand a combo containing a combination of tag,
sha and branch would only show the branch. Update the conditionals
such that the printed ref follows EdkRepo's priority order of ref
usage (SHA > Tag > Branch)

Fixes tianocore#182

Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
Reviewed-by: Kevin Sun <kevin.sun@intel.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.

commit, tag, branch priority support in list-repos and 'combo -v' commands
2 participants