限制CVS日志的输出以仅显示最近的提交

时间:2014-03-25 12:07:37

标签: cvs

我已经搜索过了,并且还没有找到类似的问题。我已经开始研究使用CVS的长期运行的项目,因此有一些巨大的CVS日志,有许多标签。这使得查看最新提交的日志输出非常困难。

从我开始处理项目的日期开始,只显示最近日志输出的最简单方法是什么?

或许只是最后的X次提交(类似于git log -n 5

1 个答案:

答案 0 :(得分:1)

经过一番研究后,我自己的解决方案是使用CVS日志命令的-d选项

# Get all log output since yyyy-mm-dd
cvs log -d ">=2014-02-17" <filename>

# Get all output before yyyy-mm-dd
cvs log -d "<2014-03-17" <filename>

我在.bash_rc脚本中创建了这些方便的命令

# Date commands to output last week / month in 'yyyy-mm-dd' format
alias last-week='date -d last-week +%Y-%m-%d'
alias last-month='date -d last-month +%Y-%m-%d'

# Fetch the CVS log (without tags) for the last week / month
alias cvs-log-lw='cvs log -N -d ">=`last_week`"'
alias cvs-log-lm='cvs log -N -d ">=`last_month`"'

当我想要获取上周文件的日志历史记录时,我可以执行

cvs-log-lw <filename>

我不知道只显示最后X次提交的方法。

相关问题