Re: [PATCH 11/18] branch-diff: add tests
- From
Stefan Beller <sbeller@google.com>
- Date
- May 3, 2018, 17:11 UTC
- Message-ID
- <CAGZ79kY_kXpiXScjE+cNWRN1r71B3KkGNGZQjCHpKNe+tdMipw@mail.gmail.com>
- In-Reply-To
- <fe12b99a0b4f78ab75fcfbcf51c5edffb190c4e8.1525361419.git.johannes.schindelin@gmx.de>
On Thu, May 3, 2018 at 8:30 AM, Johannes Schindelin <johannes.schindelin@gmx.de> wrote:
Show 14 quoted lines
> From: Thomas Rast <tr@thomasrast.ch> > > These are essentially lifted from https://github.com/trast/tbdiff, with > light touch-ups to account for the new command name. > > Apart from renaming `tbdiff` to `branch-diff`, only one test case needed > to be adjusted: 11 - 'changed message'. > > The underlying reason it had to be adjusted is that diff generation is > sometimes ambiguous. In this case, a comment line and an empty line are > added, but it is ambiguous whether they were added after the existing > empty line, or whether an empty line and the comment line are added > *before* the existing emtpy line. And apparently xdiff picks a different > option here than Python's difflib.
I think that is the fallout of the diff heuristics. If you are keen on a 1:1 port, you can disable the diff sliding heuristics and it should produce the same diff with trailing new lines.