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

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

From
Laurent Arnoud <laurent@spkdev.net>
Date
May 18, 2020, 17:25 UTC
Message-ID
<20200518172504.GB2110@spk-laptop>
In-Reply-To
<20200518114630.GA30622@konoha>
Hi Shourya,
On Mon, May 18, 2020 at 05:16:30PM +0530, Shourya Shukla wrote:
Show 8 quoted lines
> I think the message can be written better, maybe something like:
> 
>     The `diff.relative` boolean option set to `true` shows only changes
>     in the current directory/value specified by the `path` argument of
>     the `relative` option and shows pathnames relative to the
>     aforementioned directory.
> 
>     Teach `--no-relative` to override the earlier `--relative`
Thanks I've applied your suggestion to the v6 patch
Show 29 quoted lines
> > --- a/Documentation/config/diff.txt
> > +++ b/Documentation/config/diff.txt
> > @@ -105,6 +105,10 @@ diff.mnemonicPrefix::
> >  diff.noprefix::
> >  	If set, 'git diff' does not show any source or destination prefix.
> > 
> > +diff.relative::
> > +	If set to 'true', 'git diff' does not show changes outside of the directory
> > +	and show pathnames relative to the current directory.
> 
> In the second last line, it would be better to write is as:
> 
>     ... does not show changes outside of the current directory/the path
>     provided as the argument in `relative`?
> 
> Even my version of the above line seems very crude and innaccurate, but
> I think that we should take into account the `path` passed down to us
> by the `--relative[=<path>]` option.
> 
> Moving on, what I wondered was that maybe making it a `true/false`
> option would be better? Something like:
> 
>     git diff --relative=false //override the diff.relative setting
>     git diff --relative=true <path> //works like the usual `relative`
> 
> And by the usual, I mean :
>     git diff --relative[=<path>]
> 
> What do you think? I think it would be better than adding a new option.

I think this would be complicated to check if true/false is a directory of not; it has been mentioned by Junio on another thread for a patch alike

Cheers
-- 
Laurent
Previous: Đoàn Trần Công DanhNext: Đoàn Trần Công Danh
Message 16 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.