Git Show – 如何避免…/ 省略

huangapple go评论60阅读模式
英文:

Git Show - how to avoid .../ omissions

问题

在Git中,我得到了很多缩写或“缩写” - 请参见下面的示例。我无法将它们解析回完整的路径,是否有一种方法可以让git-show为提交中的每个更改提供完整的路径?

到目前为止,我一直在使用以下命令,因为我不想要所有代码更改的完整详细信息。

git show --pretty=oneline --stat f760478a5788d2e8e6b0f7be793b015a9e2c043e

以下是无法解析完整路径的示例输出:

../src/MyApp.Deployment.Util/packages.config   |     9 +
.../src/MyApp.Deployment.sln                    |    65 +
.../MyApp.DeploymentServer/src/Readme.txt       |    94 +
.../x-build/cdeploy.nuspec                        |    14 +
.../PowerApplication.MyDll.Engine.dll     |   Bin 0 -> 372736 bytes
...ation.MyDll.Engine.resources (104).dll |   Bin 0 -> 16384 bytes
英文:

In Git show I am getting a lot of contractions or .../ "abbreviations" - see the example below. I am unable to resolve these back to the full path, is there a way to have git-show provide the full path for every alteration in the commit?

So far I have been using the below since I don't want the full detail of all the code changed.

git show --pretty=oneline --stat f760478a5788d2e8e6b0f7be793b015a9e2c043e

Example output where I cannot resolve the full path.

 ../src/MyApp.Deployment.Util/packages.config   |     9 +
 .../src/MyApp.Deployment.sln                    |    65 +
 .../MyApp.DeploymentServer/src/Readme.txt       |    94 +
 .../x-build/cdeploy.nuspec                        |    14 +
 .../PowerApplication.MyDll.Engine.dll     |   Bin 0 -> 372736 bytes
 ...ation.MyDll.Engine.resources (104).dll |   Bin 0 -> 16384 bytes

答案1

得分: 2

当文件路径过长时,超过默认值时,它会显示...而不是完整路径。您可以在--stat后面添加数字,以指定每行用于显示文件名和其他信息的空间大小。--stat=999几乎在所有情况下都可以使用。您可以在手册中找到更多详细信息。

--stat[=<width>[,<name-width>[,<count>]]]
> 生成差异统计信息。默认情况下,文件名部分将使用尽可能多的空间,其余部分用于图形部分。最大宽度默认为终端宽度,如果没有连接到终端,则为80列,并且可以通过<width>覆盖。文件名部分的宽度可以通过在逗号后面提供另一个宽度<name-width>来限制。图形部分的宽度可以通过使用--stat-graph-width=<width>(影响生成统计图的所有命令)或通过设置diff.statGraphWidth=<width>(不影响git format-patch)来限制。通过提供第三个参数<count>,您可以限制输出为前<count>行,如果还有更多行,则后跟...。

这些参数也可以单独设置为--stat-width=<width>、--stat-name-width=<name-width>和--stat-count=<count>。

英文:

When the filepath is too long, longer than the default value, it displays ... instead of the fullpath. You can add numbers after --stat to specify how much space each line can use to display the filename and other info. --stat=999 should work in almost all cases. You can find more details in the manual.

--stat[=<width>[,<name-width>[,<count>]]]
> Generate a diffstat. By default, as much space as necessary will be
> used for the filename part, and the rest for the graph part. Maximum
> width defaults to terminal width, or 80 columns if not connected to a
> terminal, and can be overridden by <width>. The width of the filename
> part can be limited by giving another width <name-width> after a
> comma. The width of the graph part can be limited by using
> --stat-graph-width=<width> (affects all commands generating a stat graph) or by setting diff.statGraphWidth=<width> (does not affect git
> format-patch). By giving a third parameter <count>, you can limit the
> output to the first <count> lines, followed by ... if there are more.
>
> These parameters can also be set individually with
> --stat-width=<width>, --stat-name-width=<name-width> and --stat-count=<count>.

huangapple
  • 本文由 发表于 2023年7月20日 15:40:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76727662.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定