Include git commit and worktree status in version output #1060

Merged
merged 1 commit into from Jun 12, 2016

Projects

None yet

2 participants

@kamalmarhubi
Contributor

This will help in debugging issues as rustfmt gets more users.

If the working tree is clean, output looks like

$ target/debug/rustfmt -V
0.5.0 (9f5ed3b)

If the working tree is dirty, output looks like

$ target/debug/rustfmt -V
0.5.0 (9f5ed3b worktree dirty)

If git is unavailable, output looks like

$ target/debug/rustfmt -V
0.5.0 (git commit unavailable)

To avoid rebuilds on changing tests, the build script will only rerun if
files under src/ are changed. This means the actual git status may show
changed files and this would not show up in the version. This should not
be an issue as files not in src/ should not affect the build output.

@kamalmarhubi
Contributor

I suggest testing this yourself before merging. You can check it out with git fetch origin refs/pull/1060/head && git checkout FETCH_HEAD.

@marcusklaas
Contributor

👍

@kamalmarhubi kamalmarhubi Include git commit and worktree status in version output
This will help in debugging issues as rustfmt gets more users.

If the working tree is clean, output looks like

    $ target/debug/rustfmt -V
    0.5.0 (9f5ed3b)

If the working tree is dirty, output looks like

    $ target/debug/rustfmt -V
    0.5.0 (9f5ed3b worktree dirty)

If git is unavailable, output looks like

    $ target/debug/rustfmt -V
    0.5.0 (git commit unavailable)

To avoid rebuilds on changing tests, the build script will only rerun if
files under src/ are changed. This means the actual git status may show
changed files and this would not show up in the version. This should not
be an issue as files not in src/ should not affect the build output.
9e203a4
@marcusklaas marcusklaas merged commit 5361f61 into rust-lang-nursery:master Jun 12, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment