- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在为一个开源项目生成一些补丁,我的 From: 行始终是 me@domain.com。在运行 git send-email 之前,我一直在手动将 From: 行编辑为 me-emaillist@domain.com。
例子:
From fab0cf45f10686688a8138f60a09505200cbb2a4 Mon Sep 17 00:00:00 2001
From: John Doe <me-emaillist@domain.com>
Date: Mon, 25 Feb 2013 23:06:23 -0500
Subject: [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks
在考虑了 mvp 的答案后,我的明确答案是:
git am
在上游存储库中设置作者姓名时使用 From: 行。最佳答案
与 git1.8.4 (July 2013) ,您现在可以设置“来自字段”:
"
git format-patch
" learned "--from[=whom]
" option, which sets the "From:
" header to the specified person (or the person who runs the command, if "=whom
" part is missing) and move the original author information to an in-bodyFrom:
header as necessary.
参见 commit a90804752f6ab2b911882d47fafb6c2b78f447c3 :
format-patch
generates emails with the "From
" address set to the author of each patch. If you are going to send the emails, however, you would want to replace the author identity with yours (if they are not the same), and bump the author identity to an in-bodyheader.Normally this is handled by
git-send-email
, which does the transformation before sending out the emails. However, some workflows may not use send-email (e.g., imap-send, or a custom script which feeds the mbox to a non-git MUA). They could each implement this feature themselves, but getting it right is non-trivial (one must canonicalize the identities by reversing any RFC2047 encoding or RFC822 quoting of the headers, which has caused many bugs in send-email over the years).This patch takes a different approach: it teaches format-patch a "
--from
" option which handles the ident check and in-body header while it is writing out the email.
It's much simpler to do at this level (because we haven't done any quoting yet), and any workflow based on format-patch can easily turn it on.Signed-off-by: Jeff King
<peff@peff.net>
您现在可以:
git format-path --from=...
与:
--from::
--from=<ident>::
Use
ident
in theFrom:
header of each commit email.
If the author ident of the commit is not textually identical to the providedident
, place aFrom:
header in the body of the message with the original author.
If noident
is given, use the committer ident.Note that this option is only useful if you are actually sending the emails and want to identify yourself as the sender, but retain the original author (and
git am
will correctly pick up the in-body header).
Note also thatgit send-email
already handles this transformation for you, and this option should not be used if you are feeding the result togit send-email
.
2016 年 8 月更新(3 年后)
参见 commit 6bc6b6c (2016 年 8 月 1 日)Josh Triplett ( joshtriplett
) .
(由 Junio C Hamano -- gitster
-- merge 于 commit db40a62 ,2016 年 8 月 10 日)
format-patch
:format.from
gives the default for--from
This helps users who would prefer format-patch to default to
--from
,and makes it easier to change the default in the future.
git config
man page now includes :
format.from
:Provides the default value for the
--from
option to format-patch.
Accepts a boolean value, or a name and email address.
- If
false
,format-patch
defaults to--no-from
, using commit authors directly in the "From:" field of patch mails.- If
true
,format-patch
defaults to--from
, using your committer identity in the "From:
" field of patch mails and including a "From:
" field in the body of the patch mail if different.- If set to a non-boolean value, format-patch uses that value instead of your committer identity.
Defaults to
false
.
请注意,使用 Git 2.26(2020 年第一季度)可以更好地管理空间。
参见 commit f696a2b , commit ffbea18 , commit f447d02 , commit b6537d8 (2020 年 2 月 11 日)Jeff King ( peff
) .
(由 Junio C Hamano -- gitster
-- merge 于 commit d880c3d ,2020 年 2 月 17 日)
mailinfo
: be more liberal with header whitespaceSigned-off-by: Jeff King
RFC822 and friends allow arbitrary whitespace after the colon of a header and before the values.
I.e.:Subject:foo
Subject: foo
Subject: fooall have the subject "
foo
". Butmailinfo
requires exactly one space.
This doesn't seem to be bothering anybody, but it is pickier than the standard specifies. And we can easily just soak up arbitrary whitespace there in our parser, so let's do so.Note that the test covers both too little and too much whitespace, but the "too much" case already works fine (because we later eat leading and trailing whitespace from the values).
使用 Git 2.38(2022 年第 3 季度),“ git format-patch --from=<ident>
”( man ) 可以被告知添加体内 From:
即使对于由给定 <ident>
创作的提交也是如此与 --force-in-body-from
"选项。
参见 commit d5fc07d , commit 34bc1b1 , commit b84d013 (2022 年 8 月 29 日)Junio C Hamano ( gitster
) .
(由 Junio C Hamano -- gitster
-- 在 commit 0e2a476 中 merge ,2022 年 9 月 9 日)
format-patch
: allow forcing the use of in-bodyFrom:
header
Users may be authoring and committing their commits under the same e-mail address they use to send their patches from, in which case they shouldn't need to use the in-body
From:
line in their outgoing e-mails.
At the receiving end, "git am
"(man) will use the address on theFrom:
header of the incoming e-mail and all should be well.Some mailing lists, however, mangle the From: address from what the original sender had; in such a situation, the user may want to add the in-body "
From:
" header even for their own patches.git format-patch --[no-]force-in-body-from` was invented for such users.
git format-patch
现在包含在其 man page 中:
--[no-]force-in-body-from
With the e-mail sender specified via the
--from
option, bydefault, an in-body "From:" to identify the real author ofthe commit is added at the top of the commit log message ifthe sender is different from the author.With this option,the in-body "
From:
" is added even when the sender and theauthor have the same name and address, which may help if themailing list software mangles the sender's identity.
关于git - 如何更改 From : address used for git format-patch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15081915/
我在优化 JOIN 以使用复合索引时遇到问题。我的查询是: SELECT p1.id, p1.category_id, p1.tag_id, i.rating FROM products p1
我有一个简单的 SQL 查询,我正在尝试对其进行优化以删除“使用位置;使用临时;使用文件排序”。 这是表格: CREATE TABLE `special_offers` ( `so_id` int
我有一个具有以下结构的应用程序表 app_id VARCHAR(32) NOT NULL, dormant VARCHAR(6) NOT NULL, user_id INT(10) NOT NULL
此查询的正确索引是什么。 我尝试为此查询提供不同的索引组合,但它仍在使用临时文件、文件排序等。 总表数据 - 7,60,346 产品= '连衣裙' - 总行数 = 122 554 CREATE TAB
为什么额外的是“使用where;使用索引”而不是“使用索引”。 CREATE TABLE `pre_count` ( `count_id`
我有一个包含大量记录的数据库,当我使用以下 SQL 加载页面时,速度非常慢。 SELECT goal.title, max(updates.date_updated) as update_sort F
我想知道 Using index condition 和 Using where 之间的区别;使用索引。我认为这两种方法都使用索引来获取第一个结果记录集,并使用 WHERE 条件进行过滤。 Q1。有什
I am using TypeScript 5.2 version, I have following setup:我使用的是TypeScript 5.2版本,我有以下设置: { "
I am using TypeScript 5.2 version, I have following setup:我使用的是TypeScript 5.2版本,我有以下设置: { "
I am using TypeScript 5.2 version, I have following setup:我使用的是TypeScript 5.2版本,我有以下设置: { "
mysql Ver 14.14 Distrib 5.1.58,用于使用 readline 5.1 的 redhat-linux-gnu (x86_64) 我正在接手一个旧项目。我被要求加快速度。我通过
在过去 10 多年左右的时间里,我一直打开数据库 (mysql) 的连接并保持打开状态,直到应用程序关闭。所有查询都在连接上执行。 现在,当我在 Servicestack 网页上看到示例时,我总是看到
我使用 MySQL 为我的站点构建了一个自定义论坛。列表页面本质上是一个包含以下列的表格:主题、上次更新和# Replies。 数据库表有以下列: id name body date topic_id
在mysql中解释的额外字段中你可以得到: 使用索引 使用where;使用索引 两者有什么区别? 为了更好地解释我的问题,我将使用下表: CREATE TABLE `test` ( `id` bi
我经常看到人们在其Haxe代码中使用关键字using。它似乎在import语句之后。 例如,我发现这是一个代码片段: import haxe.macro.Context; import haxe.ma
这个问题在这里已经有了答案: "reduce" or "apply" using logical functions in Clojure (2 个答案) 关闭 8 年前。 “and”似乎是一个宏,
这个问题在这里已经有了答案: "reduce" or "apply" using logical functions in Clojure (2 个答案) 关闭 8 年前。 “and”似乎是一个宏,
我正在考虑在我的应用程序中使用注册表模式来存储指向某些应用程序窗口和 Pane 的弱指针。应用程序的一般结构如下所示。 该应用程序有一个 MainFrame 顶层窗口,其中有几个子 Pane 。可以有
奇怪的是:。似乎a是b或多或少被定义为id(A)==id(B)。用这种方式制造错误很容易:。有些名字出人意料地出现在Else块中。解决方法很简单,我们应该使用ext==‘.mp3’,但是如果ext表面
我遇到了一个我似乎无法解决的 MySQL 问题。为了能够快速执行用于报告目的的 GROUP BY 查询,我已经将几个表非规范化为以下内容(该表由其他表上的触发器维护,我已经同意了与此): DROP T
我是一名优秀的程序员,十分优秀!