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

RE: CR position changed in exported patch file subject section

From
CBChen, Boyang <boyang.chen@amd.com>
Date
Feb 26, 2024, 05:53 UTC
Message-ID
<IA0PR12MB822712F1B3E5205711493D55EF5A2@IA0PR12MB8227.namprd12.prod.outlook.com>
In-Reply-To
<IA0PR12MB822711B89738EDA0E2F25150EF5A2@IA0PR12MB8227.namprd12.prod.outlook.com>
[AMD Official Use Only - General]

Hi guys, Pls ignore the first email as there is some format mistake in it and pick this one. Recently I faced a question that the CR position in the patch is not in line with the git log. Below are the steps to reproduce.

touch aaa git add aaa git commit -m "Add a file to test, make sure that the message is a bit long but in a single line"

D:\Source\CustomerRepoTest\Platform1>git log -3 commit 0c9f8555c55c73fd4e5392c8f8516c389f362d17 (HEAD -> test)
Author: Boyang Chen
Date:   Mon Feb 26 11:16:00 2024 +0800
    Add a file to test, make make sure that the message is a bit long but in a single line
We can confirm that the commit message is in a single line in the output of git log command(pls refer to above output).

And use below command to generate a patch file. git format-patch -3 --stdout > exported_3.patch

We can observe that the commit message's CR position is changed in the exported patch, the subject section is split to two lines(pls refer to below output).
From 0c9f8555c55c73fd4e5392c8f8516c389f362d17 Mon Sep 17 00:00:00 2001
From: Boyang Chen
Date: Mon, 26 Feb 2024 11:16:00 +0800
Subject: [PATCH 3/3] Add a file to test, make make sure that the message is a
bit long but in a single line

--- aaa | 0 1 file changed, 0 insertions(+), 0 deletions(-)

Actually, we want to keep the commit message format(subject section) in the patch same as the git log output. I have tried most of arguments of git format-patch and even upgrade the git version. But no good result is observed.

Could you please help to look at this question? Thanks a lot!

BR Boyang

Previous: Chen, BoyangNext: Jeff King
Message 2 of 4 in “CR position changed in exported patch file subject section”
  1. Chen, BoyangFeb 26, 2024
  2. Chen, BoyangFeb 26, 2024
  3. Jeff KingFeb 26, 2024
  4. Chen, BoyangFeb 26, 2024

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.