public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref
@ 2015-09-26 13:28 Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 1/3] git-r3.eclass: Improve the comments a bit Michał Górny
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Michał Górny @ 2015-09-26 13:28 UTC (permalink / raw
  To: gentoo-dev

Hi,

Small patch set for review. Patch 1 cleans up some comments inside
the eclass, while patch 2 removes unused 'is_branch' variable. Finally,
patch 3 adds support for passing any of the 'refs/*' rather than
'refs/heads/*' only. This was requested by vapier in #556822 [1].

The patches can be also found in 'git-r3_support_any_refs' branch in our
Gentoo repository.

Best regards,
Michał Górny

[1]:https://bugs.gentoo.org/show_bug.cgi?id=556822



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 1/3] git-r3.eclass: Improve the comments a bit
  2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
@ 2015-09-26 13:28 ` Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 2/3] git-r3.eclass: Remove unused variable Michał Górny
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2015-09-26 13:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 eclass/git-r3.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 0ee70bc..9bc385e 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -585,7 +585,7 @@ git-r3_fetch() {
 				# regular branch
 				fetch_l=${remote_ref}
 			else
-				# tag or commit...
+				# tag or commit id...
 				# let ls-remote figure it out
 				local tagref=$(git ls-remote "${r}" "refs/tags/${remote_ref}")
 
@@ -594,8 +594,8 @@ git-r3_fetch() {
 					# tag
 					fetch_l=refs/tags/${remote_ref}
 				else
-					# commit
-					# so we need to fetch the branch
+					# commit id
+					# so we need to fetch the whole branch
 					if [[ ${branch} ]]; then
 						fetch_l=${branch}
 					else
@@ -697,7 +697,7 @@ git-r3_fetch() {
 	[[ ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI"
 
 	# submodules can reference commits in any branch
-	# always use the 'clone' mode to accomodate that, bug #503332
+	# always use the 'mirror' mode to accomodate that, bug #503332
 	local EGIT_CLONE_TYPE=mirror
 
 	# recursively fetch submodules
-- 
2.5.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 2/3] git-r3.eclass: Remove unused variable
  2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 1/3] git-r3.eclass: Improve the comments a bit Michał Górny
@ 2015-09-26 13:28 ` Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 3/3] git-r3.eclass: Accept any ref rather than refs/heads/* only Michał Górny
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2015-09-26 13:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 eclass/git-r3.eclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 9bc385e..eff3fa2 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -918,10 +918,9 @@ git-r3_peek_remote_ref() {
 	for r in "${repos[@]}"; do
 		einfo "Peeking \e[1m${remote_ref}\e[22m on \e[1m${r}\e[22m ..." >&2
 
-		local is_branch lookup_ref
+		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,
-- 
2.5.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 3/3] git-r3.eclass: Accept any ref rather than refs/heads/* only
  2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 1/3] git-r3.eclass: Improve the comments a bit Michał Górny
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 2/3] git-r3.eclass: Remove unused variable Michał Górny
@ 2015-09-26 13:28 ` Michał Górny
  2015-09-26 14:44 ` [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Alexis Ballier
  2015-11-29 10:04 ` Michał Górny
  4 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2015-09-26 13:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=556822
---
 eclass/git-r3.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index eff3fa2..3e2cc83 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -581,8 +581,8 @@ git-r3_fetch() {
 			if [[ ${remote_ref} == HEAD ]]; then
 				# HEAD
 				fetch_l=HEAD
-			elif [[ ${remote_ref} == refs/heads/* ]]; then
-				# regular branch
+			elif [[ ${remote_ref} == refs/* ]]; then
+				# regular branch, tag or some other explicit ref
 				fetch_l=${remote_ref}
 			else
 				# tag or commit id...
@@ -919,7 +919,7 @@ git-r3_peek_remote_ref() {
 		einfo "Peeking \e[1m${remote_ref}\e[22m on \e[1m${r}\e[22m ..." >&2
 
 		local lookup_ref
-		if [[ ${remote_ref} == refs/heads/* || ${remote_ref} == HEAD ]]
+		if [[ ${remote_ref} == refs/* || ${remote_ref} == HEAD ]]
 		then
 			lookup_ref=${remote_ref}
 		else
-- 
2.5.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref
  2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
                   ` (2 preceding siblings ...)
  2015-09-26 13:28 ` [gentoo-dev] [PATCH 3/3] git-r3.eclass: Accept any ref rather than refs/heads/* only Michał Górny
@ 2015-09-26 14:44 ` Alexis Ballier
  2015-09-26 15:36   ` Michał Górny
  2015-11-29 10:04 ` Michał Górny
  4 siblings, 1 reply; 7+ messages in thread
From: Alexis Ballier @ 2015-09-26 14:44 UTC (permalink / raw
  To: gentoo-dev

On Sat, 26 Sep 2015 15:28:56 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> Hi,
> 
> Small patch set for review. Patch 1 cleans up some comments inside
> the eclass, while patch 2 removes unused 'is_branch' variable.
> Finally, patch 3 adds support for passing any of the 'refs/*' rather
> than 'refs/heads/*' only. This was requested by vapier in #556822 [1].

IMHO you don't need to send them for review here nor to create a
branch for committing these, esp. the cosmetics part :)

3/3 will just increase what is fetched and might not break anything,
right ?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref
  2015-09-26 14:44 ` [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Alexis Ballier
@ 2015-09-26 15:36   ` Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2015-09-26 15:36 UTC (permalink / raw
  To: Alexis Ballier; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Dnia 2015-09-26, o godz. 16:44:14
Alexis Ballier <aballier@gentoo.org> napisał(a):

> On Sat, 26 Sep 2015 15:28:56 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
> 
> > Hi,
> > 
> > Small patch set for review. Patch 1 cleans up some comments inside
> > the eclass, while patch 2 removes unused 'is_branch' variable.
> > Finally, patch 3 adds support for passing any of the 'refs/*' rather
> > than 'refs/heads/*' only. This was requested by vapier in #556822 [1].
> 
> IMHO you don't need to send them for review here nor to create a
> branch for committing these, esp. the cosmetics part :)
> 
> 3/3 will just increase what is fetched and might not break anything,
> right ?

I can't think of any case when it could break something.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref
  2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
                   ` (3 preceding siblings ...)
  2015-09-26 14:44 ` [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Alexis Ballier
@ 2015-11-29 10:04 ` Michał Górny
  4 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2015-11-29 10:04 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

On Sat, 26 Sep 2015 15:28:56 +0200
Michał Górny <mgorny@gentoo.org> wrote:

> Hi,
> 
> Small patch set for review. Patch 1 cleans up some comments inside
> the eclass, while patch 2 removes unused 'is_branch' variable. Finally,
> patch 3 adds support for passing any of the 'refs/*' rather than
> 'refs/heads/*' only. This was requested by vapier in #556822 [1].
> 
> The patches can be also found in 'git-r3_support_any_refs' branch in our
> Gentoo repository.

Found this while cleaning up local branches. Merged finally.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-29 10:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 13:28 [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Michał Górny
2015-09-26 13:28 ` [gentoo-dev] [PATCH 1/3] git-r3.eclass: Improve the comments a bit Michał Górny
2015-09-26 13:28 ` [gentoo-dev] [PATCH 2/3] git-r3.eclass: Remove unused variable Michał Górny
2015-09-26 13:28 ` [gentoo-dev] [PATCH 3/3] git-r3.eclass: Accept any ref rather than refs/heads/* only Michał Górny
2015-09-26 14:44 ` [gentoo-dev] [PATCHES] git-r3.eclass: Slight cleanup and support for any ref Alexis Ballier
2015-09-26 15:36   ` Michał Górny
2015-11-29 10:04 ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox