How can I get a summary of my cvs conflicts when performing a cvs update on the command line?

Is there an easy way to get a summary of the conflict after launch cvs update?

I am working on a large project, and after doing some work, I need to do an update. The list of changes returned by the cvs update command lasts several pages, and I would like to see only a list of conflicts (starts with "C"), repeated at the end of the cvs update command output.

The solution should work from the command line.

If my usual output is:

M src/file1.txt
M src/file2.txt
cvs server: conflicts found ...
C src/file3.txt
M src/file4.txt
M src/file5.txt

I want my new output to be:

M src/file1.txt
M src/file2.txt
cvs server: conflicts found ...
C src/file3.txt
M src/file4.txt
M src/file5.txt

Conflict Summary:
C src/file3.txt

I want this to be the only command (possibly a short script or an alias) that outputs the usual cvs output when this happens, followed by a summary of the conflicts.

+3
2

, , Martin York ( , ). - - "cvsupd":

tmp=${TMPDIR:-/tmp}/cvsupd.$$
trap "rm -f $tmp; exit 1" 0 1 2 3 13 15
cvs update "$@" | tee $tmp
if grep -s '^C' $tmp
then
    echo
    echo Conflict Summary:
    grep '^C' $tmp
fi
rm -f $tmp
trap 0
exit 0

, . - HUP, INT, QUIT, PIPE TERM () 0 .

+3

cvs handy, cvs update

, C < _ >
, :

cvs | | grep "^ C"

cvs . grep 'C'

, .

0

Source: https://habr.com/ru/post/1697395/


All Articles