git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5] diff: add config option relative

From
Junio C Hamano <gitster@pobox.com>
Date
May 19, 2020, 18:00 UTC
Message-ID
<xmqqv9krztwp.fsf@gitster.c.googlers.com>
In-Reply-To
<20200519003006.GC1999@danh.dev>
Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:
Show 7 quoted lines
> Sane people wouldn't want to read that document when we don't have the
> config for diff.relative
>
> But, now, we have. Let's document --no-relative, specifically for
> git-format-patch(1).
>
> Perhaps something like this (maybe just fixing up to Laurent's)

I love it when a contributor pushes back with a well thought out counter-argument. Yes, I think the reasoning along the line makes sense.

If a project binds another project with -Xsubtree=<path>, a change to that part would be a good candidate to use "format-patch" with the "--relative=<path>". We didn't consider it a use case that is interesting enough, but it may be, which gives another reason why documenting "--[no-]relative[=<path>]" for the command may not be a bad thing, not just for the purpose of defeating "diff.relative".

For that reason, it may even make sense to use the same text for --no-relative and --relative[=<path>] we use for other commands in the diff family, i.e. leaving only -R inside the ifndef block.

Thanks.
Show 38 quoted lines
> -----------------8<--------------
> From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
>  <congdanhqx@gmail.com>
> Date: Tue, 19 May 2020 07:24:48 +0700
> Subject: [PATCH] Documentation: document --no-relative for format-patch
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> git-format-patch(1) accepts --relative for a long time, but the
> generated patch couldn't be applied without accompanying information.
>
> Hence, we've never document --relative for git-format-patch(1).
>
> Now, we've introduced `diff.relative` config, let's tell Git's users
> that they have an option to override it.
>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  Documentation/diff-options.txt | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
> index 167b451b89..0f5c108324 100644
> --- a/Documentation/diff-options.txt
> +++ b/Documentation/diff-options.txt
> @@ -654,6 +654,11 @@ ifndef::git-format-patch[]
>  	`--no-relative` can be used to countermand both `diff.relative` config
>  	option and previous `--relative`.
>  endif::git-format-patch[]
> +ifdef::git-format-patch[]
> +--no-relative::
> +	Countermand `diff.relative` config. Show all changes in the repository
> +	with pathname relative to top-level directory of the repository.
> +endif::git-format-patch[]
>  
>  -a::
>  --text::
Previous: Đoàn Trần Công DanhNext: Laurent Arnoud
Message 22 of 39 in “diff: add config option relative”
  1. diff: add config option relativeLaurent Arnoud, May 15, 2020
  2. Philip OakleyMay 15, 2020
  3. Laurent ArnoudMay 16, 2020
  4. brian m. carlsonMay 15, 2020
  5. Junio C HamanoMay 16, 2020
  6. Laurent ArnoudMay 16, 2020
  7. Laurent ArnoudMay 16, 2020
  8. Phillip WoodMay 16, 2020
  9. Laurent ArnoudMay 16, 2020
  10. Đoàn Trần Công DanhMay 17, 2020
  11. Danh DoanMay 17, 2020
  12. Junio C HamanoMay 17, 2020
  13. Laurent ArnoudMay 18, 2020
  14. Shourya ShuklaMay 18, 2020
  15. Đoàn Trần Công DanhMay 18, 2020
  16. Laurent ArnoudMay 18, 2020
  17. Đoàn Trần Công DanhMay 18, 2020
  18. Junio C HamanoMay 18, 2020
  19. Đoàn Trần Công DanhMay 18, 2020
  20. Junio C HamanoMay 18, 2020
  21. Đoàn Trần Công DanhMay 19, 2020
  22. Junio C HamanoMay 19, 2020
  23. diff: add config option relativeLaurent Arnoud, May 19, 2020
  24. Đoàn Trần Công DanhMay 19, 2020
  25. diff: add config option relativeLaurent Arnoud, May 22, 2020
  26. Đoàn Trần Công DanhMay 23, 2020
  27. Laurent ArnoudMay 22, 2020
  28. Junio C HamanoMay 18, 2020
  29. Laurent ArnoudMay 18, 2020
  30. Junio C HamanoMay 18, 2020
  31. Junio C HamanoMay 18, 2020
  32. Eric SunshineMay 18, 2020
  33. Đoàn Trần Công DanhMay 18, 2020
  34. Junio C HamanoMay 18, 2020
  35. Laurent ArnoudMay 18, 2020
  36. Eric SunshineMay 18, 2020
  37. Laurent ArnoudMay 18, 2020
  38. Laurent ArnoudMay 18, 2020
  39. Junio C HamanoMay 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.