Adding some more
text - bullets and all that
This commit is contained in:
parent
235a6a723f
commit
a449640ed5
13
src/main.rs
13
src/main.rs
@ -1,12 +1,21 @@
|
||||
use git2::Repository;
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
let repo = Repository::open(".")?;
|
||||
let repo = Repository::open(".git")?;
|
||||
let mut revwalk = repo.revwalk()?;
|
||||
revwalk.set_sorting(git2::Sort::TIME)?;
|
||||
|
||||
let revspec = repo.revparse("HEAD")?;
|
||||
let from = revspec.from().ok_or(eyre::anyhow!("could not get HEAD"))?;
|
||||
revwalk.push(from.id())?;
|
||||
|
||||
for rev in revwalk.enumerate() {
|
||||
println!("rev: {})", rev.1?.to_string())
|
||||
let oid = rev.1?;
|
||||
let commit = repo.find_commit(oid)?;
|
||||
let message = commit
|
||||
.message()
|
||||
.ok_or(eyre::anyhow!("could not find message from commit"))?;
|
||||
println!("rev: {}", message)
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user