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

Re: [PATCH v1 0/7] diff: fix -s and --no-patch

From
Sergey Organov <sorganov@gmail.com>
Date
May 12, 2023, 09:32 UTC
Message-ID
<87r0rlj3od.fsf@osv.gnss.ru>
In-Reply-To
<645df6e614f00_215cec29462@chronos.notmuch>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 13 quoted lines
> Felipe Contreras wrote:
>> This fixes an issue Sergey Organov reported.
>
> Sergey, as you can see this series fixes the issue you reported.
>
> First, I think these should remain working the same, simply for convenience:
>
>  * git diff         # default output
>  * git diff --patch # patch output
>  * git diff --raw   # raw output
>  * git diff --stat  # stat output
>
> I don't think there's a way I can be convinced otherwise.
Fine with me.
Show 7 quoted lines
>
> But there's many changes:
>
>  1. git diff -s --raw                 # before: nil, after: raw
>  2. git diff --no-patch --raw         # before: nil, after: raw
>  3. git diff --patch --no-patch --raw # before: nil, after: raw
>  4. git diff --raw --patch --no-patch # before: nil, after: raw
Fine as well.
>
> I don't think there's any way you can say my 174 changes make the code work
> "exactly the same".

I said that in the context where we discussed entirely separate issue "handling of defaults by Git commands". Irrelevant to these series as they don't touch this aspect as visible from outside, even though you do change the implementation for better.

>
> And this is better than Junio's solution, because #4 outputs a raw format,
> while in Junio's solution it doesn't output anything.
Yes, and that's where I agreed from the very beginning.
> Even if you don't agree with everything, this solution is better than the
> status quo, and it's better than Junio's solution as it fixes --no-patch
> immediately.

Yep, it fixes "--no-patch" semantics indeed, and as I already said, I do vote in favor of this change, for what it's worth.

Thanks, -- Sergey Organov

Previous: Felipe Contreras
Message 10 of 10 in “diff: fix -s and --no-patch”
  1. 0/7 diff: fix -s and --no-patchFelipe Contreras, May 12, 2023
  2. 1/7 line-log: set patch format explicitly by defaultFelipe Contreras, May 12, 2023
  3. 2/7 diff: introduce DIFF_FORMAT_DEFAULTFelipe Contreras, May 12, 2023
  4. 3/7 diff: make DIFF_FORMAT_NO_OUTPUT 0Felipe Contreras, May 12, 2023
  5. 4/7 test: add various tests for diff formats with -sFelipe Contreras, May 12, 2023
  6. 5/7 diff: split --no-patch from -sFelipe Contreras, May 12, 2023
  7. 6/7 diff: add --silent as alias of -sFelipe Contreras, May 12, 2023
  8. 7/7 diff: remove DIFF_FORMAT_NO_OUTPUTFelipe Contreras, May 12, 2023
  9. Felipe ContrerasMay 12, 2023
  10. Sergey OrganovMay 12, 2023

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.