Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use git binary or fallback to go-git #639

Merged

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Jun 6, 2018

The idea is to rollback to using git binary by default because go-git doesn't support sa few corner cases. If git is not found it will fallback to using go-git with should be ok 99% of the time

Fixes #323, #563 and #623

Signed-off-by: David Gageot david@gageot.net

@dgageot dgageot force-pushed the two-git-are-better-than-one-git branch from bdddeec to 80460fa Compare June 7, 2018 05:04
@dgageot dgageot changed the title [WIP] Use git binary or fallback to go-git Use git binary or fallback to go-git Jun 7, 2018
@dgageot dgageot force-pushed the two-git-are-better-than-one-git branch 9 times, most recently from 60f243c to 5052786 Compare June 9, 2018 06:11
@@ -34,6 +41,45 @@ type GitCommit struct {

// GenerateFullyQualifiedImageName tags an image with the supplied image name and the git commit.
func (c *GitCommit) GenerateFullyQualifiedImageName(workingDir string, opts *TagOptions) (string, error) {
_, err := exec.LookPath("git")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inline

// The file state is dirty. To generate a unique suffix, let's hash all the modified files.
// We add a -dirty-unique-id suffix to work well with local iterations.
fqn := fmt.Sprintf("%s:%s", opts.ImageName, currentTag)
return fqn, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return error? It's always nil

@dgageot dgageot force-pushed the two-git-are-better-than-one-git branch from 5052786 to bc55e50 Compare June 14, 2018 14:53
@dgageot
Copy link
Contributor Author

dgageot commented Jun 14, 2018

@dlorenc Thanks for the review! It should be fixed now.

@dgageot dgageot merged commit 8af8b11 into GoogleContainerTools:master Jun 14, 2018
@dgageot dgageot deleted the two-git-are-better-than-one-git branch December 28, 2018 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants