#git

gitmodules

A simple regex based parsing library for reading the .gitmodules file of a Git repository

1 unstable release

0.1.0 May 5, 2019

#268 in #git

MIT/Apache

9KB
143 lines

Gitmodules

Gitmodules is a simple parser for reading .gitmodules files.


Gitmodules is a simple Regex based parsing library for reading the .gitmodules file of a Git repository.

Documentation

Module documentation with examples.

License

Gitmodules is licensed under either the

or the


lib.rs:

This crate provides a simple regular expression based parsing library for reading the .gitmodules file of a Git repository.

Usage

Add this to your Cargo.toml:

[dependencies]
gitmodules = "0.1"

Usage is trivial:

use std::io::BufReader;
use gitmodules::{read_gitmodules, Submodule};

fn demo() {
let text = r#"
# this is a comment line
[submodule "foo"]
path = "some/path"
"#
.as_bytes();
let text = BufReader::new(text);
let submodules = read_gitmodules(text).unwrap();
println!("Submodule name {}", submodules.first().unwrap().name());
}

Dependencies

~1–1.4MB
~40K SLoC