Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git-C-C似乎不起作用_Git_Git Blame - Fatal编程技术网

Git-C-C似乎不起作用

Git-C-C似乎不起作用,git,git-blame,Git,Git Blame,在报告中说(我的重点): C[] 除了-M之外,还可以检测从同一提交中修改的其他文件中移动或复制的行。当您重新组织程序并在文件间移动代码时,这非常有用如果两次给出此选项,则命令会在创建文件的提交中额外查找其他文件的副本。如果三次给出此选项,则命令会在任何提交中额外查找其他文件的副本。[……] 首先,“提交中创建文件的其他文件”是什么意思? 它是否查找在添加文件的同一提交中修改的文件?或者它会查找添加该文件的提交树中简单存在的所有文件吗 我尝试了一个示例,其中我在同一个提交中创建了一个非空文件(名

在报告中说(我的重点):

C[]

除了-M之外,还可以检测从同一提交中修改的其他文件中移动或复制的行。当您重新组织程序并在文件间移动代码时,这非常有用如果两次给出此选项,则命令会在创建文件的提交中额外查找其他文件的副本。如果三次给出此选项,则命令会在任何提交中额外查找其他文件的副本。[……]

首先,“提交中创建文件的其他文件”是什么意思? 它是否查找在添加文件的同一提交中修改的文件?或者它会查找添加该文件的提交树中简单存在的所有文件吗

我尝试了一个示例,其中我在同一个提交中创建了一个非空文件(名为
source
)和一个空文件(名为
dest
)。在下面的提交中,我做了一些无关的事情。在第三次也是最后一次提交中,我将几行从
source
复制到
dest
。结果如下所示(为了尽量避免混淆git的算法,内容相当大,对此我深表歉意):

$git init
$cat来源
--增量在我们找到条目时以增量方式显示它们
-b为边界提交显示空白SHA-1(默认值:关闭)
--根用户不将根用户提交视为边界(默认值:关闭)
--显示统计信息显示工作成本统计信息
--分数调试显示错误条目的输出分数
-f、 --显示名称显示原始文件名(默认值:自动)
-n、 --显示编号显示原始行号(默认值:关闭)
-p、 --以机器消费设计的形式展示瓷器
--行瓷器显示带有每行提交信息的瓷器格式
-c使用与git annotate相同的输出模式(默认值:off)
-t显示原始时间戳(默认值:关闭)
-l显示长提交SHA1(默认值:关闭)
-s禁止显示作者姓名和时间戳(默认值:关闭)
-e、 --显示电子邮件显示作者电子邮件而不是姓名(默认值:关闭)
-忽略空格差异
--最少花费额外的周期来找到更好的匹配
-S使用来自的修订,而不是调用git rev list
--内容使用的内容作为最终图像
-C[]查找文件内和文件间的行副本
-M[]查找文件内和文件间的行移动
-L仅处理线范围n,m,从1开始计数
--abbrev[=]使用数字显示SHA-1
$cat dest
dest中的第一个初始行
dest中的第二个初始行
$git添加源目标
$git commit-m“添加源文件和目标文件”
$touch新文件
$git添加新文件
$git commit-m“添加无关文件”
$(将某些行从源复制到目标)
$cat dest
dest中的第一个初始行
--显示统计信息显示工作成本统计信息
--分数调试显示错误条目的输出分数
-f、 --显示名称显示原始文件名(默认值:自动)
-n、 --显示编号显示原始行号(默认值:关闭)
-p、 --以机器消费设计的形式展示瓷器
--行瓷器显示带有每行提交信息的瓷器格式
-c使用与git annotate相同的输出模式(默认值:off)
-t显示原始时间戳(默认值:关闭)
-l显示长提交SHA1(默认值:关闭)
-s禁止显示作者姓名和时间戳(默认值:关闭)
-e、 --显示电子邮件显示作者电子邮件而不是姓名(默认值:关闭)
-忽略空格差异
--最少花费额外的周期来找到更好的匹配
-S使用来自的修订,而不是调用git rev list
--内容使用的内容作为最终图像
dest中的第二个初始行
$git添加目的地
$git commit-m“将行从源复制到目标”
$git log--pretty=oneline
6b0f18daaf83ec83d3f53b4a43f4188de3ce87e6将行从源复制到目标
f1d66ad3dacb8e589747ed02b42d9135081b3704添加不相关文件
2b8275dc73ffd88d7adb6f90a2050ef14088019a添加源文件和目标文件
$git责备dest
^2b8275d-1)目的地第一条初始线
6b0f18da-2)--显示统计信息显示工作成本统计信息
6b0f18da-3)——分数调试显示错误条目的输出分数
6b0f18da-4)-f,--显示名称显示原始文件名(默认值:自动)
6b0f18da-5)-n,--显示编号显示原始行号(默认值:关闭)
6b0f18da-6)-p,--为机器消费设计的陶瓷展
6b0f18da-7)--行瓷器显示带有每行提交信息的瓷器格式
6b0f18da-8)-c使用与git annotate相同的输出模式(默认值:off)
6b0f18da-9)-不显示原始时间戳(默认值:关闭)
6b0f18da-10)-l显示长提交SHA1(默认值:关闭)
6b0f18da-11)-s抑制作者姓名和时间戳(默认值:关闭)
6b0f18da-12)-e,--显示电子邮件显示作者电子邮件而不是姓名(默认值:关闭)
6b0f18da-13)-w忽略空白差异
6b0f18da-14)--最少花费额外的周期来找到更好的匹配
6b0f18da-15)-S使用来自的修订版,而不是调用git版本列表
6b0f18da-16)--内容使用的内容作为最终图像
^2b8275d-17)目的地第二条初始线路
$git责备-C目的地
^2b8275d-1)目的地第一条初始线
6b0f18da-2)--显示统计信息显示工作成本统计信息
6b0f18da-3)——分数调试显示错误条目的输出分数
6b0f18da-4)-f,--显示名称显示原始文件名(默认值:自动)
6b0f18da-5)-n,--显示编号显示原始行号(默认值:关闭)
6b0f18da-6)-p,--福岛瓷器展
$ git init
$ cat source
--incremental         Show blame entries as we find them, incrementally
-b                    Show blank SHA-1 for boundary commits (Default: off)
--root                Do not treat root commits as boundaries (Default: off)
--show-stats          Show work cost statistics
--score-debug         Show output score for blame entries
-f, --show-name       Show original filename (Default: auto)
-n, --show-number     Show original linenumber (Default: off)
-p, --porcelain       Show in a format designed for machine consumption
--line-porcelain      Show porcelain format with per-line commit information
-c                    Use the same output mode as git-annotate (Default: off)
-t                    Show raw timestamp (Default: off)
-l                    Show long commit SHA1 (Default: off)
-s                    Suppress author name and timestamp (Default: off)
-e, --show-email      Show author email instead of name (Default: off)
-w                    Ignore whitespace differences
--minimal             Spend extra cycles to find better match
-S <file>             Use revisions from <file> instead of calling git-rev-list
--contents <file>     Use <file>'s contents as the final image
-C[<score>]           Find line copies within and across files
-M[<score>]           Find line movements within and across files
-L <n,m>              Process only line range n,m, counting from 1
--abbrev[=<n>]        use <n> digits to display SHA-1s

$ cat dest
first initial line in dest
second initial line in dest

$ git add source dest
$ git commit -m "Add source and dest files"
$ touch new-file
$ git add new-file
$ git commit -m "Add irrelevant file"
$ (copy some lines from source to dest)
$ cat dest
first initial line in dest
--show-stats          Show work cost statistics
--score-debug         Show output score for blame entries
-f, --show-name       Show original filename (Default: auto)
-n, --show-number     Show original linenumber (Default: off)
-p, --porcelain       Show in a format designed for machine consumption
--line-porcelain      Show porcelain format with per-line commit information
-c                    Use the same output mode as git-annotate (Default: off)
-t                    Show raw timestamp (Default: off)
-l                    Show long commit SHA1 (Default: off)
-s                    Suppress author name and timestamp (Default: off)
-e, --show-email      Show author email instead of name (Default: off)
-w                    Ignore whitespace differences
--minimal             Spend extra cycles to find better match
-S <file>             Use revisions from <file> instead of calling git-rev-list
--contents <file>     Use <file>'s contents as the final image
second initial line in dest

$ git add dest
$ git commit -m "Copy lines from source to dest"
$ git log --pretty=oneline
6b0f18daaf83ec83d3f53b4a43f4188de3ce87e6 copy lines from source to dest
f1d66ad3dacb8e589747ed02b42d9135081b3704 Add irrelevant file
2b8275dc73ffd88d7adb6f90a2050ef14088019a Add source and dest files

