From 14141db58f5fef9a5dba8efdf4b84c8e2d08266c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Jun 22 2015 16:18:55 +0000 Subject: Use pretty json strings for git content This has 2 advantages: 1. it makes the requests human readable in general, including seeing what did actually change from one commit to the next 2. it makes objects smalller as the diff will include only the stuff surrounding the changed data, not the whole object every time. Signed-off-by: Simo Sorce --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index ec73818..cf68d31 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -150,7 +150,8 @@ def update_git(obj, repo, repofolder, objtype='ticket'): # Write down what changed with open(file_path, 'w') as stream: - stream.write(json.dumps(obj.to_json())) + stream.write(json.dumps(obj.to_json(), + sort_keys=True, indent=4, separators=(',', ': '))) # Retrieve the list of files that changed diff = new_repo.diff()