如何使用git repo forall命令打印repo项目和shortstat?
使用repo-forall命令,如何打印如何使用git repo forall命令打印repo项目和shortstat?,git,repo,Git,Repo,使用repo-forall命令,如何打印shortstat和repo\u项目 我在下面尝试过,它不起作用,它只打印$REPO_项目,而不打印shortstat repo forall -c 'echo $REPO_PROJECT' -c 'git diff --shortstat tagA tagB' 我想把它打印出来: project/name 1 file changed, 2 insertions(+), 2 deletions(-) 工作 有效。有一个打印项目名称的-p选项 repo
shortstat
和repo\u项目
我在下面尝试过,它不起作用,它只打印$REPO_项目
,而不打印shortstat
repo forall -c 'echo $REPO_PROJECT' -c 'git diff --shortstat tagA tagB'
我想把它打印出来:
project/name
1 file changed, 2 insertions(+), 2 deletions(-)
工作
有效。有一个打印项目名称的
-p
选项
repo forall -p -c 'git diff --shortstat tagA tagB'
在我的项目中,此命令输出如下内容:
project MTCommonServices/
9 files changed, 274 insertions(+), 216 deletions(-)
project MTConfig/
2 files changed, 12 insertions(+), 2 deletions(-)
project MTModuleOrder/
26 files changed, 764 insertions(+), 160 deletions(-)
project MTModuleProductDetail/
8 files changed, 34 insertions(+), 3 deletions(-)
project MTModuleUser/
18 files changed, 444 insertions(+), 148 deletions(-)
project MaitaoApp/
3 files changed, 137 insertions(+), 111 deletions(-)
有一个打印项目名称的
-p
选项
repo forall -p -c 'git diff --shortstat tagA tagB'
在我的项目中,此命令输出如下内容:
project MTCommonServices/
9 files changed, 274 insertions(+), 216 deletions(-)
project MTConfig/
2 files changed, 12 insertions(+), 2 deletions(-)
project MTModuleOrder/
26 files changed, 764 insertions(+), 160 deletions(-)
project MTModuleProductDetail/
8 files changed, 34 insertions(+), 3 deletions(-)
project MTModuleUser/
18 files changed, 444 insertions(+), 148 deletions(-)
project MaitaoApp/
3 files changed, 137 insertions(+), 111 deletions(-)
这并不能回答这个问题。若要评论或要求作者澄清,请在其帖子下方留下评论。-@我相信我的答案是这个问题的答案。没关系,在德国,你可以相信你想要的。正如OP所说,他遗漏了shortstat,而不是项目名称,我相信你是错的。@Clijsters我认为一个糟糕的答案仍然是一个答案。这就是投票的目的。标志用于其他情况,如人们发布后续问题作为答案等。@Clijsters也许我对
shortstat
有一些误解。根据问题的描述,我认为shortstat
意味着9个文件被更改,274个插入(+),216个删除(-)
?我在回答中添加了一个示例输出,请检查它是否正确。谢谢。这并不是问题的答案。若要评论或要求作者澄清,请在其帖子下方留下评论。-@我相信我的答案是这个问题的答案。没关系,在德国,你可以相信你想要的。正如OP所说,他遗漏了shortstat,而不是项目名称,我相信你是错的。@Clijsters我认为一个糟糕的答案仍然是一个答案。这就是投票的目的。标志用于其他情况,如人们发布后续问题作为答案等。@Clijsters也许我对shortstat
有一些误解。根据问题的描述,我认为shortstat
意味着9个文件被更改,274个插入(+),216个删除(-)
?我在回答中添加了一个示例输出,请检查它是否正确。谢谢。这里的关键是在评估的命令周围使用单引号,
,因此$REPO\u PROJECT
用于每个回购项目。如果使用了双引号“
,则在评估REPO forall
命令之前,将花费$REPO\u PROJECT
,该命令没有预期的效果。这里的关键是在评估的命令周围使用单引号”
,因此每个REPO项目将花费$REPO\u PROJECT
。如果双引号“使用
,然后在评估REPO forall命令之前花费$REPO\u PROJECT,该命令没有预期效果。