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

fix git command for dep which points to a tag #481

Merged
merged 4 commits into from
Jul 6, 2017

Conversation

drewbanin
Copy link
Contributor

@drewbanin drewbanin commented Jul 6, 2017

Previously, dbt would silently use origin/master if you tried to specify a tag for a package. This happened because remote_branch was set to origin/{tag-name}, which is not the correct syntax for git reset on a tag.

Instead, we want to use git reset --hard tags/{tag-name}.

Fixes #463

@drewbanin drewbanin added the bug Something isn't working label Jul 6, 2017
@drewbanin drewbanin added this to the 0.8.3 milestone Jul 6, 2017
@drewbanin drewbanin requested a review from cmcarthur July 6, 2017 03:38
@drewbanin drewbanin changed the title fix git command for dep which points to taga fix git command for dep which points to a tag Jul 6, 2017
else:
spec = 'origin/{}'.format(branch)

run_cmd(cwd, ['git', 'reset', '--hard', spec])
Copy link
Member

Choose a reason for hiding this comment

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

can you also check the output of this and fail if this fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmcarthur good idea!

def list_tags(cwd):
out, err = run_cmd(cwd, ['git', 'tag', '--list'])
tags = set(out.decode('utf-8').strip().split("\n"))
return tags
Copy link
Member

Choose a reason for hiding this comment

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

clever

@drewbanin drewbanin merged commit 82580dc into development Jul 6, 2017
@drewbanin drewbanin deleted the fix/git-checkout-tags branch July 6, 2017 20:32
@drewbanin drewbanin self-assigned this Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants