Skip to content

Commit

Permalink
Merge branch 'main' into repo-status
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Zepeda committed Apr 18, 2022
2 parents da8059c + cd723b5 commit 9679d6b
Show file tree
Hide file tree
Showing 42 changed files with 979 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: "gitoxide cargo-smart-release"
args: "--force gitoxide cargo-smart-release"

lint:
runs-on: ubuntu-latest
Expand Down
83 changes: 76 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,12 @@ members = [
"git-packetline",
"git-mailmap",
"git-note",
"git-sec",
"git-lfs",
"git-rebase",
"git-submodule",
"git-transport",
"git-credentials",
"git-protocol",
"git-pack",
"git-odb",
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ check: ## Build all code in suitable configurations
cd git-object && cargo check --all-features \
&& cargo check --features verbose-object-parsing-errors
cd git-index && cargo check --features serde1
cd git-credentials && cargo check --features serde1
cd git-sec && cargo check --features serde1
cd git-revision && cargo check --features serde1
cd git-attributes && cargo check --features serde1
cd git-glob && cargo check --features serde1
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,14 @@ Crates that seem feature complete and need to see some more use before they can
* [git-attributes](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-attributes)
* [git-quote](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-quote)
* **idea**
* [git-credentials](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-credentials)
* [git-sec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-sec)
* [git-note](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-note)
* [git-date](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-date)
* [git-lfs](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-lfs)
* [git-rebase](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-rebase)
* [git-pathspec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-pathspec)
* [git-subomdule](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-submodule)
* [git-submodule](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-submodule)
* [git-tui](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-tui)
* [git-tix](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-tix)
* [git-bundle](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-bundle)
Expand Down
7 changes: 7 additions & 0 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ A mechanism to associate metadata with any object, and keep revisions of it usin

### git-date
* [ ] parse git dates

### git-credentials
* [x] launch git credentials helpers with a given action

### git-sec

Provides a trust model to share across gitoxide crates. It helps configuring how to interact with external processes, among other things.

### git-rebase
* [ ] obtain rebase status
Expand Down
7 changes: 6 additions & 1 deletion etc/check-package-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu -o pipefail

function enter () {
local dir="${1:?need directory to enter}"
echo $' in' $dir
echo -n $' in' $dir $'\t\t'
cd $dir
}

Expand Down Expand Up @@ -36,6 +36,11 @@ echo "in root: gitoxide CLI"
(enter git-traverse && indent cargo diet -n --package-size-limit 10KB)
(enter git-url && indent cargo diet -n --package-size-limit 15KB)
(enter git-validate && indent cargo diet -n --package-size-limit 5KB)
(enter git-date && indent cargo diet -n --package-size-limit 5KB)
(enter git-note && indent cargo diet -n --package-size-limit 5KB)
(enter git-sec && indent cargo diet -n --package-size-limit 5KB)
(enter git-tix && indent cargo diet -n --package-size-limit 5KB)
(enter git-credentials && indent cargo diet -n --package-size-limit 5KB)
(enter git-object && indent cargo diet -n --package-size-limit 25KB)
(enter git-commitgraph && indent cargo diet -n --package-size-limit 25KB)
(enter git-pack && indent cargo diet -n --package-size-limit 115KB)
Expand Down
2 changes: 2 additions & 0 deletions git-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]

[dependencies]
git-features = { version = "^0.20.0", path = "../git-features"}
git-sec = { version = "^0.1.0", path = "../git-sec" }

dirs = "4"
nom = { version = "7", default_features = false, features = [ "std" ] }
memchr = "2"
Expand Down
65 changes: 59 additions & 6 deletions git-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,65 @@ pub mod fs;
pub mod parser;
pub mod values;

// mod de;
// mod ser;
// mod error;
// pub use de::{from_str, Deserializer};
// pub use error::{Error, Result};
// pub use ser::{to_string, Serializer};
mod permissions {
use crate::Permissions;

impl Permissions {
/// Allow everything which usually relates to a fully trusted environment
pub fn all() -> Self {
use git_sec::Permission::*;
Permissions {
system: Allow,
global: Allow,
user: Allow,
repository: Allow,
worktree: Allow,
env: Allow,
includes: Allow,
}
}

/// If in doubt, this configuration can be used to safely load configuration from sources which is usually trusted,
/// that is system and user configuration. Do load any configuration that isn't trusted as it's now owned by the current user.
pub fn secure() -> Self {
use git_sec::Permission::*;
Permissions {
system: Allow,
global: Allow,
user: Allow,
repository: Deny,
worktree: Deny,
env: Allow,
includes: Deny,
}
}
}
}

/// Configure security relevant options when loading a git configuration.
#[derive(Copy, Clone, Ord, PartialOrd, PartialEq, Eq, Debug, Hash)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
pub struct Permissions {
/// How to use the system configuration.
/// This is defined as `$(prefix)/etc/gitconfig` on unix.
pub system: git_sec::Permission,
/// How to use the global configuration.
/// This is usually `~/.gitconfig`.
pub global: git_sec::Permission,
/// How to use the user configuration.
/// Second user-specific configuration path; if `$XDG_CONFIG_HOME` is not
/// set or empty, `$HOME/.config/git/config` will be used.
pub user: git_sec::Permission,
/// How to use the repository configuration.
pub repository: git_sec::Permission,
/// How to use worktree configuration from `config.worktree`.
// TODO: figure out how this really applies and provide more information here.
pub worktree: git_sec::Permission,
/// How to use the configuration from environment variables.
pub env: git_sec::Permission,
/// What to do when include files are encountered in loaded configuration.
pub includes: git_sec::Permission,
}

#[cfg(test)]
pub mod test_util;
29 changes: 29 additions & 0 deletions git-credentials/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.0.0 (2022-04-15)

An empty crate without any content to reserve the name for the gitoxide project.

### Commit Statistics

<csr-read-only-do-not-edit/>

- 1 commit contributed to the release.
- 0 commits where understood as [conventional](https://www.conventionalcommits.org).
- 1 unique issue was worked on: [#386](https://github.com/Byron/gitoxide/issues/386)

### Commit Details

<csr-read-only-do-not-edit/>

<details><summary>view details</summary>

* **[#386](https://github.com/Byron/gitoxide/issues/386)**
- add frame for git-credentials crate ([`be7a9cf`](https://github.com/Byron/gitoxide/commit/be7a9cf776f958ac7228457bb4e1415f86f8e575))
</details>

0 comments on commit 9679d6b

Please sign in to comment.