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

Modules with tags produce 'Update Error' #96

Open
adamj88 opened this issue Jun 1, 2015 · 4 comments
Open

Modules with tags produce 'Update Error' #96

adamj88 opened this issue Jun 1, 2015 · 4 comments

Comments

@adamj88
Copy link

adamj88 commented Jun 1, 2015

I'm using modman to deploy specific versions (tagged as releases) of modules, when running modman update-all these modules produce the following error:

Updating module_name
Could not resolve remote tracking branch, code will not be updated.

ERROR: Error occurred while updating module_name

It appears the following git command is responsible when returning an empty string:

modman/modman

Lines 706 to 714 in d58b80f

###########################################################################
# Get git remote tracking branch or an empty string
get_tracking_branch ()
{
local tracking_branch=$(git rev-parse --symbolic-full-name --abbrev-ref @{u} 2> /dev/null)
if [ -n "$tracking_branch" -a "$tracking_branch" != "@{u}" ]; then
echo $tracking_branch
fi
}

Expected behaviour should be:

Updating module_name Already up-to-date.

or resolving the tag to a commit and updating the module

@Silarn
Copy link
Contributor

Silarn commented Nov 18, 2015

I submitted a pull request a while back which partially resolved this, as this is a case where your repo is not on an actual branch and is instead checked out at a specific commit. (A tag, in your case.)

My code attempts to identify the branch with that commit in it and checkout that branch before updating the code. I had a flaw in my detection though which made it only work for HEAD commits... I just submitted a new PR to fix this.

However, this doesn't include tag detection. I feel like this would require some kind of additional flag to tell modman "hey, keep my repos on any tagged commits" as the default functionality is to run a fetch and pull - which assumes a branch setup.

What sounds better to you?

@colinmollenhour
Copy link
Owner

@adamj88, I believe tags are really meant to be immutable.. That is, version 1.0 should not change but rather should be updated to version 1.1 which gets a new tag. So it should not be up to modman to choose which tag to use if the user chose a tag already. Now if the author of the code is force-pushing tags then they should be using a branch instead like a "1.x" branch that always tracks the latest 1.x tag.

@Silarn
Copy link
Contributor

Silarn commented Nov 20, 2015

I guess this comes down to: If detached heads not being updated is intended functionality, then it should really just be a warning instead of an error when you run an update-all.

Running a direct update on a specific repo could be an error, as doing so suggests the user wants the repo to be updated when it has no clear update path in its current state, however an update-all does not necessarily mean this and should simply give a warning.

@colinmollenhour
Copy link
Owner

Agreed, during update-all an error finding the tracking branch should be just a notice and not an error.

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

No branches or pull requests

3 participants