1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # blame-rs
//!
//! A Rust library for line-by-line authorship tracking in revisioned text content.
//!
//! This crate provides a blame/annotate algorithm that determines which revision
//! introduced each line in a document by analyzing a sequence of revisions.
//!
//! ## Features
//!
//! - **Generic metadata**: Attach any metadata type to revisions (commit hashes, authors, timestamps, etc.)
//! - **Multiple diff algorithms**: Support for Myers and Patience algorithms via the `similar` crate
//! - **Forward tracking**: Efficiently traces line origins from oldest to newest revision
//! - **Zero-copy optimization**: Uses string slices (`&str`) to avoid unnecessary allocations
//! - **Shared metadata**: Reference-counted metadata sharing reduces memory usage
//! - **Pre-allocated vectors**: Minimizes heap allocations during processing
//!
//! ## Example
//!
//! ```rust
//! use blame_rs::{blame, BlameRevision};
//! use std::rc::Rc;
//!
//! #[derive(Debug)]
//! struct CommitInfo {
//! hash: String,
//! author: String,
//! }
//!
//! let revisions = vec![
//! BlameRevision {
//! content: "line 1\nline 2",
//! metadata: Rc::new(CommitInfo {
//! hash: "abc123".to_string(),
//! author: "Alice".to_string(),
//! }),
//! },
//! BlameRevision {
//! content: "line 1\nline 2\nline 3",
//! metadata: Rc::new(CommitInfo {
//! hash: "def456".to_string(),
//! author: "Bob".to_string(),
//! }),
//! },
//! ];
//!
//! let result = blame(&revisions).unwrap();
//! for line in result.lines() {
//! println!("{}: {}", line.revision_metadata.author, line.content);
//! }
//! ```
pub use ;
pub use ;