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

Re: [BUG?] Patches created with 'diff.noprefix=true' don't 'git apply'.

From
Junio C Hamano <gitster@pobox.com>
Date
May 8, 2014, 16:56 UTC
Message-ID
<xmqqa9as5hvw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAO8RVvfzP_nc9=nwr6JSK9s6u7DEctMpdn_5yca9h7G4TOd2Bw@mail.gmail.com>
Nathan Collins <nathan.collins@gmail.com> writes:
Show 8 quoted lines
>> What would you propose to make clickable in a renaming diff, though?
>
> Your 'Index' header looks good, and I would expect a renaming diff to
> have something like
>
>   Index: foo -> bar
>
> as in 'git status',

Heh, please don't call "Index:" *mine* --- It is a CVS abomination ;-).

For renames and copies, we do have separate "rename from" and "rename to" in the extended header part, so there is no reason to worry about them at all. I would suggest showing the name _after_ the change (unless it is a deletion---instead of showing /dev/null to signal that it was deleted, show the original filename) for consistency so that users can do "show -p | grep '^Index: ' to see what resulting paths there are without missing the renamed ones.

> but I just realized that a "clickable paths"
> option already exists in some sense! There is a '--patch-with-raw'
> option...

I do not think that would be useful (neither --stat which would be more commonly used for other reasosn), because these come at the top and by the time you see individual patch, they may be long scrolled off the top of the screen.

Of course, the CVS "Index:" or "rename to" would be the same thing if a file is heavily modified, so it may not be too big a deal, but as I said, I never felt any need to double-click, so I wouldn't be the best judge.

Previous: Nathan Collins
Message 13 of 13 in “[BUG?] Patches created with 'diff.noprefix=true' don't 'git apply'.”
  1. Nathan CollinsMay 1, 2014
  2. Jonathan NiederMay 1, 2014
  3. Nathan CollinsMay 6, 2014
  4. Jonathan NiederMay 6, 2014
  5. Junio C HamanoMay 6, 2014
  6. Nathan CollinsMay 6, 2014
  7. Junio C HamanoMay 6, 2014
  8. Nathan CollinsMay 7, 2014
  9. Junio C HamanoMay 7, 2014
  10. Nathan CollinsMay 7, 2014
  11. Nathan CollinsMay 8, 2014
  12. Nathan CollinsMay 8, 2014
  13. Junio C HamanoMay 8, 2014

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.