public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH 1/2] repoman: normalize newline handling in get_commit_footer
@ 2018-09-30 16:27 Mike Gilbert
  2018-09-30 16:27 ` [gentoo-portage-dev] [PATCH 2/2] repoman: move Signed-off-by to the end of the footer Mike Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Gilbert @ 2018-09-30 16:27 UTC (permalink / raw
  To: gentoo-portage-dev

Start with an empty string, and add a newline character at the start
of each sucessive line. This simplifies the logic needed to add a new
line to the footer.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 repoman/lib/repoman/actions.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 9fe5f722e..3cf6f7081 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -419,7 +419,7 @@ the whole commit message to abort.
 			portage_version = "Unknown"
 
 		# Common part of commit footer
-		commit_footer = "\n"
+		commit_footer = ""
 		for tag, bug in chain(
 				(('Bug', x) for x in self.options.bug),
 				(('Closes', x) for x in self.options.closes)):
@@ -439,14 +439,14 @@ the whole commit message to abort.
 				elif (purl.scheme == 'http' and
 						purl.netloc in self.https_bugtrackers):
 					bug = urlunsplit(('https',) + purl[1:])
-			commit_footer += "%s: %s\n" % (tag, bug)
+			commit_footer += "\n%s: %s" % (tag, bug)
 
 		if dco_sob:
-			commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
+			commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
 
 		# Use new footer only for git (see bug #438364).
 		if self.vcs_settings.vcs in ["git"]:
-			commit_footer += "Package-Manager: Portage-%s, Repoman-%s" % (
+			commit_footer += "\nPackage-Manager: Portage-%s, Repoman-%s" % (
 							portage.VERSION, VERSION)
 			if report_options:
 				commit_footer += "\nRepoMan-Options: " + " ".join(report_options)
@@ -458,7 +458,7 @@ the whole commit message to abort.
 				unameout += platform.processor()
 			else:
 				unameout += platform.machine()
-			commit_footer += "(Portage version: %s/%s/%s" % \
+			commit_footer += "\n(Portage version: %s/%s/%s" % \
 				(portage_version, self.vcs_settings.vcs, unameout)
 			if report_options:
 				commit_footer += ", RepoMan options: " + " ".join(report_options)
-- 
2.19.0



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

* [gentoo-portage-dev] [PATCH 2/2] repoman: move Signed-off-by to the end of the footer
  2018-09-30 16:27 [gentoo-portage-dev] [PATCH 1/2] repoman: normalize newline handling in get_commit_footer Mike Gilbert
@ 2018-09-30 16:27 ` Mike Gilbert
  2018-09-30 20:16   ` Zac Medico
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Gilbert @ 2018-09-30 16:27 UTC (permalink / raw
  To: gentoo-portage-dev

This makes for a cleaner looking message when multiple people add their
SOB during a review process.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
 repoman/lib/repoman/actions.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 3cf6f7081..4980f11eb 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -441,9 +441,6 @@ the whole commit message to abort.
 					bug = urlunsplit(('https',) + purl[1:])
 			commit_footer += "\n%s: %s" % (tag, bug)
 
-		if dco_sob:
-			commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
-
 		# Use new footer only for git (see bug #438364).
 		if self.vcs_settings.vcs in ["git"]:
 			commit_footer += "\nPackage-Manager: Portage-%s, Repoman-%s" % (
@@ -468,6 +465,10 @@ the whole commit message to abort.
 			else:
 				commit_footer += ", unsigned Manifest commit"
 			commit_footer += ")"
+
+		if dco_sob:
+			commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
+
 		return commit_footer
 
 
-- 
2.19.0



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

* Re: [gentoo-portage-dev] [PATCH 2/2] repoman: move Signed-off-by to the end of the footer
  2018-09-30 16:27 ` [gentoo-portage-dev] [PATCH 2/2] repoman: move Signed-off-by to the end of the footer Mike Gilbert
@ 2018-09-30 20:16   ` Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2018-09-30 20:16 UTC (permalink / raw
  To: gentoo-portage-dev, Mike Gilbert


[-- Attachment #1.1: Type: text/plain, Size: 1273 bytes --]

On 09/30/2018 09:27 AM, Mike Gilbert wrote:
> This makes for a cleaner looking message when multiple people add their
> SOB during a review process.
> 
> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> ---
>  repoman/lib/repoman/actions.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
> index 3cf6f7081..4980f11eb 100644
> --- a/repoman/lib/repoman/actions.py
> +++ b/repoman/lib/repoman/actions.py
> @@ -441,9 +441,6 @@ the whole commit message to abort.
>  					bug = urlunsplit(('https',) + purl[1:])
>  			commit_footer += "\n%s: %s" % (tag, bug)
>  
> -		if dco_sob:
> -			commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
> -
>  		# Use new footer only for git (see bug #438364).
>  		if self.vcs_settings.vcs in ["git"]:
>  			commit_footer += "\nPackage-Manager: Portage-%s, Repoman-%s" % (
> @@ -468,6 +465,10 @@ the whole commit message to abort.
>  			else:
>  				commit_footer += ", unsigned Manifest commit"
>  			commit_footer += ")"
> +
> +		if dco_sob:
> +			commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
> +
>  		return commit_footer
>  
>  
> 

Both patches look good. Please merge.
-- 
Thanks,
Zac


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

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

end of thread, other threads:[~2018-09-30 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-30 16:27 [gentoo-portage-dev] [PATCH 1/2] repoman: normalize newline handling in get_commit_footer Mike Gilbert
2018-09-30 16:27 ` [gentoo-portage-dev] [PATCH 2/2] repoman: move Signed-off-by to the end of the footer Mike Gilbert
2018-09-30 20:16   ` Zac Medico

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