Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 370918 Details for
Bug 489100
git-r3.eclass: support 'git rev-parse HEAD', 'git describe', and 'git log -1 HEAD'
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 2.
0002-Use-dedicated-refs-rather-than-branches-for-eclass-d.patch (text/plain), 3.29 KB, created by
Michał Górny
on 2014-02-20 23:32:38 UTC
(
hide
)
Description:
Patch 2.
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2014-02-20 23:32:38 UTC
Size:
3.29 KB
patch
obsolete
>From c1e29395fce81f4a1385ed5a820a2c7773ff8a14 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> >Date: Fri, 21 Feb 2014 00:11:04 +0100 >Subject: [PATCH 2/3] Use dedicated refs rather than branches for eclass data. > >--- > eclass/git-r3.eclass | 30 +++++++++--------------------- > 1 file changed, 9 insertions(+), 21 deletions(-) > >diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass >index 487b77b..fb75cff 100644 >--- a/eclass/git-r3.eclass >+++ b/eclass/git-r3.eclass >@@ -312,7 +312,7 @@ git-r3_fetch() { > local branch=${EGIT_BRANCH:+refs/heads/${EGIT_BRANCH}} > local remote_ref=${2:-${EGIT_COMMIT:-${branch:-HEAD}}} > local local_id=${3:-${CATEGORY}/${PN}/${SLOT%/*}} >- local local_ref=refs/heads/${local_id}/__main__ >+ local local_ref=refs/git-r3/${local_id}/__main__ > > [[ ${repos[@]} ]] || die "No URI provided and EGIT_REPO_URI unset" > >@@ -324,17 +324,6 @@ git-r3_fetch() { > for r in "${repos[@]}"; do > einfo "Fetching ${remote_ref} from ${r} ..." > >- local lookup_ref >- if [[ ${remote_ref} == refs/heads/* || ${remote_ref} == HEAD ]] >- then >- is_branch=1 >- lookup_ref=${remote_ref} >- else >- # ls-remote by commit is going to fail anyway, >- # so we may as well pass refs/tags/ABCDEF... >- lookup_ref=refs/tags/${remote_ref} >- fi >- > local fetch_command=( > git fetch --prune "${r}" > # mirror the remote branches as local branches >@@ -346,11 +335,10 @@ git-r3_fetch() { > set -- "${fetch_command[@]}" > echo "${@}" >&2 > if "${@}"; then >- set -- git branch -f "${local_id}/__main__" \ >- "${ref[0]:-${remote_ref}}" >+ set -- git update-ref "${local_ref}" "${remote_ref}" > echo "${@}" >&2 > if ! "${@}"; then >- die "Creating branch for ${remote_ref} failed (wrong ref?)." >+ die "Referencing ${remote_ref} failed (wrong ref?)." > fi > > success=1 >@@ -429,7 +417,7 @@ git-r3_checkout() { > > einfo "Checking out ${repos[0]} to ${out_dir} ..." > >- if ! git cat-file -e refs/heads/"${local_id}"/__main__ >+ if ! git cat-file -e refs/git-r3/"${local_id}"/__main__ > then > if [[ ${EVCS_OFFLINE} ]]; then > die "No local clone of ${repos[0]}. Unable to work with EVCS_OFFLINE." >@@ -448,7 +436,7 @@ git-r3_checkout() { > done > rm "${lockfile_l}" || die > >- set -- git checkout -f "${local_id}"/__main__ . >+ set -- git checkout -f refs/git-r3/"${local_id}"/__main__ . > echo "${@}" >&2 > "${@}" > local ret=${?} >@@ -456,12 +444,12 @@ git-r3_checkout() { > # Remove the lock! > rm "${lockfile}" || die > >- [[ ${ret} == 0 ]] || die "git checkout ${local_id}/__main__ failed" >+ [[ ${ret} == 0 ]] || die "git checkout refs/git-r3/${local_id}/__main__ failed" > > # diff against previous revision (if any) >- local new_commit_id=$(git rev-parse --verify "${local_id}"/__main__) >+ local new_commit_id=$(git rev-parse --verify refs/git-r3/"${local_id}"/__main__) > local old_commit_id=$( >- git rev-parse --verify "${local_id}"/__old__ 2>/dev/null >+ git rev-parse --verify refs/git-r3/"${local_id}"/__old__ 2>/dev/null > ) > > if [[ ! ${old_commit_id} ]]; then >@@ -482,7 +470,7 @@ git-r3_checkout() { > echo " at the commit: ${new_commit_id}" > fi > fi >- git branch -f "${local_id}"/{__old__,__main__} || die >+ git update-ref refs/git-r3/"${local_id}"/{__old__,__main__} || die > > # recursively checkout submodules > if [[ -f ${GIT_WORK_TREE}/.gitmodules ]]; then >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 489100
:
370916
| 370918 |
370920
|
370968