cargo-release icon indicating copy to clipboard operation
cargo-release copied to clipboard

`cargo release changes` only shows commits since `origin/master`

Open jwodder opened this issue 2 years ago • 3 comments

I have a repository with the following history:

* cb9f950 [2023-04-17] (HEAD -> master) Increment version
* baa3c3c [2023-04-17] Set up most of cargo-release
* b02a8c8 [2023-04-17] (origin/master) Give the upload-artifacts job a more human-readable display name
* 8cb75ef [2023-04-17] rm debug
* 246ddf0 [2023-04-17] (tag: v0.1.0) NUL-separate xargs input
* 783af46 [2023-04-17] Remove CRs from jq's output on Windows
* 7b911a3 [2023-04-17] Debug
* 76dcaad [2023-04-17] Fix Windows PowerShell Core envvar syntax
* ec20fd2 [2023-04-17] Workflow fix
* 76a0843 [2023-04-17] Init

(In case it's relevant, the v0.1.0 tag is a signed annotated tag.)

Running cargo release changes -vvvv (using cargo-release v0.24.10) in this repository gives the following output:

[2023-04-17T22:24:19Z DEBUG globset] glob converted to regex: Glob { glob: "**/*", re: "(?-u)^(?:/?|.*/)[^/]*$", opts: GlobOptions { case_insensitive: false, literal_separator: true, backslash_escape: true }, tokens: Tokens([RecursivePrefix, ZeroOrMore]) }
[2023-04-17T22:24:19Z DEBUG globset] built glob set; 0 literals, 1 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes
[2023-04-17T22:24:19Z TRACE cargo_release::ops::git] origin/master: b02a8c8cca13e915a8a375952e81902350cb21de
[2023-04-17T22:24:19Z TRACE cargo_release::ops::git] merge base: b02a8c8cca13e915a8a375952e81902350cb21de
     Changes for cargo-dist-test from v0.1.0 to 0.1.1
             cb9f950 Increment version
             baa3c3c Set up most of cargo-release

As you can see, only the commits after origin/master are shown; based on the fact that cargo release changes --help says "Print commits since last tag", I would have expected it to also show commits b02a8c8 and 8cb75ef.

jwodder avatar Apr 17 '23 22:04 jwodder

All of the code looks correct. To really be able to tell what is going on, we'd need to know what the content of b02a8c8 and 8cb75ef are.

When cargo release changes runs, it filters out commits that do not touch files reported by cargo package --list

epage avatar Apr 18 '23 01:04 epage

Ah, that explains it; the missing commits only touched a GitHub workflow, and I exclude all dot-files and -directories from my crates. Is this aspect of cargo release changes's behavior documented anywhere? I didn't see a mention of this in the reference.

jwodder avatar Apr 18 '23 01:04 jwodder

Its showing you the changes on a per-crate basis. Those changes are not part of the crate, so ergo they won't show up? I think the current framing makes the most sense when working on a workspace. Maybe there are ways to improve it but not having a good idea atm that is clear without being too verbose that it is less likely to be relied on

epage avatar Apr 18 '23 01:04 epage