Re: [PATCH v5] diff: add config option relative
Junio C Hamano
Laurent Arnoud
brian m. carlson
Đoàn Trần Công Danh
See Also
Prev Ref 1 Ref 2 Ref 3 Ref 4 Ref 5
2020-05-18 19:12:05 UTC
On 2020-05-18 09:57:09-0700, Junio C Hamano <> wrote:
> Hmph, what do you exactly mean by "broken patch"?
> I actually do not mind people who set "diff.relative" to do
>     $ git config diff.relative true
>     $ cd t && git format-patch -1 --stdout
> to get an incomplete patch that covers only the t/ subdirectory, as
> long as they can ask Git to optionally get the full view with
>     $ cd t && git format-patch -1 --stdout --no-relative

Well, git-format-patch has never understood --relative,
which I think is a sane behaviour,
hence git-format-patch will never understand --no-relative after this

Oh no, to my surprise, git-format-patch does accept --[no-]relative, now.

We don't document --relative for git-format-patch, the --relative
documentation is placed under the guard, for that matter:


        Swap two inputs; that is, show differences from index or
        on-disk file to tree contents.

        When run from a subdirectory of the project, it can be
        told to exclude changes outside the directory and show
        pathnames relative to it with this option.  When you are
        not in a subdirectory (e.g. in a bare repository), you
        can name which subdirectory to make the output relative
        to by giving a <path> as an argument.

Maybe time to fix the documentation.