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

Add info about used git commit into ruff --version if available #11691

Open
qarmin opened this issue Jun 2, 2024 · 3 comments
Open

Add info about used git commit into ruff --version if available #11691

qarmin opened this issue Jun 2, 2024 · 3 comments
Labels
cli Related to the command-line interface

Comments

@qarmin
Copy link

qarmin commented Jun 2, 2024

Currently git version of app, always for ruff --version prints something like

ruff 0.4.7

I think that here could be added more info like

  • git hash of commit
  • type of build - custom build, official build, other
  • build commands

e.g.

ruff 0.4.7, abcdef, custom build
ruff 0.4.7, abcdef, from debian repository
ruff 0.4.7, abcdef, official package
@MichaReiser
Copy link
Member

Uff, that took me a while to figure out myself. You can use ruff version to get the commit number (doesn't work for local builds).

@zanieb
Copy link
Member

zanieb commented Jun 2, 2024

Yeah we added this in #8034

As mentioned there, we could include this for the -V / --version flag. We didn't change it initially to avoid a breaking change for tools that parse the output. I think we should change this to match the uv behavior which is as follows:

❯ uv -V
uv 0.2.3
❯ uv --version
uv 0.2.3 (ce4d862b0 2024-05-24)
❯ uv version
uv 0.2.3 (ce4d862b0 2024-05-24)

@dhruvmanila dhruvmanila added the cli Related to the command-line interface label Jun 3, 2024
@KangOl
Copy link

KangOl commented Jun 3, 2024

I would instead follow the same behavior as python which output the build info when --version (or -V) is provided twice. https://docs.python.org/3/using/cmdline.html#cmdoption-version

❯ python3 --version
Python 3.11.7
❯ python3 --version --version
Python 3.11.7 (main, Dec 18 2023, 10:50:03) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command-line interface
Projects
None yet
Development

No branches or pull requests

5 participants