有没有办法从命令行获取简短的 CVS 状态?
在执行cvs更新
时,您会得到存储库状态的一个很好的摘要,例如:
M src/file1.txt
M src/file2.txt
C src/file3.txt
A src/file4.txt
? src/file5.txt
有没有办法在不实际更新的情况下获得此信息? 我知道有 cvs status
,但这是一种冗长的方式:
===================================================================
File: file6.txt Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 /var/cvs/cvsroot/file6.txt,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
我当然可以制作一个脚本来进行从后者到前者的转换,但这似乎是浪费时间,因为 cvs 显然可以产生前者。
When doing a cvs update
, you get a nice summary of the state of the repository, for example:
M src/file1.txt
M src/file2.txt
C src/file3.txt
A src/file4.txt
? src/file5.txt
Is there a way to get this without actually updating? I know there is cvs status
, but this is way to verbose:
===================================================================
File: file6.txt Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 /var/cvs/cvsroot/file6.txt,v
Sticky Tag: (none)
Sticky Date: (none)
Sticky Options: (none)
I could of course make a script to do the transformation from the latter to the former, but it seems a waste of time since cvs can obviously produce the former.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 -n 标志来获取更新输出,而无需实际更新文件。 您还可以添加 -q(安静)来抑制任何服务器消息。
You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages.
@jmcnamara:好提示!
一直以来我一直在使用这个 bash 脚本:
@jmcnamara: Good tip!
And all this time I've been using this bash script:
我有一些别名,可能对某人有用:
这将仅显示文件名及其状态,忽略所有最新文件,删除所有 Eclipse 项目文件和共享对象,并且还会以不同的方式打印行颜色,取决于状态(例如,我有橙色表示本地修改;红色表示文件,需要合并;绿色表示本地添加等)
I have some aliases, that may be useful for somebody:
This will display only file names and their status, ignore all up-to-date files, remove all eclipse project files and shared objects and will also print the lines in different colors, depending on the status (for example, I have orange for locally modified; red for files, needing merge; green for locally added, etc)
如果您使用的是 CVSNT,您也可以执行
cvs status -q
,这也会产生比常规状态命令更简短的输出(每个文件也只有一行)。 使用较新的版本,您甚至可以执行cvs status -qq
这将跳过最新文件。If you're using CVSNT you can also just do
cvs status -q
which will also produce much briefer output than the regular status command (also just one line per file). With more recent versions you can even docvs status -qq
which will skip the up-to-date files.