Is there an easy way to get a conflict summary after running a cvs update?
I work on a large project and after doing some work I need to do an update. The list of changes coming back from the cvs update command is several pages long and I’d like to see only the list of conflicts (starts with ‘C’) repeated at the end of the cvs update command output.
The solution needs to work from the command line.
If my normal 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 a single command (possibly a short script or alias) that outputs the normal cvs output as it happens followed by a summary of conflicts.
Given the specification, it seems that you need a minor adaptation of Martin York’s solution (because that only shows the conflicts and not the normal log information). Something like this – which might be called ‘cvsupd’:
The trap commands ensure that the log file is not left around. It catches the normal signals – HUP, INT, QUIT, PIPE and TERM (respectively) and 0 traps any other exit from the shell.