Skip to content

Commit

Permalink
gerrit-send-mail: Make output consistent across systems
Browse files Browse the repository at this point in the history
When writing the file specify encoding and newline, so that
the local settings (like locale) do not change the output.

Change-Id: Id7b4bda38adfbb446bdac635ac5d5207ef3f2f40
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Arne Schwabe <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28153.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
flichtenheld authored and cron2 committed Jan 29, 2024
1 parent 55418bf commit e1f8c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev-tools/gerrit-send-mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def apply_patch_mods(patch_text, details, args):
)
filename = f"gerrit-{args.changeid}-{details['revision']}.patch"
patch_text_final = patch_text_mod.replace("Subject: [PATCH]", f"Subject: [PATCH v{details['revision']}]")
with open(filename, "w") as patch_file:
with open(filename, "w", encoding="utf-8", newline="\n") as patch_file:
patch_file.write(patch_text_final)
print("send with:")
print(f"git send-email --in-reply-to {details['msg_id']} {filename}")
Expand Down

0 comments on commit e1f8c59

Please sign in to comment.