git-mr-reply: don't add rev to read comments if user replies to himself
authorFrantisek Hrbata <frantisek@hrbata.com>
Wed, 16 Dec 2020 10:42:31 +0000 (11:42 +0100)
committerFrantisek Hrbata <frantisek@hrbata.com>
Wed, 16 Dec 2020 10:42:31 +0000 (11:42 +0100)
Signed-off-by: Frantisek Hrbata <frantisek@hrbata.com>
git-mr-reply

index 41976473f13a8beb05a6c88979c2efaafc2c8d14..84d1c154e5c4427a5bbffe45c21aefef90992181 100755 (executable)
@@ -29,6 +29,7 @@ parser.add_argument("-w", "--write-revs", metavar="FILE",
 args = parser.parse_args()
 refs = mrlib.load_refs()
 rev_comment = False
+user = mrlib.git_config("user.name")
 
 if not args.rev:
     mr = mrlib.verify_mrs([args.mr], refs)[0]
@@ -81,6 +82,9 @@ msg = mrlib.editor(msg)
 
 rv, out, err = mrlib.run(["git", "mr-sendmail"], stdin=msg)
 
+if user == an:
+    sys.exit()
+
 if not rev_comment:
     sys.exit()