#6 √ resolved
Alex Arnell

Git Module doesn't always fetch tags

Reported by Alex Arnell | May 2nd, 2008 @ 12:40 PM

There are certain cases when git fetch won't follow tags. The attached patch updates the the commands used to fetch from remote repositories so that tags are always fetched. Updated tests are also included.

Comments and changes to this ticket

  • Alex Arnell

    Alex Arnell May 2nd, 2008 @ 12:48 PM

    I guess I should also mention that the submitted patch was generated using the Git Patch format.

  • Jamis Buck

    Jamis Buck May 2nd, 2008 @ 02:25 PM

    I'm not seeing any attached patch?

  • Alex Arnell

    Alex Arnell May 2nd, 2008 @ 02:36 PM

    Not sure why it didn't attach, lets try again...

  • Alex Arnell

    Alex Arnell May 2nd, 2008 @ 02:44 PM

    (from [838f6abd74b4d4244111a698ab8b955fbe678cde]) Make sure git fetches include tags [#6 tagged:committed status:resolved]

    http://github.com/jamis/capistra...

  • Jamis Buck

    Jamis Buck May 2nd, 2008 @ 02:44 PM

      • → State changed from “new” to “resolved”
  • Mislav

    Mislav May 6th, 2008 @ 07:37 AM

    Alex, we're thinking of reverting this change because the "--tags" option might be triggering downloading only tags and not all commits.

    Since tags or branch names are never used in Capistrano commands on remote (only SHA1 IDs), and tags tied to downloaded objects are automatically fetched anyway, IMO the "--tags" option is redundant.

  • Alex Arnell

    Alex Arnell May 6th, 2008 @ 09:25 AM

    Yikes. Fair enough. I suspect that the change to using git-remote-ls

    will make a difference in the original issue I was having. If I

    encounter my original problem, again I will investigate more thoroughly.

    I might be able to replicate the original issue.

  • Alex Arnell

    Alex Arnell May 6th, 2008 @ 08:45 PM

    (from [15e9ed54d8b2db039fbe7dd76413ad92db40fb9a]) Revert "Make sure git fetches include tags"

    This reverts commit 838f6abd74b4d4244111a698ab8b955fbe678cde.

    [#6 tagged:reverted]

    http://github.com/jamis/capistra...

  • David

    David May 7th, 2008 @ 02:26 PM

    I built Capistrano about 30 minutes ago from the github master. Works fine for me. It successfully pulled down my git tag. (I'm using the remote_cache strategy).

    In case anyone else is having finding tags in their remote (origin) repository... local repository git tags are not automatically pushed to a remote repository with "git push". You have to explicitly push the tag to the remote repo. I did this with "git push origin tag-name". "git push --tags" also works.

  • David

    David May 7th, 2008 @ 02:27 PM

    ^^^ In case anyone else is having **trouble** finding tags ... ^^^ :)

  • Alex Arnell

    Alex Arnell May 7th, 2008 @ 11:26 PM

    The problem is not pushing tags into the repository. The problem lies in how Git decides which tags you are interested in when it performs the fetch.

    From the man pages:

    Most of the tags are fetched automatically as branch heads are downloaded, but tags that do not point at objects reachable from the branch heads that are being tracked will not be fetched by this mechanism.

    I can't seem to replicate my initial problem locally. I thought I had tagged something other than the branch HEAD and that tag was not fetched by git. Everything I try locally seems to work, which makes me think that maybe the original problem was an issue with Git itself. I'll compare versions with what is installed on the servers at the office tomorrow.

  • diabolo

    diabolo June 1st, 2008 @ 05:28 AM

    On my setup the --tags option prevents git-fetch from bringing down the latest revision when using a remote-cache. The command capistrano tries to run is

    git fetch --tags origin

    Running

    git fetch origin

    works. I have no idea why this is but I have tried it on Git 1.5.5

    as well as 1.5.4.3. This is on Ubuntu

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments