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

git.latest rev=tag fails with old git(1) #30999

Closed
orymate opened this issue Feb 8, 2016 · 3 comments
Closed

git.latest rev=tag fails with old git(1) #30999

orymate opened this issue Feb 8, 2016 · 3 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Milestone

Comments

@orymate
Copy link
Contributor

orymate commented Feb 8, 2016

According to the documentation, from 2015.8 git.latest tries to unset the upstream branch if the specified rev is a tag. This is achieved with the --unset-upstream switch of git branch, which is unavailable before git 1.9.2. The default git package of Ubuntu 12.04 LTS version is bellow this.

Workaround suggested by @BABILEN is to add a patched _states/git.py with s/\['--unset-upstream']/None/' applied.

Reproducing:

# salt precise state.low '{"state": "git", "fun": "latest", "name": "https://github.com/saltstack/pepper.git", "rev": "0.1.0", "target": "/tmp/a"}'
precise:
    ----------
    __run_num__:
        0
    changes:
        ----------
        new:
            https://github.com/saltstack/pepper.git => /tmp/a
    comment:
        error: unknown option `unset-upstream'
        usage: git branch [options] [-r | -a] [--merged | --no-merged]
        [...]
            --merged <commit>     print only merged branches

        Changes already made: https://github.com/saltstack/pepper.git cloned to /tmp/a. Repository was reset to 0.1.0 (d7c2a24).
    duration:
        3434.94
    name:
        https://github.com/saltstack/pepper.git
    result:
        False
    start_time:
        15:51:08.117198

@jfindlay jfindlay added State-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps labels Feb 8, 2016
@jfindlay jfindlay added this to the Approved milestone Feb 8, 2016
@jfindlay
Copy link
Contributor

jfindlay commented Feb 8, 2016

@orymate, thanks for reporting.

jespada added a commit to jespada/salt that referenced this issue Feb 16, 2016
@terminalmage terminalmage modified the milestones: B 2, Approved Feb 18, 2016
@terminalmage terminalmage self-assigned this Feb 18, 2016
terminalmage pushed a commit to terminalmage/salt that referenced this issue Feb 18, 2016
@terminalmage terminalmage added the fixed-pls-verify fix is linked, bug author to confirm fix label Feb 18, 2016
cachedout pushed a commit that referenced this issue Feb 18, 2016
@terminalmage
Copy link
Contributor

This is fixed in #31301. Just FYI, I did some digging and found that --unset-upstream was added in 1.8.0, not 1.9.2.

@wwentland
Copy link
Contributor

Very nice, ta @terminalmage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around State-Module
Projects
None yet
Development

No branches or pull requests

5 participants