-
Notifications
You must be signed in to change notification settings - Fork 34
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
Feature: Add Ability to create recipe with specific commits #117
base: master
Are you sure you want to change the base?
Conversation
git_repo = Evm::Git.new(build_path) | ||
if git_repo.exist? | ||
git_repo.pull | ||
if git_repo.exist? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation appears to have been broken here.
args = 'clone', url, @path | ||
args << "--branch=#{branch}" if branch | ||
if commit == nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nil?
is more Ruby-ish? Maybe cleaner to pass this in as a boolean instead of the (unused) actual commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why reset
instead of checkout
?
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.