Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-13832

Support Git's patience diff algorithm

XMLWordPrintable

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Currently Bitbucket often produces messy diffs, like:

           private void modifiedMethod(final List<Foo> foos) {
               for (final Foo foo : foos) {
      +            boolean frobbled = service.frobble(foo);
      +            if (frobbled) {
      +                doSomethingMore();
      +            }
      +        }
      +    }
      +
      +    /**
      +     * @return Something completely unrelated
      +     */
      +    static String addedMethod() {
      +        return "asdf";
      +    }
      +
      +    /**
      +     * Long
      +     * Javadoc
      +     *
      +     * Is
      +     * Long
      +     *
      +     * Lorem ipsum etc.
      +     *
      +     * @param myParam
      +     *         I take a parameter
      +     */
      +    private void anotherNewMethod(Integer parameter) {
      +        if (parameter != null) {
      +            return parameter + 1;
               }
           }
      

      Git nowadays has patience diff algorithm, which should produce nicer diffs with less conflation between methods at least curly-braced languages, along the lines of:

           private void modifiedMethod(final List<Foo> foos) {
               for (final Foo foo : foos) {
      +            boolean frobbled = service.frobble(foo);
      +            if (frobbled) {
      +                doSomethingMore();
      +            }
               }
           }
      +
      +    /**
      +     * @return Something completely unrelated
      +     */
      +    static String addedMethod() {
      +        return "asdf";
      +    }
      +
      +    /**
      +     * Long
      +     * Javadoc
      +     *
      +     * Is
      +     * Long
      +     *
      +     * Lorem ipsum etc.
      +     *
      +     * @param myParam
      +     *         I take a parameter
      +     */
      +    private void anotherNewMethod(Integer parameter) {
      +        if (parameter != null) {
      +            return parameter + 1;
      +        }
      +    }
      

      Please add the ability to select the diff algorithm used when showing PRs in BitBucket.

            Unassigned Unassigned
            5bd3a7e74d1d Tuure Laurinolli
            Votes:
            16 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: