- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
下面的Git语句
cd periodtest/
git init
git config user.name "Test."
# verify that user.name is 'Test.'
git config user.name
touch README
git add README
git commit -a -m "period test"
checkout 结果如下
# check user name after commit
git log
And the resulting commit w/out the period was:
commit 9b7e4960fd8129059b5759d1bb937b60241fd70b
Author: Test <email@test.com>
Date: Wed Oct 1 20:28:28 2014 -0700
period test
有没有办法让那段时间保留在用户名中?
最佳答案
此行为已硬编码到 git 中。
编辑:就目前而言,这对于 git 版本 2.25.1(2020 年 2 月 27 日)仍然适用。
要在提交期间创建 author 字符串,git 会从字符串的开头和结尾删除 crud(正如 git 所说的那样)。为此,它使用 ident.c
中定义的 strbuf_addstr_without_crud
函数 - see ident.c line 426 version 2.25.1 .
看一下函数头:
/*
* Copy over a string to the destination, but avoid special
* characters ('\n', '<' and '>') and remove crud at the end
*/
static void strbuf_addstr_without_crud(struct strbuf *sb, const char *src)
See ident.c lines 225-262 version 2.25.1 .
Git 通过另一个检查特定字符的函数来确定 crud。
static int crud(unsigned char c)
{
return c <= 32 ||
c == '.' ||
c == ',' ||
c == ':' ||
c == ';' ||
c == '<' ||
c == '>' ||
c == '"' ||
c == '\\' ||
c == '\'';
}
See ident.c lines 198-210 version 2.25.1 .
正如您所看到的,一个句点被 git 视为 crud 并将被删除,目前没有您可以设置的标志或选项来避免这种行为。
这意味着您有两个选择。
您 fork git 并更改 git 创建 author 字符串的方式。
或者您在尾随句点后附加另一个字符,例如 Zero-width space (通常不会在控制台上正确打印)
或者,您始终可以在 git 邮件列表上提交功能请求,但在这种情况下,我不会抱太大希望。
关于git - Git 中的 user.name 是否可以有尾随句点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26159274/
我有以下字符串: 00:02:44.372 我想使用正则表达式来提取句号/句点。 我尝试过使用: [0-9][0-9]:[0-9][0-9]:[0-9][0-9] 选择持续时间,但我从这里去哪里?由于
我想知道如果我有这样的文件名,我如何去掉文件名中的句点: Test....1.txt 看起来像 Test 1.txt?我不希望像 1.0.1 Test.txt 这样的文件被触及。只有具有连续句点的文件
试图找到一个好的正则表达式来检测java中的句子结尾。主要问题是,如果有数字然后句点,它会将其检测为句子结尾(请参阅演示链接)。但就我而言,我希望它不将其识别为句子结尾,尽管在某些情况下可能是这样。我
我开始学习 Backbone,但 UnderscoreJS 似乎给我带来了一些问题。我收到“意外 token ”。我不确定这意味着什么。我的 JSON 看起来不错,所以我不认为这是一个原因。 var
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 9 年前。 Improve this qu
在日期时间选择器控件中,用户必须按.(句点)才能移动到不同的字段(如日、月、年) 我想通过允许用户输入日期而不输入.(句点)来覆盖此行为 有没有什么可以在 C# winforms 中以编程方式实现这一
对于那些不知道 GMAIL 的人,您可以根据原始电子邮件创建无限数量的电子邮件。如果您的电子邮件是“mygmail@gmail.com”,那么这可以通过两种方式实现: 1) 在您的 gmail 末尾的
你们中的一位 CSS 专家可以向我解释一下这个指示符(如果您愿意这样调用它的话)吗?我了解内容,只是不了解 a.button.gold。两个点? a.button.gold{ background-c
很抱歉描述模糊,找不到更好的方式来说明它。 我从 F# 开始,和许多其他人一样,我将解决的欧拉问题转换为 F#。我喜欢使用测试来运行我的代码,也喜欢 FsUnit 风格。在给定示例的帮助下,我这样做了
这是一个奇怪的。通常,当我从powershell执行外部命令时,我使用&运算符,如下所示: & somecommand.exe -p somearguments 但是,今天我遇到了像这样使用的.运算符
我想允许 . 和 a-zA-Z 字母以及 _ 和 -,我的 .. 有一些问题 有什么想法吗? 最佳答案 [A-Za-z_.-] 是一个字符类,包含您提到的所有字符。在字符类中,没有必要对 . 进行转义
所以我知道我需要使用前瞻和后视的东西,但我开始失去理智。 因此,您能否提供一个示例,并解释其含义。 我需要匹配以下序列中的点,但不匹配各个字符之间的点。 this.is.a.sentence.e.g.
在 Python 中,我需要从列表中删除几乎所有标点符号,但保留句点和逗号。我应该创建一个函数来执行此操作还是创建一个变量?基本上我想删除除字母(我已经将大写字母转换为小写)以及句点和逗号(可能还有撇
我只是想选择这些特定“边”的 ID。我已经做了一百万次了,但 jQuery 只是不想与我合作。 $( 'input[name="fd-border"]' ).change(function() {
我正在尝试制作一个正则表达式,它允许使用大小字母 + 数字创建字符串 - a-zA-z0-9 以及字符:。 -_ 如何制作这样的正则表达式? 最佳答案 以下正则表达式应该是您要查找的内容(下面的解释)
我想检查以 number 开头的字符串, period(.)和 space .为此,我使用了 regex但这并没有给出正确的答案。 输入: 1. this a paragaraph1
我在创建正则表达式验证器时遇到问题,该验证器会检查以确保输入仅包含大写或小写字母字符、空格、句点、下划线和破折号。无法通过搜索在线找到此示例。例如: 这些没问题: Dr. Marshall sam s
以下网址有效吗? http://www.example.com/module.php/lib/lib.php 根据https://www.rfc-editor.org/rfc/rfc1738部分 UR
我正在尝试发送一个采用 JSON 对象的 HttpRequest: { "some.setting.withperiods":"myvalue" } 我一直在为我的其他请求创建匿名对象,但我不能
由于大量的搜索,我已经走到了这一步,但我坚持只格式化链接而不格式化文本的方法。我希望链接在文本中包含数字,但没有空格、括号、句号或减号,并保留文本不变。该链接应以 555 123-1234 为例。
我是一名优秀的程序员,十分优秀!