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

Allow users to provide '--refs' to 'ls-remote' #494

Merged
merged 1 commit into from
Nov 27, 2020

Conversation

iboB
Copy link
Contributor

@iboB iboB commented Nov 27, 2020

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

Allow passing --refs to ls-remote

The default behavior of ls-remote shows dereferenced tags

Including on this very repo. Try $ git ls-remote https://github.com/ruby-git/ruby-git.git and get ^{} at the end of dereferenceable tags:

...
99b11561a64740285872f4c0a8b72e3e69308ed2        refs/tags/v1.2.9^{}
4bc7f14b62714853c1bd0c53930172356116e6a1        refs/tags/v1.2.9.1
cc6d6efc1b7eaf63609c4c06969b0f839dc80095        refs/tags/v1.2.9.1^{}
03524b251812019da4fed3fc7d6c835f03f47c3d        refs/tags/v1.3.0
a223fcf873bd99658cd1d0bdee1818adc7e3e92c        refs/tags/v1.3.0^{}
...

If one is only interested in tags, the dereferenceable tags get in the way and have to be filtered manually. By allowing the refs option, users can get the tags without having to manually filter the result

Signed-off-by: Borislav Stanimirov <b.stanimirov@abv.bg>
@iboB
Copy link
Contributor Author

iboB commented Nov 27, 2020

also my editor removed trailing whitespaces in test_lib.rb
I hope that's ok

Copy link
Member

@jcouball jcouball left a comment

Choose a reason for hiding this comment

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

Changes look good.

Thanks for removing the extra blanks too. Those date back to 2007 when this gem was first created. Perhaps we should add Rubocop to the project. Here is the current Rubocop status with no configuration:

54 files inspected, 1672 offenses detected, 1404 offenses auto-correctable

After running rubocop -a the tests still pass and results in:

54 files inspected, 399 offenses detected, 133 offenses auto-correctable

After running rubocop -A:

54 files inspected, 268 offenses detected, 3 offenses auto-correctable

However, there are some errors in the unit test suite all of the form:

Error: test_commit(TestBase): FrozenError: can't modify frozen String: ""

Which are probably easily fixed.

@jcouball jcouball merged commit f9abb18 into ruby-git:master Nov 27, 2020
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.

2 participants