chore(copyright): add copyright headers to all source files

This commit is contained in:
zhenyi 2026-06-12 15:06:39 +08:00
parent 70f2f7d63d
commit 44fe5a519b
139 changed files with 278 additions and 0 deletions

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::{Command, Stdio};
use tokio_stream::wrappers::ReceiverStream;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Command;
use crate::bare::GitBare;

View File

@ -1,2 +1,4 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod get_archive;
pub mod list_archive_entries;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::path::{Path, PathBuf};
use crate::error::{GitError, GitResult};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::paginate;

View File

@ -1 +1,3 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod do_blame;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use gix::object::tree::EntryKind;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::{GetBlobRequest, GetRawBlobRequest, GetRawBlobResponse};

View File

@ -1,2 +1,4 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod get_blob;
pub mod get_raw_blob;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{CompareBranchRequest, CompareBranchResponse};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Command;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Command;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::{Branch, GetBranchRequest};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::paginate;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod compare_branch;
pub mod create_branch;
pub mod delete_branch;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Command;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{Branch, GetBranchRequest, SetBranchUpstreamRequest};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
#![allow(clippy::collapsible_if)]
use std::process::Command;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use serde::Deserialize;
use std::collections::HashMap;
use std::fs;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::commit::create_commit::command_ok;
use crate::error::{GitError, GitResult};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::commit::list_commits::read_commit_from_repo;
use crate::diff::get_diff_stats::diff_stats_for_range;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::oid::ZERO_OID;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{Commit, GetCommitRequest};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::{GetCommitAncestorsRequest, GetCommitAncestorsResponse, ListCommitsRequest};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{Commit, ListCommitsRequest, ListCommitsResponse};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod cherry_pick_commit;
pub mod compare_commits;
pub mod count_commits;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::commit::create_commit::command_ok;
use crate::error::{GitError, GitResult};

View File

@ -1 +1,3 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Centralized configuration constants for GitKS.
//!
//! All magic numbers and resource limits are defined here for easy auditing,

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{GetCommitDiffRequest, GetDiffRequest, GetDiffResponse};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::collections::HashMap;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::GetDiffStatsRequest;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{GetPatchRequest, GetPatchResponse};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod changed_paths;
pub mod get_commit_diff;
pub mod get_diff;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Disk-based cache infrastructure for GitKS.
//!
//! Implements the Gitaly-inspired diskcache design:

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub type GitResult<T> = Result<T, GitError>;
#[derive(Debug, thiserror::Error)]

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Hook manager for GitKS.
//!
//! Manages the installation, listing, and removal of git hooks

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Git hooks management for GitKS.
//!
//! Supports three layers of hooks:

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Hook execution runner.
//!
//! Executes server hooks, custom hooks, and gRPC callback hooks

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Hook content sanitization.
//!
//! Validates custom hook scripts to prevent dangerous commands.

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};

2
lib.rs
View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod archive;
pub mod bare;
pub mod config;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Helper macro to extract and validate a revision selector.
//!
//! Replaces the repeated pattern of matching on ObjectSelector variants

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::{CheckMergeRequest, MergeResult, merge_result};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{MergeRequest, MergeResult, merge_result};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::paginate;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod check_merge;
pub mod do_merge;
pub mod list_merge_conflicts;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::commit::create_commit::command_ok;
use crate::error::{GitError, GitResult};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::commit::create_commit::command_ok;
use crate::error::{GitError, GitResult};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Prometheus-compatible metrics for GitKS.
//!
//! Tracks:

2
oid.rs
View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use serde::{Deserialize, Serialize};
/// The null OID representing "no object" in git protocol.

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::{GitError, GitResult};
use crate::pb::{AdvertiseRefsRequest, AdvertiseRefsResponse, ReferenceAdvertisement};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::{FsckRequest, FsckResponse};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::io::Write;
use crate::bare::GitBare;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitError;
use crate::paginate;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod advertise_refs;
pub mod fsck;
pub mod index_pack;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Stdio;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Stdio;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::process::Stdio;
use std::time::Duration;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Pack-objects cache module.
//!
//! Caches `git pack-objects` output on local disk to reduce CPU load

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::{PageInfo, Pagination};
/// Simple offset-based pagination over an in-memory slice.

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
#![allow(clippy::all)]
#![allow(missing_docs)]
#![allow(rustdoc::bare_urls)]

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Repository-level rate limiting via per-repo semaphores.
//!
//! Prevents any single repository from consuming all server resources.

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::paginate;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::ReferenceAdvertisement;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod find_refs;
pub mod list_refs;
pub mod update_refs;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,2 +1,4 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod find_remote;
pub mod mirror;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use std::collections::HashMap;
use std::path::Path;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
pub mod find_license;
pub mod find_merge_base;
pub mod lang_stats;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::bare::GitBare;
use crate::error::GitResult;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! Input sanitization for git subprocess arguments.
//!
//! Prevents command injection by validating user-supplied strings before

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::archive_service_client::ArchiveServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::blame_service_client::BlameServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::branch_service_client::BranchServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
//! In-memory response cache layer for GitKS.
//!
//! Two-tier architecture:

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::commit_service_client::CommitServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::diff_service_client::DiffServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::merge_service_client::MergeServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
/// Single-machine mode: no cluster forwarding.
macro_rules! remote_client {
($fn_name:ident, $client:ty, $svc_label:literal) => {

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use tokio_stream::StreamExt;
use tokio_stream::wrappers::ReceiverStream;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::ref_service_server::RefService;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::remote_service_server::RemoteService;
use crate::pb::*;
use crate::remote::find_remote::{find_remote_repository, find_remote_root_ref};

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::repository_service_client::RepositoryServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::*;
use super::git_cmd;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::tag_service_client::TagServiceClient;
use crate::pb::*;

View File

@ -1,3 +1,5 @@
//! Copyright (c) 2022-2026 GitDataAi All rights reserved.
use crate::pb::tree_service_client::TreeServiceClient;
use crate::pb::*;

Some files were not shown because too many files have changed in this diff Show More