The diff in upstream changes is shown, for example:
https://github.com/WeblateOrg/weblate/commit/4e50b8ce278989d85b5a2560e13c8d3ea691e36b
The diff with Weblate changes should be shown.
All tools seem to use the second parent as branch to show diff, so Weblate should create the merge commit in reverse order. However there seems to be no way to tell git to do this.
As a workaround Weblate could do following:
# Create local branch for upstream
git branch tmp origin/master
# Checkout upstream branch
git checkout tmp
# Merge current Weblate changes, this can lead to conflict
git merge master
# Checkout branch with Weblate changes
git checkout master
# Merge temporary branch (this is fast forward so does not create merge commit)
git merge tmp
# Delete temporary branch
git branch -d tmp
As this involves quite a lot of manipulations with the repository, it can lead to performance issues. Also this really looks too complex for simple thing we want to achieve.
PS: Asked this question on StackOverflow.
Another approach (using a bit of git plumbing):
$ git merge --squash origin/master
Squash commit -- not updating HEAD
Automatic merge went well; stopped before committing as requested
$ git write-tree
c8ffd97c94cf0fb11591671e4e5d1b84db2906a3
$ git commit-tree -p origin/master -p master -m "message" c8ffd97c94cf0fb11591671e4e5d1b84db2906a3
e2d1013adf2ab47663da455012536a837937a74e
$ git reset --hard e2d1013adf2ab47663da455012536a837937a74e
HEAD is now at e2d1013 message
Thank you for your report, the issue you have reported has just been fixed.
Cool!
Is it live on https://hosted.weblate.org/?
Not yet, it's only in git so far. Will be probably deployed next week.
Is it live? If not, how can I be notified about it?
Yes, it's live, here is example of such merge commit: https://github.com/WeblateOrg/weblate/commit/942dda2f73f7419596f51e3365ec6dbd7fe8673f
Most helpful comment
Another approach (using a bit of git plumbing):