Feature: Add Ability to create recipe with specific commits#117
Open
larebsyed wants to merge 7 commits intorejeep:masterfrom
Open
Feature: Add Ability to create recipe with specific commits#117larebsyed wants to merge 7 commits intorejeep:masterfrom
larebsyed wants to merge 7 commits intorejeep:masterfrom
Conversation
sambrightman
reviewed
May 1, 2019
| git_repo = Evm::Git.new(build_path) | ||
| if git_repo.exist? | ||
| git_repo.pull | ||
| if git_repo.exist? |
Collaborator
There was a problem hiding this comment.
Indentation appears to have been broken here.
sambrightman
reviewed
May 1, 2019
| def clone(url, branch = nil, commit = nil) | ||
| args = 'clone', url, @path | ||
| args << "--branch=#{branch}" if branch | ||
| if commit == nil |
Collaborator
There was a problem hiding this comment.
I think nil? is more Ruby-ish? Maybe cleaner to pass this in as a boolean instead of the (unused) actual commit?
sambrightman
reviewed
May 1, 2019
Collaborator
sambrightman
left a comment
There was a problem hiding this comment.
Like the idea, feels like implementation could be cleaner. I've only glanced over it though, let me know what I've misunderstood.
| Dir.chdir(@path) do | ||
| git 'pull' | ||
| args = 'pull' | ||
| args = 'pull', '--depth=2000000' if commit |
Collaborator
There was a problem hiding this comment.
This is pretty hacky. Is it really the only way to unshallow the repository? I have a feeling --unshallow --tags works, but haven't tested. The change is not fully described in the commit message, so hard to tell.
| end | ||
| end | ||
|
|
||
| def reset(commit = nil) |
Collaborator
There was a problem hiding this comment.
Why reset instead of checkout?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usecase:
You need to test different committed version of same branch because sometime, a bug is introduced in the latest snapshot branch and we have to track back to commit which was source of the bug.