# JGit

## New Features

### Git config core.commentChar

The git config `core.commentChar` is supported as of JGit 6.2. It enables users to change the default character indicating comment lines in commit messages, which by default is `#`. The `auto` setting is also supported.

### Negative Refspecs

JGit 6.2 supports negative refspecs when fetching, introduced in C git 2.29. Negative refspecs enable a git client to specify that some refs should not be fetched. A negative refspec has the form `^refs/...` and it many contain the `*` wildcard. For the details, see the git fetch documentation, or the git 2.29 announcement.

### Support for External Diff and Merge Tools

JGit 6.2 supports the use of external diff and merge tools. To invoke a merge or diff tool use, for instance:

    jgit difftool --tool=kdiff3
    jgit mergetool --tool=kdiff3

The list of diff or merge tools configured on the system may be obtained via

    jgit difftool --tool-help
    jgit mergetool --tool-help

Diff or merge tools are defined in the git configuration files, typically in the repository or user git config. The mechanism is the same for both. An example of a merge tool definition might be

    [merge]
           tool = customTool
    [mergetool "customTool"]
           cmd = echo
           path = /usr/bin/echo
           prompt = false
           trustExitCode = false

For a diff tool definition, use `diff.tool = <name>` and define it via `diff.<name>.*` instead of `merge.tool` and `merge.<name>.*`.

For the details of configurations and possible parameters to the `difftool` or `mergetool` commands, see the official git documentation on `git difftool` and `git mergetool`.

## Other Changes

The complete list of new features and bug fixes is available in the release notes.