Merge ~lool/git-build-recipe:fetch-pristine-tar-tags into git-build-recipe:master

Proposed by Loïc Minier
Status: Needs review
Proposed branch: ~lool/git-build-recipe:fetch-pristine-tar-tags
Merge into: git-build-recipe:master
Diff against target: 15 lines (+4/-0)
1 file modified
gitbuildrecipe/recipe.py (+4/-0)
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+443942@code.launchpad.net

Commit message

https://code.launchpad.net/~lool/+recipe/linux-nvidia-tegra-sidecar-daily is failing with:
fatal: ambiguous argument '60ab15c3d7a8c92ccfe8fa7f1d650f3f292141a0^{tree}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: not a valid object name: 60ab15c3d7a8c92ccfe8fa7f1d650f3f292141a0^{tree}

git-build-recipe only fetches some remote branches (and their tags); this extends the logic to fetch more remote tags that could be pristine-tar related

This recipe then fails to build due to other pristine-tar failures, but that's for another pull request

To post a comment you must log in.
Revision history for this message
Hector CAO (hectorcao) wrote :

LGTM, +1
Tested on my local machine, the tags needed by pristine-tar are fetched correctly

Revision history for this message
Richard Hansen (rhansen) (last edit ):
Revision history for this message
Richard Hansen (rhansen) wrote :

I opened an alternative merge request [1] that is the same as this one except:
  - Tags are put in refs/tags/<remote>/* instead of refs/remotes/<remote>/* (to avoid potential name collisions).
  - I added some comments explaining why fetching is done the way it is.
  - I added tests.

[1] https://code.launchpad.net/~rhansen/git-build-recipe/+git/git-build-recipe/+merge/446358

Unmerged commits

3f17393... by Loïc Minier

Fetch upstream/* tags for pristine-tar checkout

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitbuildrecipe/recipe.py b/gitbuildrecipe/recipe.py
2index f932ca7..d58a61d 100644
3--- a/gitbuildrecipe/recipe.py
4+++ b/gitbuildrecipe/recipe.py
5@@ -344,6 +344,10 @@ def fetch_branches(child_branch):
6 child_branch.git_call(
7 "fetch", url,
8 "refs/heads/*:refs/remotes/%s/*" % child_branch.remote_name)
9+ # Also fetch remote tags that look like pristine-tar upstream tags.
10+ child_branch.git_call(
11+ "fetch", url,
12+ "refs/tags/upstream/*:refs/remotes/%s/*" % child_branch.remote_name)
13
14
15 @lru_cache(maxsize=1)

Subscribers

People subscribed via source and target branches