Re: [PATCH v5] diff: add config option relative
- From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
- Date
- May 18, 2020, 19:12 UTC
- Message-ID
- <20200518191205.GA1999@danh.dev>
- In-Reply-To
- <xmqq4ksd5ggq.fsf@gitster.c.googlers.com>
On 2020-05-18 09:57:09-0700, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> 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 patch.
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:
Documentation/diff-options.txt
ifndef::git-format-patch[]
-R::
Swap two inputs; that is, show differences from index or
on-disk file to tree contents.--relative[=<path>]::
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.
endif::git-format-patch[]Maybe time to fix the documentation.
-- Danh