git_copyright

Crates.iogit_copyright
lib.rsgit_copyright
version0.2.7
sourcesrc
created_at2022-03-07 07:34:57.533224
updated_at2022-03-19 17:02:05.245215
descriptionAdd/update copyright notes based on git history
homepage
repositoryhttps://github.com/sgasse/git-copyright
max_upload_size
id544881
size56,975
(sgasse)

documentation

README

git_copyright

Extract added/last modified times from git history and add/update copyright notes accordingly.

Installation

The easiest way to install git_copyright is via cargo from crates.io:

cargo install git_copyright

If you want to build it from source, clone the repository and then run:

cargo build --release

Running

The only required argument is the name that your copyright should carry, e.g.:

git_copyright --name "MyCompany Ltd."

Additional useful arguments:

  • --repo: Specify a repo-root other than ./.
  • --config: Pass your own YAML config file with comment signs and glob patterns to ignore.
  • --ignore-changes: Do not exit with an error even if tracked files changed.

A full command might look like this:

git_copyright --name "MyCompany Ltd." --repo "../../my_repo" --config "./custom_cfg.yml" --ignore-changes

Run with Docker

You can also use a pre-built image:

docker run --rm -u $(id -u) -v $(pwd):/mnt sgasse/git_copyright:v0.2.7 --name "MyCompany Ltd."

Development

When developing, you can set the log environment variable to see debug log output:

RUST_LOG=debug cargo run -- --repo "../../my_repo" --name "MyCompany Ltd."
Commit count: 26

cargo fmt