metio / terraform-provider-git

Terraform provider for local Git operations
https://registry.terraform.io/providers/metio/git/
BSD Zero Clause License
6 stars 1 forks source link

git_commit files #231

Closed Flightdeck73 closed 10 months ago

Flightdeck73 commented 10 months ago
data "git_commit" "repo" {
  directory = "."
  revision  = "@"
}

commit_files = substr("${join(", ", [for s in data.git_commit.repo.files : format("%q", s)])}", 0, 126)

commit_files seems to be set with every file in the repo, i would think it would just be the files that were committed. something like : git diff head~1 --name-only

forgot to mention also tried:

data "git_commit" "repo_last_head_rev" {
  directory = "."
  revision  = "HEAD^" // revision  = "HEAD~1"
}
sebhoss commented 10 months ago

Yeah that is what it is supposed to do (ref for me: https://github.com/metio/terraform-provider-git/blob/main/internal/provider/data_source_commit.go#L184). I'll check what's going wrong and let you know - thanks for reaching out & sorry for the trouble!

Flightdeck73 commented 10 months ago

That link doesn't work, pretty good provider btw.

sebhoss commented 10 months ago

That's odd about the link since it points to this very same repository :cold_sweat: however I think I found the root problem of your initial issue in #235 and upstream at https://github.com/go-git/go-git/issues/307

sebhoss commented 10 months ago

OK all tests are passing & the next release will happen on Friday (2024-01-12). Thanks again for opening this issue!

Flightdeck73 commented 10 months ago

That's odd about the link since it points to this very same repository 😰 however I think I found the root problem of your initial issue in #235 and upstream at go-git/go-git#307

Interesting the link works now.. Thanks!

Flightdeck73 commented 10 months ago

OK all tests are passing & the next release will happen on Friday (2024-01-12). Thanks again for opening this issue!

Just tested this and works great. thank you sir