From: Catalin Marinas Date: Tue, 17 Apr 2007 16:29:32 +0000 (+0100) Subject: Failed recursive merging can silently lose date in StGIT X-Git-Tag: v0.13~98 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/6aff55e93e9814621dd7b8623e18036b540bda1a?ds=inline;hp=6aff55e93e9814621dd7b8623e18036b540bda1a Failed recursive merging can silently lose date in StGIT The logic in git.merge(recursive = True) is that if git-merge-recursive fails, deal with the unmerged entries via diff3 and interactive merge (if 'autoimerge' is set to 'yes' in config). There is a situation, however, when git-merge-recursive fails because of an untracked file that would be overwritten by the merge. In this case, git-merge-recursive aborts the operation but without any unmerged entries in the index. StGIT considers that the merge lead to an empty patch without reporting any error. This commit makes it a bit safer by detecting whether there are unmerged index entries and, if not, further raises an error informing the user of the problem. The patch is still pushed as empty but the user is informed of the failure and the possibility of running 'push --undo'. A better solution, but which require a bit more work, is to distinguish between the merge failures and, in this specific case, abort the push completely and revert the patch to its original state (and popped from the stack). Signed-off-by: Catalin Marinas ---