Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 370968 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 4.
0004-Pass-branches-and-tags-as-symbolic-refs.patch (text/plain), 2.72 KB, created by
Michał Górny
on 2014-02-21 16:12:32 UTC
(
hide
)
Description:
Patch 4.
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2014-02-21 16:12:32 UTC
Size:
2.72 KB
patch
obsolete
>From 9be0d632d836d596b121eca03ece49b4f2e7fc8a 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 17:10:09 +0100 >Subject: [PATCH 4/4] Pass branches and tags as symbolic refs. > >Now, the checkout phase is fully aware of what we were checking out, and >even 'git branch' shows correct value after the checkout. >--- > eclass/git-r3.eclass | 31 ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) > >diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass >index fd3610d..a50890d 100644 >--- a/eclass/git-r3.eclass >+++ b/eclass/git-r3.eclass >@@ -322,7 +322,7 @@ git-r3_fetch() { > # try to fetch from the remote > local r success > for r in "${repos[@]}"; do >- einfo "Fetching ${remote_ref} from ${r} ..." >+ einfo "Fetching ${r} ..." > > local fetch_command=( > git fetch --prune "${r}" >@@ -335,7 +335,20 @@ git-r3_fetch() { > set -- "${fetch_command[@]}" > echo "${@}" >&2 > if "${@}"; then >- set -- git update-ref "${local_ref}" "${remote_ref}" >+ # now let's see what the user wants from us >+ local full_remote_ref=$( >+ git rev-parse --verify --symbolic-full-name "${remote_ref}" >+ ) >+ >+ if [[ ${full_remote_ref} ]]; then >+ # when we are given a ref, create a symbolic ref >+ # so that we preserve the actual argument >+ set -- git symbolic-ref "${local_ref}" "${full_remote_ref}" >+ else >+ # otherwise, we were likely given a commit id >+ set -- git update-ref --no-deref "${local_ref}" "${remote_ref}" >+ fi >+ > echo "${@}" >&2 > if ! "${@}"; then > die "Referencing ${remote_ref} failed (wrong ref?)." >@@ -422,6 +435,9 @@ git-r3_checkout() { > die "Logic error: no local clone of ${repos[0]}. git-r3_fetch not used?" > fi > fi >+ local remote_ref=$( >+ git symbolic-ref --quiet refs/git-r3/"${local_id}"/__main__ >+ ) > local new_commit_id=$( > git rev-parse --verify refs/git-r3/"${local_id}"/__main__ > ) >@@ -434,9 +450,14 @@ git-r3_checkout() { > local -x GIT_DIR=${out_dir}/.git > local -x GIT_WORK_TREE=${out_dir} > >- set -- git checkout --quiet "${new_commit_id}" >+ set -- git checkout --quiet >+ if [[ ${remote_ref} ]]; then >+ set -- "${@}" "${remote_ref#refs/heads/}" >+ else >+ set -- "${@}" "${new_commit_id}" >+ fi > echo "${@}" >&2 >- "${@}" || die "git checkout ${new_commit_id} failed" >+ "${@}" || die "git checkout ${remote_ref:-${new_commit_id}} failed" > } > git-r3_sub_checkout > >@@ -463,7 +484,7 @@ git-r3_checkout() { > echo " at the commit: ${new_commit_id}" > fi > fi >- git update-ref refs/git-r3/"${local_id}"/{__old__,__main__} || die >+ git update-ref --no-deref refs/git-r3/"${local_id}"/{__old__,__main__} || die > > # recursively checkout submodules > if [[ -f ${out_dir}/.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