$ git blame dest
^2b8275d -  1) first initial line in dest
6b0f18da -  2)     --show-stats          Show work cost statistics
6b0f18da -  3)     --score-debug         Show output score for blame entries
6b0f18da -  4)     -f, --show-name       Show original filename (Default: auto)
6b0f18da -  5)     -n, --show-number     Show original linenumber (Default: off)
6b0f18da -  6)     -p, --porcelain       Show in a format designed for machine consumption
6b0f18da -  7)     --line-porcelain      Show porcelain format with per-line commit information
6b0f18da -  8)     -c                    Use the same output mode as git-annotate (Default: off)
6b0f18da -  9)     -t                    Show raw timestamp (Default: off)
6b0f18da - 10)     -l                    Show long commit SHA1 (Default: off)
6b0f18da - 11)     -s                    Suppress author name and timestamp (Default: off)
6b0f18da - 12)     -e, --show-email      Show author email instead of name (Default: off)
6b0f18da - 13)     -w                    Ignore whitespace differences
6b0f18da - 14)     --minimal             Spend extra cycles to find better match
6b0f18da - 15)     -S <file>             Use revisions from <file> instead of calling git-rev-list
6b0f18da - 16)     --contents <file>     Use <file>'s contents as the final image
^2b8275d - 17) second initial line in dest
$ git blame -C dest
^2b8275d -  1) first initial line in dest
6b0f18da -  2)     --show-stats          Show work cost statistics
6b0f18da -  3)     --score-debug         Show output score for blame entries
6b0f18da -  4)     -f, --show-name       Show original filename (Default: auto)
6b0f18da -  5)     -n, --show-number     Show original linenumber (Default: off)
6b0f18da -  6)     -p, --porcelain       Show in a format designed for machine consumption
6b0f18da -  7)     --line-porcelain      Show porcelain format with per-line commit information
6b0f18da -  8)     -c                    Use the same output mode as git-annotate (Default: off)
6b0f18da -  9)     -t                    Show raw timestamp (Default: off)
6b0f18da - 10)     -l                    Show long commit SHA1 (Default: off)
6b0f18da - 11)     -s                    Suppress author name and timestamp (Default: off)
6b0f18da - 12)     -e, --show-email      Show author email instead of name (Default: off)
6b0f18da - 13)     -w                    Ignore whitespace differences
6b0f18da - 14)     --minimal             Spend extra cycles to find better match
6b0f18da - 15)     -S <file>             Use revisions from <file> instead of calling git-rev-list
6b0f18da - 16)     --contents <file>     Use <file>'s contents as the final image
^2b8275d - 17) second initial line in dest
$ git blame -C -C dest
^2b8275d -  1) first initial line in dest
6b0f18da -  2)     --show-stats          Show work cost statistics
6b0f18da -  3)     --score-debug         Show output score for blame entries
6b0f18da -  4)     -f, --show-name       Show original filename (Default: auto)
6b0f18da -  5)     -n, --show-number     Show original linenumber (Default: off)
6b0f18da -  6)     -p, --porcelain       Show in a format designed for machine consumption
6b0f18da -  7)     --line-porcelain      Show porcelain format with per-line commit information
6b0f18da -  8)     -c                    Use the same output mode as git-annotate (Default: off)
6b0f18da -  9)     -t                    Show raw timestamp (Default: off)
6b0f18da - 10)     -l                    Show long commit SHA1 (Default: off)
6b0f18da - 11)     -s                    Suppress author name and timestamp (Default: off)
6b0f18da - 12)     -e, --show-email      Show author email instead of name (Default: off)
6b0f18da - 13)     -w                    Ignore whitespace differences
6b0f18da - 14)     --minimal             Spend extra cycles to find better match
6b0f18da - 15)     -S <file>             Use revisions from <file> instead of calling git-rev-list
6b0f18da - 16)     --contents <file>     Use <file>'s contents as the final image
^2b8275d - 17) second initial line in dest
$ git blame -C -C -C dest
^2b8275d dest   -  1) first initial line in dest
^2b8275d source -  2)     --show-stats          Show work cost statistics
^2b8275d source -  3)     --score-debug         Show output score for blame entries
^2b8275d source -  4)     -f, --show-name       Show original filename (Default: auto)
^2b8275d source -  5)     -n, --show-number     Show original linenumber (Default: off)
^2b8275d source -  6)     -p, --porcelain       Show in a format designed for machine consumption
^2b8275d source -  7)     --line-porcelain      Show porcelain format with per-line commit information
^2b8275d source -  8)     -c                    Use the same output mode as git-annotate (Default: off)
^2b8275d source -  9)     -t                    Show raw timestamp (Default: off)
^2b8275d source - 10)     -l                    Show long commit SHA1 (Default: off)
^2b8275d source - 11)     -s                    Suppress author name and timestamp (Default: off)
^2b8275d source - 12)     -e, --show-email      Show author email instead of name (Default: off)
^2b8275d source - 13)     -w                    Ignore whitespace differences
^2b8275d source - 14)     --minimal             Spend extra cycles to find better match
^2b8275d source - 15)     -S <file>             Use revisions from <file> instead of calling git-rev-list
^2b8275d source - 16)     --contents <file>     Use <file>'s contents as the final image
^2b8275d dest   - 17) second initial line in dest