Comments (6)
Sure! I'll try to take a look in the next few days
from changelog.
Whooops, looks like some of our traversal logic might have gone wrong, most likely somewhere here: https://github.com/yoshuawuyts/changelog/blob/master/src/git.rs#L78-L114.
@danreeves would you perhaps like to try and fix this?
from changelog.
@danreeves awesome! -- happy to help if you have any questions! ✨
from changelog.
Spent a little time investigating this morning and found two situations where the logic breaks down.
1. Lightweight tags
Created with git tag [name]
, a lightweight tag doesn't have it's own object, it just points to a commit.
2. Having a single (annotated) tag
In the case where you've only got a single tag the the end
will be a commit object rather than a tag.
For example:
"Expected" output of get_commit_range
:
start: Object { kind: Tag, id: ... }
end: Object { kind: Tag, id: ... }
Output in case 1:
start: Object { kind: Commit, id: ... }
end: Object { kind: Commit, id: ... }
Output in case 2:
start: Object { kind: Tag, id: ... }
end: Object { kind: Commit, id: ... }
Solution
Unfortunately you can't just .as_tag()
a commit object in the case of lightweight tags, and that wouldn't work in the case where an end tag doesn't even exist. Perhaps it might make sense to return something like this from get_commit_range
:
struct CommitRange {
latest_tag: Tag,
start: git2::Commit,
end: git2::Commit,
}
How does that sound?
from changelog.
@danreeves that sounds like a very reasonable solution; I like it!
from changelog.
Resolved by #13
from changelog.
Related Issues (14)
- Print stats HOT 1
- Commit merge body is not trimmed
- Typo in readme: installation with cargo HOT 1
- Add information from GitHub HOT 4
- Fallback if Cargo.toml is not available HOT 3
- Document SemVer API Changes for Rust Projects HOT 1
- Not working when exists Workspace toml file HOT 2
- Feature Request: Don't rely on `Cargo.toml` HOT 16
- Commit links not complete HOT 3
- changelog note generated when going from 0.9.0 to 0.10.0
- Crash on broken pipe HOT 1
- Changelog is created with tagged
- What does this do?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from changelog.