Gentoo Archives: gentoo-dev

From: Alexander Berntsen <bernalex@g.o>
To: Doug Goldstein <cardoe@××××××.com>, gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [PATCH] change how the tmp file for the commit msg is made
Date: Tue, 12 Apr 2016 06:25:04
Message-Id: 570C94AB.8080203@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA512
3
4 There's only superficial changes required to the commit message
5 required -- capitalise the message, s/This changes/change/ in the
6 description -- it looks good otherwise.
7
8 However, I don't know whether this patch is *desired*.
9
10 Doug, do you have a bug report, a forum thread, anything where people
11 actually want this? I'm asking, not because I doubt that you find it
12 valuable, nor because I don't think it's a useful patch, but because
13 changing anything that devs interface with is typically very
14 controversial.
15
16
17 I'll leave the merging to you, Brian, as repoman is in a somewhat
18 tender state -- newly merged and all.
19
20 On 12/04/16 01:01, Doug Goldstein wrote:
21 > This changes the way the temporary file for the commit message is
22 > generated to make a temporary directory and create a file called
23 > COMMIT_EDITMSG inside of it. This is to cause various editors to
24 > treat this as a git style commit message by default.
25 >
26 > Signed-off-by: Doug Goldstein <cardoe@××××××.com> ---
27 > pym/repoman/actions.py | 18 ++++++++++-------- 1 file changed, 10
28 > insertions(+), 8 deletions(-)
29 >
30 > diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index
31 > 4f3f195..dc3c2e4 100644 --- a/pym/repoman/actions.py +++
32 > b/pym/repoman/actions.py @@ -646,10 +646,10 @@ class
33 > Actions(object): myfiles += myremoved myfiles.sort()
34 >
35 > - fd, commitmessagefile = tempfile.mkstemp(".repoman.msg") -
36 > mymsg = os.fdopen(fd, "wb") -
37 > mymsg.write(_unicode_encode(commitmessage)) - mymsg.close() +
38 > commitmessagedir = tempfile.mkdtemp(".repoman.msg") +
39 > commitmessagefile = os.path.join(commitmessagedir,
40 > "COMMIT_EDITMSG") + with open(commitmessagefile, "wb") as
41 > mymsg: + mymsg.write(_unicode_encode(commitmessage))
42 >
43 > commit_cmd = [] if self.options.pretend and self.vcs_settings.vcs
44 > is None: @@ -687,16 +687,17 @@ class Actions(object): finally:
45 > try: os.unlink(commitmessagefile) + os.rmdir(commitmessagedir)
46 > except OSError: pass
47 >
48 >
49 > def priming_commit(self, myupdates, myremoved, commitmessage):
50 > myfiles = myupdates + myremoved - fd, commitmessagefile =
51 > tempfile.mkstemp(".repoman.msg") - mymsg = os.fdopen(fd, "wb") -
52 > mymsg.write(_unicode_encode(commitmessage)) - mymsg.close() +
53 > commitmessagedir = tempfile.mkdtemp(".repoman.msg") +
54 > commitmessagefile = os.path.join(commitmessagedir,
55 > "COMMIT_EDITMSG") + with open(commitmessagefile, "wb") as
56 > mymsg: + mymsg.write(_unicode_encode(commitmessage))
57 >
58 > separator = '-' * 78
59 >
60 > @@ -733,6 +734,7 @@ class Actions(object): finally: try:
61 > os.unlink(commitmessagefile) +
62 > os.rmdir(commitmessagedir) except OSError: pass
63 >
64 >
65
66
67 - --
68 Alexander
69 bernalex@g.o
70 https://secure.plaimi.net/~alexander
71 -----BEGIN PGP SIGNATURE-----
72 Version: GnuPG v2
73
74 iQIcBAEBCgAGBQJXDJSqAAoJENQqWdRUGk8BOckQAM+yD/pXRyBiIbYpmKHkJGEx
75 Wx1SvrH6IeNitXrIKlvACNKnODUxY7CiTdBA1/DpyckrbJjr3VGAfP+YjEsJItgF
76 eaIKQAnQL1fDVHgni2dezJEpzXXLIb5omgWBFOFEPh02t8IBKl1te4RT8gaKALPQ
77 E+MZBKrfOSO5u3cj+hL+8i6GXmvWqcHIrURny4iGnx/wEf27pN+9+wt2Qb7IlbWc
78 enE3K2ChnpryQP5zypPjbr1tprukGdwkPvFWN2FqBJR4pSlNIfATtdYQLKG9ypL4
79 /Pgbdth000a3y8IWXFcsLOt1AxEr5LyDRjJwBUMvtM7jGRyXj1dzvqStufV/7XKX
80 t1wjiQPpi4Bgdbwp3g0NkYzwhS8L1o0y02Z6sWAm4ZhA5wMPptB93psv4OZTSvmW
81 vKtsrfALtjmFiB05yPmmM78eGHrJ+nZ5bHTfFv21x4QJoT4V5wbhkvvcH3FS5zc7
82 iAwriczCcmGSSvOtuvjHHZV+nQuyUTeG724yYlVkxH+0h5r9AAuZEKCacW3l9eQx
83 fRkoJV+XRmktbUY3tJY3wfcrzmsGWx0IFKRpRzdAf92UKez60KtLvtlCC5r99aL7
84 jt9weFiK33+r+jSca1BV3ZJQEHNuabB/x5cUdOHq5v/cBbyRHd4HhAZzwbxBJqmr
85 G28bBVctSBIzWQx+lu/4
86 =Rkcx
87 -----END PGP SIGNATURE-----