Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/dogfood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,17 @@ jobs:
fetch-depth: 0
- name: Dogfooding Docker
run: make dogfood-docker FROM="origin/${{ github.base_ref }}"

binary:
name: Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code.
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Compile.
run: make release
- name: Check clean Git history.
run: RUST_LOG=trace ./target/x86_64-unknown-linux-musl/release/clean_git_history --verbose "origin/${{ github.base_ref }}"
2 changes: 1 addition & 1 deletion .github/workflows/git-history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check clean Git history.
run: clean_git_history "origin/${{ github.base_ref }}"
run: clean_git_history --verbose "origin/${{ github.base_ref }}"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ publish-crate:
.PHONY: dogfood-docker
dogfood-docker: release
docker build -t clean_git_history -f Dockerfile .
docker run $(DOCKER_RUN_WRITE_OPTS) clean_git_history --verbose $(FROM)
docker run $(DOCKER_RUN_OPTS) clean_git_history --verbose $(FROM)

.PHONY: publish-docker
publish-docker: release
Expand Down
24 changes: 24 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,30 @@ fn main() {
}

fn run(arguments: Arguments) -> Result<()> {
// Debug: Dump git configuration to help diagnose ownership issues
debug!("Current working directory: {:?}", std::env::current_dir());
debug!("USER environment variable: {:?}", std::env::var("USER"));
debug!("HOME environment variable: {:?}", std::env::var("HOME"));

// Dump git config to see what safe directories are configured
if let Ok(output) = std::process::Command::new("git")
.args(&["config", "--list", "--show-origin"])
.output()
{
debug!(
"Git config output:\n{}",
String::from_utf8_lossy(&output.stdout)
);
if !output.stderr.is_empty() {
debug!(
"Git config stderr:\n{}",
String::from_utf8_lossy(&output.stderr)
);
}
} else {
debug!("Failed to run git config command");
}

let repository = Repository::open_from_env().context("Unable to open the Git repository.")?;
let commits = Commits::from_git(&repository, arguments.from)?;

Expand Down
Loading