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

Re: git patch format for rename

From
Stefan Beller <sbeller@google.com>
Date
Jul 6, 2016, 17:45 UTC
Message-ID
<CAGZ79kaA1208Z7kMYJR42NRvYnh4T36M6Rz5W3jok0=ZfvmyHg@mail.gmail.com>
In-Reply-To
<F58A6A72-4AE5-42FA-843D-66FF809FF1A8@jetbrains.com>

On Wed, Jul 6, 2016 at 9:00 AM, Nadya.Zabrodina@jetbrains.com <Nadya.Zabrodina@jetbrains.com> wrote:

Show 8 quoted lines
> Hi,
>
> could you please explain to me why  ‘rename from & rename to’ information is added to git patch?
> Is there any reason why git can’t recognize and apply rename-change which looks like this:
>
>     diff --git a/before.txt b/after.txt
>     --- a/before.txt
>     +++ b/after.txt

See https://github.com/git/git/blob/master/Documentation/diff-generate-patch.txt for the status quo. I think most of it grew over time and made sense at the time of implementation, so the alternatives were maybe considered, you'd need to look for the old discussions around the diff format.

Show 10 quoted lines
>
> I’m implementing a program (with an IDE) to create patches compatible with Git and want to have better understanding of the format and possible issues with it.
>
> Thanks a lot in advance.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Nadya.Zabrodina@jetbrains.com
Message 2 of 2 in “git patch format for rename”
  1. Nadya.Zabrodina@jetbrains.comJul 6, 2016
  2. Stefan BellerJul 6, 2016

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.